We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Example CRUD in project ASP.NET Core .NetFramework 4.7.2 or 4.6.1

Hi,

I have done all the examples I found on the syncfusion website (documentation and forum), but none of them are about .NetFramework 4.6.1 or 4.7.2.
Examples that work with the .NetCore 2.1 platform when testing in .NetFramework do not compile. As an example (EJ2ScheduleSample project):
Tag "<e-datamanager url =" Home / LoadData "crudUrl =" Home / UpdateData "adapter =" UrlAdaptor "crossDomain =" true "> </ e-datamanager>" does not compile and must be changed outside "<e-schedule -eventsettings" by
var dataManager = new DataManager () {Url = "Schedules / GetData", CrudUrl = "Schedules / CrudData", Adapter = "UrlAdaptor", CrossDomain = true};
Then you have to add <e-schedule-eventsettings dataSource = "dataManager" template = "# apptemplate">.
Once made the changes and compiled the project, it works but does not link the data read in GetData with the control and in CrudData the "param" only receives value in "action", the rest are NULL.

You can give me an example where you can make CRUD with your product. I imagine that I will have the same problems with the GRID object.

Attachment: IncidenciaSyncfusion_d32d0bb2.zip

6 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team December 13, 2018 05:31 AM UTC

 
Thank you for contacting Syncfusion support. 
 
Kindly use the below code example in your sample to overcome the issue and for the same we have prepared the below sample with the provided code example. 
 
<e-schedule-eventsettings template="#apptemplate"> 
    <e-data-manager url="/Home/LoadData" crudUrl="Home/UpdateData" adaptor="UrlAdaptor" crossDomain="true"></e-data-manager> 
</e-schedule-eventsettings> 
 
Regards, 
Karthigeyan 
 
 
 



VP Victor Perez December 14, 2018 06:38 AM UTC

Hi,
The insert  rows in database has worked correctly.
But, none of the records in the control is displayed.
I have reviewed the example on which I have performed the tests (published by Syncfusion) and it also does not display the rows.

Code:

