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 SaveExcel(string item) { //string b = Request["item"]; IEnumerable <T_CMS_Static_PeriodOfProbation> objItemList = JsonConvert.DeserializeObject <IEnumerable <T_CMS_Static_PeriodOfProbation> >(item); JsonObject obj = new JsonObject(); obj.StatusCode = 200; obj.Message = "The process is sucessed"; foreach (T_CMS_Static_PeriodOfProbation objitem in objItemList) { //default value //objitem.CreatedUser = CurrentUser.UserName; objitem.CreatedDate = SystemConfig.CurrentDate; T_CMS_Static_PeriodOfProbationManager.Add(objitem); } return(Content(JsonConvert.SerializeObject(obj), "application/json")); }