public ActionResult Create(T_CMS_InterfaceLacviet_WorkingHours model) { try { if (ModelState.IsValid) { // model.CreatedUser = CurrentUser.UserName; if (model.WorkingId != 0) { //get default value // T_CMS_InterfaceLacviet_WorkingHours b = T_CMS_InterfaceLacviet_WorkingHoursManager.GetById(model.WorkingId); T_CMS_InterfaceLacviet_WorkingHoursManager.Update(model); } else { // TODO: Add insert logic here // model.CreatedDate = SystemConfig.CurrentDate; T_CMS_InterfaceLacviet_WorkingHoursManager.Add(model); } return(View(ViewFolder + "list.cshtml", T_CMS_InterfaceLacviet_WorkingHoursManager.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_InterfaceLacviet_WorkingHours obj = JsonConvert.DeserializeObject <T_CMS_InterfaceLacviet_WorkingHours>(objdata); obj = T_CMS_InterfaceLacviet_WorkingHoursManager.Update(obj); if (obj.WorkingId == 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_InterfaceLacviet_WorkingHours model) { try { if (ModelState.IsValid) { // TODO: Add insert logic here T_CMS_InterfaceLacviet_WorkingHoursManager.Update(model); //return RedirectToAction("Index"); } return(View(model)); } catch { return(View(model)); } }