public ActionResult ModifyStatus(string keyValue, string status, int?type = 1, int?work = 4) { try { var entity = new ProjectModuleEntity() { projectModuleStatus = status }; if (type == 2) { entity.actualWorkHours = work.Value; entity.actualStartTime = DateTime.Now; } entity.Modify(keyValue); moduleApp.SubmitForm(entity, keyValue); WirteOperationRecord("ProjectModule", "UPDATE", "更新", "Info:" + keyValue); } catch (Exception ex) { log.logType = "ERROR"; log.logLevel = "ERROR"; WirteOperationRecord("ProjectModule", "", "", ex.Message.ToString()); return(Error(ex.Message.ToString())); } return(Success("修改成功.")); }
public ActionResult GetFormJson(string keyValue) { var entity = new ProjectModuleEntity(); try { entity = moduleApp.FindList(c => c.projectModuleGuid == keyValue).FirstOrDefault(); entity.chargePerson = entity.chargePersonInfoGuid + "&" + entity.chargePerson; WirteOperationRecord("ProjectModule", "SELECT", "查询", "Info:获取项目模块资料(单个)"); } catch (Exception ex) { log.logType = "ERROR"; log.logLevel = "ERROR"; WirteOperationRecord("ProjectModule", "", "", "Info:" + ex.Message.ToString()); } return(Content(entity.ToJson())); }
public void SubmitForm(ProjectModuleEntity entity, string keyValue) { if (!string.IsNullOrEmpty(entity.chargePerson)) { var account = entity.chargePerson.Split('&'); entity.chargePersonInfoGuid = account[0]; entity.chargePerson = account[1]; } if (string.IsNullOrEmpty(keyValue)) { entity.Create(); entity.projectModuleStatus = "进行中"; projectModuleRepository.Insert(entity); } else { entity.Modify(keyValue); projectModuleRepository.Update(entity); } }
public ActionResult SubmitForm(ProjectModuleEntity entity, string keyValue) { try { moduleApp.SubmitForm(entity, keyValue); if (string.IsNullOrEmpty(keyValue)) { WirteOperationRecord("ProjectModule", "INSERT", "增加", "Info:" + entity.ToJson()); } else { WirteOperationRecord("ProjectModule", "UPDATE", "修改", "Info:" + entity.ToJson()); } } catch (Exception ex) { log.logType = "ERROR"; log.logLevel = "ERROR"; WirteOperationRecord("ProjectModule", "", "", "Info:" + ex.Message.ToString()); return(Error(ex.Message.ToString())); } return(Success("操作成功.")); }