Example #1
0
        public IActionResult OnPostUpdate()
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // update record
                    WorkflowMasterFunctions.AddOrEdit(WorkflowMaster, CrudOperation.Update);
                    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(WorkflowMaster.WorkflowId, ReturnUrl));
        }
        /// <summary>
        /// Handler, updates a record.
        /// </summary>
        public IActionResult OnGetUpdate(int id, string serializedData)
        {
            WorkflowMaster objWorkflowMaster = JsonConvert.DeserializeObject <WorkflowMaster>(serializedData);

            WorkflowMasterFunctions.AddOrEdit(objWorkflowMaster, CrudOperation.Update, true);
            return(new JsonResult(true));
        }