public ActionResult Create(T_COm_Master_Org model) { try { if (ModelState.IsValid) { // model.CreatedUser = CurrentUser.UserName; if (model.OrgId != 0) { //get default value // T_COm_Master_Org b = T_COm_Master_OrgManager.GetById(model.OrgId); T_COm_Master_OrgManager.Update(model); } else { // TODO: Add insert logic here // model.CreatedDate = SystemConfig.CurrentDate; T_COm_Master_OrgManager.Add(model); } return(View(ViewFolder + "list.cshtml", T_COm_Master_OrgManager.GetAll())); } } catch { return(View(model)); } return(View(model)); }
public ContentResult SaveExcel(string item) { //string b = Request["item"]; IEnumerable <T_COm_Master_Org> objItemList = JsonConvert.DeserializeObject <IEnumerable <T_COm_Master_Org> >(item); JsonObject obj = new JsonObject(); obj.StatusCode = 200; obj.Message = "The process is sucessed"; foreach (T_COm_Master_Org objitem in objItemList) { //default value //objitem.CreatedUser = CurrentUser.UserName; objitem.CreatedDate = SystemConfig.CurrentDate; T_COm_Master_OrgManager.Add(objitem); } return(Content(JsonConvert.SerializeObject(obj), "application/json")); }