public SystemMessage SaveHR_WorkingDayConfig(HR_WorkingDayConfig HR_WorkingDayConfig) { SystemMessage systemMessage = new SystemMessage(); try { var param1 = new DynamicParameters(); param1.Add("@AutoID ", HR_WorkingDayConfig.AutoID); param1.Add("@DateFromNumber ", HR_WorkingDayConfig.DateFromNumber); param1.Add("@DateToNumber ", HR_WorkingDayConfig.DateToNumber); param1.Add("@WorkingDayMachineID ", HR_WorkingDayConfig.WorkingDayMachineID); param1.Add("@StartMonth ", HR_WorkingDayConfig.StartMonth); param1.Add("@EndMonth ", HR_WorkingDayConfig.EndMonth); param1.Add("@NoTimeChecking ", HR_WorkingDayConfig.NoTimeChecking.ToString()); UnitOfWork.ProcedureExecute("SaveHR_WorkingDayConfig", param1); systemMessage.IsSuccess = true; if (Global.CurrentLanguage == 5) { systemMessage.Message = "Cập nhật thành công"; } else { systemMessage.Message = "successful update"; } return(systemMessage); } catch (Exception e) { systemMessage.IsSuccess = false; systemMessage.Message = e.ToString(); return(systemMessage); } }
public ActionResult _SaveHR_WorkingDayConfig(HR_WorkingDayConfig HR_WorkingDayConfig) { var db = new HR_WorkingDayConfigDAL(); var result = db.SaveHR_WorkingDayConfig(HR_WorkingDayConfig); if (result.IsSuccess == true && HR_WorkingDayConfig.AutoID == 0) { result.Message = AppRes.MSG_INSERT_SUCCESSFUL; } else if (result.IsSuccess == true && HR_WorkingDayConfig.AutoID != 0) { result.Message = AppRes.MS_Update_success; } return(Content(JsonConvert.SerializeObject(new { result }))); }