public ActionResult AddTestBasicinfo(FormCollection collection, string projectNumber) { var parameter = this.IDKLManagerService.GetParameterListPhysical().Select(c => new { Name = c.ParameterName }).Distinct(); var users = this.AccountService.GetUserList(5).Select(c => new { Id = c.ID, Name = c.Name }); ViewData.Add("Person", new SelectList(users, "Name", "Name")); ViewData.Add("ParameterPhysical", new SelectList(parameter, "Name", "Name")); ViewData.Add("LexCategory", new SelectList(EnumHelper.GetItemValueList <EnumLexCategory>(), "Key", "Value")); var model = new TestBasicInfo(); model.TestContent = collection["ParameterPhysical"]; model.ProjectNumber = m_ProjectWholeInfoViewModel.projectBasicinfo.ProjectNumber; model.WordShop = collection["projectTestBasicinfo.WordShop"]; model.Job = collection["projectTestBasicinfo.Job"]; model.Location = collection["projectTestBasicinfo.Location"]; model.SampleNumber = collection["projectTestBasicinfo.SampleNumber"]; model.TouchTime = collection["projectTestBasicInfo.TouchTime"]; model.NoiseStrength = collection["projectTestBasicinfo.NoiseStrength"]; model.Lex8hLexw = collection["projectTestBasicinfo.Lex8hLexw"]; model.LexCategory = collection["LexCategory"].ToInt(); m_ProjectWholeInfoViewModel.projectTestBasicinfoList.Add(model); var list = this.IDKLManagerService.GetProectBasicInfoLists(projectNumber); this.IDKLManagerService.AddProjectTestBasicInfo(model); return(View("Edit", m_ProjectWholeInfoViewModel)); }
public ProjectWholeInfoViewModel() { projectTime = new ProjectInfo(); projectClosingDate = new ProjectInfo(); projectBasicImgFile = new ProjectFile(); device = new DeviceOrderInfo(); projectBasicinfo = new ProjectInfo(); projectConsultBasicinfo = new ConsultBasicInfo(); projectBasicFile = new ProjectFile(); projectTestBasicinfo = new TestBasicInfo(); projectTestChemicalReport = new TestChemicalReport(); projectTestChemicalReportList = new List <TestChemicalReport>(); projectValueBasicinfo = new ValueBasicInfo(); sampleTable = new SampleRegisterTable(); projectTestBasicinfoList = new List <TestBasicInfo>(); arguments = new ArgumentValue(); }
public ActionResult AddTestBasicinfo(FormCollection collection) { var model = new TestBasicInfo(); model.ProjectNumber = m_ProjectWholeInfoViewModel.projectBasicinfo.ProjectNumber; model.TestContent = collection["projectTestBasicinfo.TestContent"]; model.WordShop = collection["projectTestBasicinfo.WordShop"]; model.Job = collection["projectTestBasicinfo.Job"]; model.Location = collection["projectTestBasicinfo.Location"]; model.SampleNumber = collection["projectTestBasicinfo.SampleNumber"]; model.TouchTime = collection["projectTestBasicInfo.TouchTime"]; model.NoiseStrength = collection["projectTestBasicinfo.NoiseStrength"]; model.Lex8hLexw = collection["projectTestBasicinfo.Lex8hLexw"]; m_ProjectWholeInfoViewModel.projectTestBasicinfoList.Add(model); return(View("Edit", m_ProjectWholeInfoViewModel)); }
public ActionResult CreatePhysics(FormCollection collection) { try { this.IDKLManagerService.UpdateUserInputList((int)EnmuUserInputType.PhysicsParameterName, collection["PhysicsModel.TestContent"]); var model = new TestBasicInfo(); var projectNumber = this.IDKLManagerService.GetProjectInfoList().Select(c => new { projectNumber = c.ProjectNumber }).Distinct(); ViewData.Add("ProjectNumber", new SelectList(projectNumber, "projectNumber", "projectNumber")); //ViewData.Add("SaveCondition", new SelectList(EnumHelper.GetItemValueList<EnumSaveCondition>(), "Key", "Value")); //ViewData.Add("SampleState", new SelectList(EnumHelper.GetItemValueList<EnumSampleState>(), "Key", "Value")); //ViewData.Add("AnalyzePeople", new SelectList(EnumHelper.GetItemValueList<EnumAnalyzePeople>(), "Key", "Value")); string NumberBegin = collection["select1"]; string NumberEnd = collection["select1End"]; string SampleNormalNumber = ""; string SampleNumber; int Last = NumberBegin.LastIndexOf("00"); SampleNormalNumber = NumberBegin.Substring(0, Last + "00".Length); int BeginNumber = int.Parse(NumberBegin.Substring(Last, NumberBegin.Length - Last)); int EndNumber = int.Parse(NumberEnd.Substring(Last, NumberEnd.Length - Last)); int Poor = EndNumber - BeginNumber; var cookies = this.IDKLManagerService.GetCookies(); cookies.SampleLetter = collection["textbox2"]; cookies.SampleNumber = collection["select1End"]; cookies.SampleQuantity = collection["textbox1"]; this.IDKLManagerService.UpdateCookies(cookies); for (int i = BeginNumber; i <= EndNumber; i++) { SampleNumber = ""; model = new TestBasicInfo(); SampleNumber = SampleNormalNumber + i.ToString(); // model.TestContent = collection["SampleRegister.SampleName"]; // model.SampleNumber = collection["textbox1"]; model.SampleNumber = SampleNumber; model.SampleStatus = 0; //model.SaveCondition = collection["SaveCondition"]; //model.AnalyzePeople = collection["AnalyzePeople"]; //model.Remark = collection["SampleRegister.Remark"]; //int Condition = int.Parse(model.SaveCondition); //int state = int.Parse(model.SampleState); //model.SaveCondition = EnumHelper.GetEnumTitle((EnumSaveCondition)Condition); //model.SampleState = EnumHelper.GetEnumTitle((EnumSampleState)state); model.TestContent = collection["PhysicsModel.TestContent"]; model.ProjectNumber = collection["ProjectNumber1"]; model.WordShop = collection["PhysicsModel.WordShop"]; model.Job = collection["PhysicsModel.Job"]; model.Location = collection["PhysicsModel.Location"]; model.TouchTime = collection["PhysicsModel.TouchTime"]; model.NoiseStrength = collection["PhysicsModel.NoiseStrength"]; model.Lex8hLexw = collection["PhysicsModel.Lex8hLexw"]; if (model != null) { this.IDKLManagerService.AddProjectTestBasicInfo(model); } else { return(Back(GlobalData.warningInfo5)); } } } catch (Exception e) { return(Back(GlobalData.warningInfo4 + e.Message)); } return(RedirectToAction("IndexPhysics", "SampleRegisterTable", new { Area = "DKLManager" })); }
protected void MoveProjectData(string projectNumber) { var infomodel = new ProjectInfo(); infomodel = this.IDKLManagerService.GetProjectInfo(projectNumber); if (infomodel != null) { ProjectInfoHistory history = ProjectInfoHistory.Clone(infomodel); history.ProjectRealClosingDate = DateTime.Now; this.IDKLManagerService.AddProjectInfoHistory(history); } this.IDKLManagerService.DeleteProjectInfo(projectNumber); var valueInfo = new ValueBasicInfo(); valueInfo = this.IDKLManagerService.GetVlaueProjectBasicInfo(projectNumber); if (valueInfo != null) { ValueBasicInfoHistory history = ValueBasicInfoHistory.Clone(valueInfo); this.IDKLManagerService.AddVlaueProjectBasicInfoHistory(history); } this.IDKLManagerService.DeleteVlaueProjectBasicInfo(projectNumber); var testChemical = new SampleRegisterTable(); testChemical = this.IDKLManagerService.GetSampleRegisterTables(projectNumber); if (testChemical != null) { TestChemicalReportListHistory chemicalHistory = TestChemicalReportListHistory.Clone(testChemical); this.IDKLManagerService.AddTestChemicalReportListHistory(chemicalHistory); } this.IDKLManagerService.DeleteTestChemicalReport(projectNumber); var testInfo = new TestBasicInfo(); testInfo = this.IDKLManagerService.GetProjectTestBasicInfo(projectNumber); if (testInfo != null) { TestBasicInfoHistory history = TestBasicInfoHistory.Clone(testInfo); this.IDKLManagerService.AddProjectTestBasicInfoHistory(history); } this.IDKLManagerService.DeleteProjectTestBasicInfo(projectNumber); var consultInfo = new ConsultBasicInfo(); consultInfo = this.IDKLManagerService.GetConsultBasicInfo(projectNumber); if (consultInfo != null) { ConsultBasicInfoHistory history = ConsultBasicInfoHistory.Clone(consultInfo); this.IDKLManagerService.AddConsultBasicInfoHistory(history); } this.IDKLManagerService.DeleteConsultBasicInfo(projectNumber); var fileInfo = new ProjectFile(); fileInfo = this.IDKLManagerService.GetProjectFile(projectNumber); if (fileInfo != null) { ProjectFileHistory history = ProjectFileHistory.Clone(fileInfo); this.IDKLManagerService.AddProjectFileHistory(history); } this.IDKLManagerService.DeleteProjectFile(projectNumber); var docList = this.IDKLManagerService.GetProjectDocFileList(projectNumber); ProjectDocFileHistory docHistory = new ProjectDocFileHistory(); foreach (var doc in docList) { docHistory = ProjectDocFileHistory.Clone(doc); this.IDKLManagerService.AddProjectDocFileHistory(docHistory); } this.IDKLManagerService.DeleteProjectDocFile(projectNumber); }