/// <summary>
        /// Handler, updates a record.
        /// </summary>
        public IActionResult OnGetUpdate(int id, string serializedData)
        {
            WorkflowStepsMaster objWorkflowStepsMaster = JsonConvert.DeserializeObject <WorkflowStepsMaster>(serializedData);

            WorkflowStepsMasterFunctions.AddOrEdit(objWorkflowStepsMaster, CrudOperation.Update, true);
            return(new JsonResult(true));
        }
Example #2
0
        public IActionResult OnPostAdd()
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // add new record
                    WorkflowStepsMasterFunctions.AddOrEdit(WorkflowStepsMaster, CrudOperation.Add);
                    return(RedirectToPage(ReturnUrl));
                }
                catch (Exception ex)
                {
                    _Ilog.GetInstance().Error("Error Occured", ex);

                    if (ex.InnerException != null)
                    {
                        ModelState.AddModelError("", ex.InnerException.Message);
                    }
                    else
                    {
                        ModelState.AddModelError("", ex.Message);
                    }
                }
            }

            // if we got this far, something failed, redisplay form
            return(LoadPage(ReturnUrl));
        }