/// <summary> /// 修改工作日志信息 /// </summary> /// <param name="title">标题</param> /// <param name="content">内容</param> /// <param name="employeeID">员工ID</param> /// <param name="strTime">工作日志时间</param> /// <param name="workRecordID">工作日志ID</param> /// <returns>成功为空</returns> public string UpdateWorkCordForMobile(string title, string content, string employeeID, string strTime, string workRecordID) { string strReturn = string.Empty; try { Tracer.Debug("开始修改工作日志信息"); Tracer.Debug("title:" + title); Tracer.Debug("content: " + content); Tracer.Debug("employeeID:" + employeeID); Tracer.Debug("strTime: " + strTime); Tracer.Debug("workRecordID: " + workRecordID); strReturn = checkWorkCordInfo(title, content, employeeID, strTime); if (!string.IsNullOrEmpty(strReturn)) { return(strReturn); } CalendarManagementBll calenDarBll = new CalendarManagementBll(); V_EMPLOYEEVIEW employee = calenDarBll.getEmployee(employeeID); if (employee == null) { strReturn = "没获取到员工信息,保存失败"; return(strReturn); } T_OA_WORKRECORD workRecord = new T_OA_WORKRECORD(); var ents = from ent in dal.GetObjects <T_OA_WORKRECORD>() where ent.WORKRECORDID == workRecordID select ent; if (ents.Count() == 0) { strReturn = "修改的工作日志不存在"; return(strReturn); } workRecord = ents.FirstOrDefault(); workRecord.TITLE = title; workRecord.CONTENT = content; DateTime planTime = System.Convert.ToDateTime(strTime); workRecord.PLANTIME = planTime; strReturn = UpdateWorkCordOwnerInfo(ref workRecord, "Edit", employee); if (string.IsNullOrEmpty(strReturn)) { int intResult = UpdateWorkCordNew(workRecord); if (intResult < 1) { strReturn = "修改工作日志失败"; } } } catch (Exception ex) { Tracer.Debug("title:" + title); Tracer.Debug("content: " + content); Tracer.Debug("employeeID:" + employeeID); Tracer.Debug("strTime: " + strTime); Tracer.Debug("workRecordID: " + workRecordID); Tracer.Debug("日程管理WorkerCordManagementBll-UpdateWorkCordForMobile:" + ex.ToString()); strReturn = "修改工作日志时出现异常"; } return(strReturn); }
/// <summary> /// 添加工作日志 /// </summary> /// <param name="title">标题</param> /// <param name="content">内容</param> /// <param name="employeeID">员工ID</param> /// <param name="strTime">工作日志时间</param> /// <returns>成功返回为空</returns> public string AddWorkCordForMobile(string title, string content, string employeeID, string strTime, ref string workRecordID) { string strReturn = string.Empty; try { Tracer.Debug("开始添加工作日志信息"); Tracer.Debug("title:" + title); Tracer.Debug("content: " + content); Tracer.Debug("employeeID:" + employeeID); Tracer.Debug("strTime: " + strTime); Tracer.Debug("workRecordID: " + workRecordID); strReturn = checkWorkCordInfo(title, content, employeeID, strTime); if (!string.IsNullOrEmpty(strReturn)) { return(strReturn); } CalendarManagementBll calenDarBll = new CalendarManagementBll(); V_EMPLOYEEVIEW employee = calenDarBll.getEmployee(employeeID); if (employee == null) { strReturn = "没获取到员工信息,保存失败"; return(strReturn); } T_OA_WORKRECORD workRecord = new T_OA_WORKRECORD(); workRecord.WORKRECORDID = Guid.NewGuid().ToString(); workRecord.TITLE = title; workRecord.CONTENT = content; DateTime planTime = System.Convert.ToDateTime(strTime); workRecord.PLANTIME = planTime; strReturn = UpdateWorkCordOwnerInfo(ref workRecord, "Add", employee); if (string.IsNullOrEmpty(strReturn)) { bool blResult = AddWorkCord(workRecord); if (!blResult) { strReturn = "添加工作日志失败"; } workRecordID = workRecord.WORKRECORDID; } } catch (Exception ex) { Tracer.Debug("title:" + title); Tracer.Debug("content: " + content); Tracer.Debug("employeeID:" + employeeID); Tracer.Debug("strTime: " + strTime); Tracer.Debug("日程管理WorkerCordManagementBll-AddWorkCordForMobile:" + ex.ToString()); strReturn = "添加工作日志时出现异常"; } return(strReturn); }