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