public IActionResult GetUpdateInfo(int id) { TASM_PROJECTManager manager = new TASM_PROJECTManager(); TASM_PROJECT model = manager.CurrentDb.GetById(id); return(SuccessResult(model)); }
public IActionResult Delete(int pid) { TASM_PROJECTManager dbContext = new TASM_PROJECTManager(); if (!dbContext.CurrentDb.Delete(S => S.PID == pid)) { return(FailMessage()); } return(SuccessMessage()); }
public IActionResult GetReportCount() { TASM_PROJECTManager project = new TASM_PROJECTManager(); int pcount = project.SelectProjectCount(); TASM_MACHINEManager machine = new TASM_MACHINEManager(); int mcount = machine.SelectMachineCount(); TASM_SUPPORT_Da support = new TASM_SUPPORT_Da(); int scount = support.SelectSupportCount(); var details = support.SelectCount(); int cpnumber = (int)((Convert.ToDecimal(details.Complete) / Convert.ToDecimal(scount)) * 100); //工单完成率,百分比 return(Json(new { ProjectCount = pcount, MachineCount = mcount, SupportCount = scount, SupportWaite = details.Wait, SupportBeing = details.Being, SupportComplete = details.Complete, Cpnumber = cpnumber })); }
/// <summary> /// 创建工单主表 /// </summary> /// <param name="model"></param> /// <param name="da"></param> /// <param name="sid"></param> /// <param name="supportModel"></param> /// <returns></returns> private bool InsertSupport(SupportCreateModel model, TASM_SUPPORT_Da da, ref int sid, ref TASM_SUPPORT supportModel) { TASM_PROJECTManager projectda = new TASM_PROJECTManager(); TASM_PROJECT projectmodel = projectda.CurrentDb.GetById(model.ProjectId); string code = projectmodel.CODE + "-" + da.SelectSupprotCodeIndex(); supportModel = new TASM_SUPPORT() { CREATOR = model.CreatorId, CONDUCTOR = model.ConductorId, CONTENT = model.Content, CREATETIME = DateTime.Now, FINDATE = model.FindDate, MEMBERID = 0, PROJECT = model.ProjectId, SEVERITY = model.Severity, STATUS = 0, TITLE = model.Title, TYPE = model.Type, STATE = 0, MID = model.Mid, CODE = code }; sid = da.CurrentDb.InsertReturnIdentity(supportModel); if (sid <= 0) { Msg = "添加操作历史失败!"; return(false); } return(true); }