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