Error executing template "/Designs/PLC/nolayout/Paragraph/OrderReminder_UpcomingOrder_PageControlls.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_626d3ed3e6644147b6b11ced93cd39b9.Execute() in E:\www\LIVE_(9.14.9)\Solutions\Files (9.14.9)\Templates\Designs\PLC\nolayout\Paragraph\OrderReminder_UpcomingOrder_PageControlls.cshtml:line 6
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @using Newtonsoft.Json.Linq
2 @using DWAPAC.PLC.OrderReminder
3 @using DWAPAC.PLC.OrderReminder.DTO
4
5 @{
6 string jsonParam = System.Web.HttpContext.Current.Request["JsonParam"].ToString();
7 OrderReminderService orderReminderService = new OrderReminderService();
8 ResponseStatus responseStatus = new ResponseStatus();
9 string jsonResult = "";
10
11 var jsonParamObj = JObject.Parse(jsonParam);
12 switch(jsonParamObj["Method"].ToString())
13 {
14 case "CreateOrderReminderCalcellation":
15 responseStatus = orderReminderService.CreateOrderReminderCalcellation(Convert.ToInt32(jsonParamObj["ReminderScheduleID"].ToString()), Convert.ToInt32(jsonParamObj["CustomerID"].ToString()), jsonParamObj["OriginalOrderID"].ToString(), Convert.ToDateTime(jsonParamObj["UpcomingOrderDate"].ToString()), Convert.ToInt32(jsonParamObj["UpcomingOrderFrequencyNumber"].ToString()));
16 break;
17 case "UpdateOrderReminderCalcellation":
18 responseStatus = orderReminderService.UpdateOrderReminderCalcellation(Convert.ToInt32(jsonParamObj["ReminderOrderCancellationID"].ToString()), Convert.ToInt32(jsonParamObj["ReminderScheduleID"].ToString()), Convert.ToInt32(jsonParamObj["CustomerID"].ToString()), jsonParamObj["OriginalOrderID"].ToString(), Convert.ToDateTime(jsonParamObj["UpcomingOrderDate"].ToString()), Convert.ToInt32(jsonParamObj["UpcomingOrderFrequencyNumber"].ToString()), jsonParamObj["Action"].ToString());
19 break;
20 case "DeletdOrderReminder":
21 responseStatus = orderReminderService.DeletdOrderReminder(Convert.ToInt32(jsonParamObj["CustomerID"].ToString()), Convert.ToInt32(jsonParamObj["OrderReminderId"].ToString()));
22 break;
23 case "UpdateOrderReminder":
24 responseStatus = orderReminderService.UpdateOrderReminder(Convert.ToInt32(jsonParamObj["OrderReminderId"].ToString()), Convert.ToInt32(jsonParamObj["CustomerID"].ToString()), jsonParamObj["OriginalOrderID"].ToString(), Convert.ToInt32(jsonParamObj["DurationNumber"].ToString()), jsonParamObj["Duration"].ToString(), Convert.ToInt32(jsonParamObj["Frequency"].ToString()), Convert.ToDateTime(jsonParamObj["StartDate"].ToString()));
25 break;
26 default:
27 responseStatus.Code = "400";
28 responseStatus.Message = "Bad Request";
29 break;
30 }
31 jsonResult = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(responseStatus);
32 }
33 @jsonResult