We have a C# MVC application that allows employees to enter hours spent per day on various activities for a given week (see the attached screenshot). However, one of the requirements of the application is that it update our Enterprise Resource Planning (ERP) system that we currently use. These updates must go into an intermediate table between this application and the ERP system. A stored procedure then picks up the data from this intermediate table and updates the ERP system appropriately. The trouble we are running into is getting the data accurately into the intermediate table. It needs the data put in as daily totals...
Date Hours
6/1/2016 9
6/2/2016 8
6/3/2016 8.5
Can I mark every row in the grid as changed, whether it has changed or not, so that all the rows get sent over to my controller? We'd like to do this to make the processing of the data that's going into the intermediate table easier. Or, is it possible to send over the "Daily Totals" row in the footer? These are fields that are set on the DataSource using the built in Aggregates method. Our DataSource is configured as follows...
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(t => t.Sunday).Sum();
aggregates.Add(t => t.Monday).Sum();
aggregates.Add(t => t.Tuesday).Sum();
aggregates.Add(t => t.Wednesday).Sum();
aggregates.Add(t => t.Thursday).Sum();
aggregates.Add(t => t.Friday).Sum();
aggregates.Add(t => t.Saturday).Sum();
aggregates.Add(t => t.TotalHours).Sum();
}
)
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("timesheetGrid_error_handler"))
.Events(events => events.Change("timesheetGrid_change"))
.Events(events => events.RequestEnd("timesheetGrid_requestEnd"))
.Model(model => model.Id(t => t.rowId))
.Create(create => create.Action("Index_Create", "Home").Data("getCreateParams"))
.Destroy(destroy => destroy.Action("Index_Delete", "Home").Data("getUpdateParams"))
.Read(read => read.Action("Index_Read", "Home").Data("getReadParams"))
.Update(update => update.Action("Index_Update", "Home").Data("getUpdateParams"))
)