public ActionResult ShowAllInOne(int appId, string type) { SummarizeDto SummarizeVM = new SummarizeDto(); if (String.Equals(type, "自修")) { Dispatch dispatchSheet = new Dispatch(); SelfRepairPlan selfRepairPlan = new SelfRepairPlan(); string dispatherName = string.Empty; string engineerName = string.Empty; RepairApplication application = repairDAL.AllInfo(appId, ref dispatchSheet, ref selfRepairPlan, ref dispatherName, ref engineerName); SummarizeVM.Instruction = dispatchSheet.Instruction; SummarizeVM.DispatchTime = dispatchSheet.CreatTime; SummarizeVM.Dispatcher = dispatherName; SummarizeVM.Engineer = engineerName; SummarizeVM.ApplicationDto = Mapper.Map <RepairApplication, ApplicationDto>(application); SummarizeVM.SelfRepairDto = Mapper.Map <SelfRepairPlan, SelfRepairPlanDto>(selfRepairPlan); } return(View(SummarizeVM)); }
public ActionResult Summarize() { SummarizeDto summarizeDto = new SummarizeDto(); summarizeDto.ApplicationDto = new ApplicationDto(); summarizeDto.SelfRepairDto = new SelfRepairPlanDto(); summarizeDto.ApplicationDto.Id = Convert.ToInt32(Request.Params["appID"]); string beginTime = Request.Params["beginTime"]; if (!string.IsNullOrEmpty(beginTime)) { summarizeDto.SelfRepairDto.StartTime = Convert.ToDateTime(beginTime); } summarizeDto.SelfRepairDto.ID = Convert.ToInt32(Request.Params["selfRepairPlanId"]); summarizeDto.SelfRepairDto.TimeCost = Convert.ToDouble(Request.Params["timeCost"]); summarizeDto.SelfRepairDto.Step = Request.Params["steps"]; summarizeDto.SelfRepairDto.Tool = Request.Params["tools"]; var partsInfo = Request.Params["partsInfo"]; summarizeDto.SelfRepairDto.IsUseSpareParts = partsInfo == string.Empty ? "否" : "是"; summarizeDto.SelfRepairDto.SparePartsInfo = partsInfo; summarizeDto.ApplicationDto.FailureDescription = Request.Params["description"]; summarizeDto.ApplicationDto.FailureAppearance = Request.Params["appearance"]; summarizeDto.ApplicationDto.FirstLocation = Request.Params["fstLocation"]; summarizeDto.ApplicationDto.SecondLocation = Request.Params["secLocation"]; summarizeDto.ApplicationDto.ThirdLocation = Request.Params["thiLocation"]; var application = Mapper.Map <ApplicationDto, RepairApplication>(summarizeDto.ApplicationDto); var selfRepairPlan = Mapper.Map <SelfRepairPlanDto, SelfRepairPlan>(summarizeDto.SelfRepairDto); bool result = repairDAL.Finish(application, selfRepairPlan); if (result) { return(Content(new { msg = "处理成功", status = "success" }.ToJsonString())); } else { return(Content(new { msg = "处理失败", status = "failed" }.ToJsonString())); } }