public bool ApplyChangeForCustom(SupvisorJob job, string Id, out string errorMsg) { using (var db = dbFactory.Open()) { using (var dbTrans = db.OpenTransaction()) { try { errorMsg = string.Empty; db.Insert <SupvisorJob>(job); //5 申请修改 db.UpdateOnly(() => new t_bp_Equipment_ST() { approvalstatus = "5" }, t => t.Id == int.Parse(Id)); dbTrans.Commit(); return(true); } catch (Exception ex) { dbTrans.Rollback(); errorMsg = ex.Message; return(false); } } } }
public ActionResult GetSuperJob(string Id) { SupvisorJob Result = new SupvisorJob(); var model = supvisorRep.GetByCondition(w => w.CustomId == Id && w.NeedApproveId == Id && w.ApproveType == ApproveType.STApproveEquip).OrderByDescending(o => o.CreateTime); return(View(model.FirstOrDefault())); }
public bool ApplyChangeForCustom(SupvisorJob job, string customId, out string errorMsg) { using (var db = dbFactory.Open()) { using (var dbTrans = db.OpenTransaction()) { try { errorMsg = string.Empty; db.Insert <SupvisorJob>(job); //5 申请修改 db.UpdateOnly(() => new t_bp_custom_ST() { APPROVALSTATUS = "5" }, t => t.Id == customId); dbTrans.Commit(); return(true); } catch (Exception ex) { dbTrans.Rollback(); errorMsg = ex.Message; return(false); } } } }
public ActionResult ApplyChange(STCheckEquipApplyChange applyChangeModel) { ControllerResult result = ControllerResult.SuccResult; try { SupvisorJob job = new SupvisorJob() { ApproveType = ApproveType.STApproveEquip, CreateBy = GetCurrentUserId(), CustomId = applyChangeModel.SubmitId, CreateTime = DateTime.Now, NeedApproveId = applyChangeModel.SubmitId.ToString(), NeedApproveStatus = NeedApproveStatus.CreateForChangeApply, SubmitName = applyChangeModel.SubmitName, SubmitText = applyChangeModel.SubmitText }; string erroMsg = string.Empty; if (!sTCheckEquipService.ApplyChangeForCustom(job, applyChangeModel.SubmitId, out erroMsg)) { result = ControllerResult.FailResult; result.ErroMsg = erroMsg; } else { LogUserAction("进行了申请修改操作,申请人为{0},申请原因为{1}".Fmt(applyChangeModel.SubmitName, applyChangeModel.SubmitText)); } } catch (Exception ex) { result = ControllerResult.FailResult; result.ErroMsg = ex.Message; } return(Content(result.ToJson())); }