Models/ScheduleEvent

    public class ScheduleEvent
    {
        [Key]
        public int Id { get; set; }
        public string Subject { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public string StartTimezone { get; set; }
        public string EndTimezone { get; set; }
        public string Location { get; set; }
        public string Description { get; set; }
        public bool IsAllDay { get; set; }
        public int? RecurrenceId { get; set; }
        public string RecurrenceRule { get; set; }
        public string RecurrenceException { get; set; }
    }

view/Index.
  <ejs-schedule id="schedule" height="100%" >
      <e-schedule-eventsettings>
        <e-data-manager Url="Test/LoadData" crudUrl="Test/UpdateData" adaptor="UrlAdaptor" crossDomain="true">
        </e-data-manager>
      </e-schedule-eventsettings>
 </ejs-schedule>

Controllers/TestController
.
..
.
        [HttpPost]
        public List<ScheduleEvent> LoadData([FromBody]Params param)
        {
            return _context.ScheduleEvent.ToList();
        }

        public class Params
        {
            public DateTime StartDate { get; set; }
            public DateTime EndDate { get; set; }
        }

        [HttpPost]
        public List<ScheduleEvent> UpdateData([FromBody]EditParams param) .......


Image select rows DBS




KK Karthigeyan Krishnamurthi Syncfusion Team December 17, 2018 10:03 AM UTC

Hi Victor  
   
Thanks for your update. 
 
The followings are the possible cause for the reported scenario. 
 
  1. In the provided image, event collection date is Dec 15, 2018 and when no value is assigned to selectedDate property then the system date will be set as Scheduler current date. Therefore, event rendered view range may not be displayed during the initial load. Kindly check the Month view, event will be displayed.
 
  1. Wrong field mapping as shown below.
 
<ejs-schedule id="schedule" height="550px" 
              popupOpen="onPopupOpen" cssClass="schedule-date-header-template" dateHeaderTemplate="@template"> 
    <e-schedule-eventsettings template="#apptemplate"> 
    <!-- wrong field mapping is done below --> 
        <e-eventsettings-fields id="TravelId"> 
            <e-field-subject name="TravelSummary"></e-field-subject> 
            <e-field-location name="Source"></e-field-location> 
            <e-field-description name="Comments"></e-field-description> 
            <e-field-isallday name="FullDay"></e-field-isallday> 
            <e-field-starttime name="DepartureTime"></e-field-starttime> 
            <e-field-endtime name="ArrivalTime"></e-field-endtime> 
            <e-field-starttimezone name="Origin"></e-field-starttimezone> 
            <e-field-endtimezone name="Destination"></e-field-endtimezone> 
        </e-eventsettings-fields> 
        <e-data-manager url="/Home/LoadData" crudUrl="Home/UpdateData" adaptor="UrlAdaptor" crossDomain="true"></e-data-manager> 
    </e-schedule-eventsettings> 
</ejs-schedule> 

 
Kindly check the above cases and if the issue persists, kindly share your index page and db collection details to proceed further. 
 
 
Regards, 
Karthigeyan 



VP Victor Perez December 19, 2018 06:18 PM UTC

Hi,
I am attached to the word document, .Bad of data bae and example application with the objects from which I can not perform CRUD or I can perform CRUD but not visualize data.
1- Schedule_Datasource: I see data but I can not perform CRUD.
2- Schedule_Datamanager: I do not see data but I can perform CRUD (only add)
3-Contacts: Grid that I can visualize and edit, add and delete in the control, but not in Database.

The SQL SERVER database has two tables: Contacts and ScheduleEvents.

I've made all the combinations I've seen on the Syncfusion website.
Many examples DO NOT WORK, HAVE SYNTAX ERRORS and are NOT complete to perform a test.

Images Result






Attachment: CRUD_Syncfusion_DontWork_8cb2380e.zip


VD Vinitha Devi Murugan Syncfusion Team December 20, 2018 01:12 PM UTC

Hi Victor, 
 
Please find the below responses for your queries. 
 
Q1: Schedule_Datasource: I see data but I cannot perform CRUD. 
 
We are facing problem while running your shared sample. Therefore, we have prepared the sample with your shared code we could see that you are not using data manger that is the reason the changes only reflected in UI not in DB (as CRUD actions are performed at client side and not at the server). We have prepared a video demo for your reference with the below sample which can be downloaded from the following location.  
 
 
 
Please refer the documentation link. 
 
 
Q2: Schedule_Datamanager: I do not see data but I can perform CRUD (only add). 
 
We tried to reproduce your reported scenario at our end but CRUD working fine at our end. Please refer the above video demo.  
 
We suspect that the reason for the issue might be due to LoadData not called on initial loading. Please ensure it with your end. 
 
 
Q3-Contacts: Grid that I can visualize and edit, add and delete in the control, but not in Database. 
 
We have analyzed the sample which you have shared with us. We could see that you are using “local data” in Grid and performing editing operations on the local data at client side. This is the reason why, the Grid control gets updated and not the database(as CRUD actions are performed at client side and not at the server).  
 
We suggest you to bind the data source for Grid using the “RemoteSaveAdaptor”. With remoteSaveAdaptor in Grid, you can bind local data to Grid and perform the CRUD operations at server side to update in database. Please refer the documentation link below,  
 
Please get back to us if you need further assistance. 
 
Regards, 
M.Vinitha devi. 
 
 



VP Victor Perez December 20, 2018 04:00 PM UTC

Hi,
Where is the difference?

Your Project


Me project


The destination is different because we use .NET dlls that use Windows platform and we do not need to implement this project on NO windows servers

Thanks 
Regards
Víctor Pérez

Loader.
Live Chat Icon For mobile
Up arrow icon