Add Schedule items using ASP.NET Core Razor pages in a web app (NOT MVC) and the corresponding code behind.

My user will be selecting a begin date and time and an end date and time from timepicker controls. Once these (and other information for the appointment) are chosen I need to add an appointment to the Schedule in Agenda view. The appointments may cross days and I want to be able to show appointments of different types with corresponding colors. I want to do this in server-side code, not client-side.

Once an item has been added to the Schedule this way, I also need to be able to modify appointment details from code or by using Model properties.

5 Replies

VS Velmurugan S Syncfusion Team July 3, 2018 03:39 PM UTC

Hi Jim, 
  
Thanks for Contacting Syncfusion support. 
  
We have prepared the sample to meet your requirement of adding appointment in agenda view by including ADD EVENT option additionally to the toolbar item (new event), which can be downloaded from the following location. Also you can set different colors to the appointment based on your categorized types. Here we have categorized the types with the resources support. If we have misunderstood your requirement on this query of agenda, kindly correct us with some more additional information. 
 
 
Also, we would like to inform you that our JS2 Schedule control is developed based on client side rendering and implemented in TypeScript language. Therefore, only possible way to meet your requirement is using the client side method. In the above sample, we have used the client side method to include the add icon to create the appointment. Also, you can modify the appointment by using the “Edit” option available in the quick popup window. Please refer to the following code example used in the above sample to include the add icon (new event) in the header bar to perform the create appointment operation in agenda view appointments. 
 
Index.cshtml: 
 
<ejs-schedule id="schedule" height="550px" currentView="Agenda" selectedDate="new DateTime(2018, 2, 10)" actionBegin="onActionBegin"> 
    <e-schedule-eventsettings dataSource="@Model.Datasource"> 
    </e-schedule-eventsettings> 
    <e-schedule-resources> 
        <e-resource dataSource="@Model.ResourceDatasource" field="OwnerId" title="Attendees" name="Conferences" textField="text" idField="id" colorField="color" allowMultiple="true"></e-resource> 
    </e-schedule-resources> 
    <e-schedule-views> 
        <e-view option="Agenda"></e-view> 
    </e-schedule-views> 
</ejs-schedule> 
 
<script> 
    function onActionBegin(args) { 
        if (args.requestType === 'toolbarItemRendering') { 
            var addIcon = { 
                align: 'Right', prefixIcon: 'e-icon-add', text: 'newEvent', 
                cssClass: 'e-add', overflow: 'Show' 
            }; 
            args.items.push(addIcon); 
        } 
    } 
</script> 
 
Kindly check with the above sample and let us know if you need any further assistance on this.  
 
Regards,
Velmurugan



JI JimN July 3, 2018 03:44 PM UTC

This is great! I will hopefully have time to add this functionality to my code before the demo tonight. Now, if someone could take a look at the forum post I just added about a CRUD command column button, I'll be good to go for a day or two! LOL

Thanks again


VS Velmurugan S Syncfusion Team July 5, 2018 11:42 AM UTC

Hi Jim, 

Thanks for your update. 

We have analyzed your requirement regarding Schedule CRUD operation in ASP.Core Razor application and preparing the sample in it. We will update the details soon in the corresponding forum entry. 
 
Regards, 
Velmurugan


NP Nitin Pawar April 12, 2024 06:24 AM UTC

did you get a chance to find example of  Schedule CRUD operation in ASP.Core Razor application



VR Vijay Ravi Syncfusion Team April 15, 2024 02:55 PM UTC

Hi Nitin,

 

We have prepared the below CRUD sample in Core platform for your reference and kindly refer the below KB link.

 

KB: https://www.syncfusion.com/kb/8488/how-to-perform-crud-operation-on-schedule

 

Sample: kindly check on the attached sample.

 

In the sample, modify the connection string based on your database connection. Using the Migrations apply the changes to the database by running the following command in the Package Manager console:

PM> update-database

 

Migrations automate the creation of database based on our Model. The EF Core packages required for migration will be added with .NET Core project setup.

Now, simply build and run your project to view the output.

 

Refer the shared sample for your reference.

 

Please get back to us if you need any further assistance

 

Regards,

Vijay


Attachment: schedulerCrudusingentity_78a0c361.zip

Loader.
Up arrow icon