public ActionResult Create(T_CMS_Static_PeriodOfProbation model) { try { if (ModelState.IsValid) { // model.CreatedUser = CurrentUser.UserName; if (model.ID != 0) { //get default value // T_CMS_Static_PeriodOfProbation b = T_CMS_Static_PeriodOfProbationManager.GetById(model.ID); T_CMS_Static_PeriodOfProbationManager.Update(model); } else { // TODO: Add insert logic here // model.CreatedDate = SystemConfig.CurrentDate; T_CMS_Static_PeriodOfProbationManager.Add(model); } return(View(ViewFolder + "list.cshtml", T_CMS_Static_PeriodOfProbationManager.GetAll())); } } catch { return(View(model)); } return(View(model)); }
public ContentResult Save(string objdata, string value) { JsonObject js = new JsonObject(); js.StatusCode = 200; js.Message = "Upload Success"; try { T_CMS_Static_PeriodOfProbation obj = JsonConvert.DeserializeObject <T_CMS_Static_PeriodOfProbation>(objdata); obj = T_CMS_Static_PeriodOfProbationManager.Update(obj); if (obj.ID == 0) { js.StatusCode = 400; js.Message = "Has Errors. Please contact Admin for more information"; } else { js.Data = obj; } } catch (Exception objEx) { js.StatusCode = 400; js.Message = objEx.Message; } return(Content(JsonConvert.SerializeObject(js), "application/json")); }
public ActionResult Update(T_CMS_Static_PeriodOfProbation model) { try { if (ModelState.IsValid) { // TODO: Add insert logic here T_CMS_Static_PeriodOfProbationManager.Update(model); //return RedirectToAction("Index"); } return(View(model)); } catch { return(View(model)); } }