public RollerProjectInfo DeleteRollerProjectInfo(int rollerprojectinfoID) { RollerProjectInfo dbEntry = context.RollerProjectInfos.Find(rollerprojectinfoID); if (dbEntry != null) { context.RollerProjectInfos.Remove(dbEntry); context.SaveChanges(); } return(dbEntry); }
public ViewResult EditProject(int RollerProjectInfoID) { SettingViewModel settingviewModel = new SettingViewModel(baserepository); ViewData["StandardList"] = settingviewModel.GetStandardList(); ViewData["LocationList"] = settingviewModel.GetLocationList(); ViewData["ConditionList"] = settingviewModel.GetConditionList(); ViewData["DeviceList"] = settingviewModel.GetDeviceList(); RollerProjectInfo rollerprojectinfo = projectrepository.RollerProjectInfos.FirstOrDefault(p => p.RollerProjectInfoID == RollerProjectInfoID); return(View(rollerprojectinfo)); }
public ActionResult EditProject(RollerProjectInfo rollerprojectinfo) { if (ModelState.IsValid) { projectrepository.SaveRollerProjectInfo(rollerprojectinfo); return(RedirectToAction("Index", "Sample")); } else { SettingViewModel settingviewModel = new SettingViewModel(baserepository); ViewData["StandardList"] = settingviewModel.GetStandardList(); ViewData["LocationList"] = settingviewModel.GetLocationList(); ViewData["ConditionList"] = settingviewModel.GetConditionList(); ViewData["DeviceList"] = settingviewModel.GetDeviceList(); return(View(rollerprojectinfo)); } }
public ActionResult Confirm(int RollerProjectInfoID) { WTTESTINFO wttestinfo = wttestinforepo.QueryEntities.FirstOrDefault(x => x.ID == RollerProjectInfoID); RollerProjectInfo project = new RollerProjectInfo() { Approve_Time = wttestinfo.APPROVE_TIME, CheckPersonID = wttestinfo.CHECKER_ID, Commission = wttestinfo.SERIAL_NO, CommissionID = wttestinfo.COMMISSION_ID, Company_Address = wttestinfo.COMPANY_ADDRESS, Platform = wttestinfo.PLATFORM, Product_CateGory = wttestinfo.PRODUCT_CATEGORY, Product_NO = wttestinfo.PRODUCT_NO, Product_Company = wttestinfo.PRODUCT_COMPANY, Product_GL_Code = wttestinfo.PRODUCT_GL_CODE, Product_Name = wttestinfo.PRODUCT_NAME, WTPersonDept = wttestinfo.DEPT_NAME, Product_Type_NO = wttestinfo.PRODUCT_TYPE_NO, Standard_Remark = wttestinfo.STANDARD_REMARK, Standard_Option = wttestinfo.STANDARD_OPTION, ReqStandard = wttestinfo.PRD_REQ_NAME, Re_Finish_Date = wttestinfo.RE_FINISH_DATE, TestID = wttestinfo.ID, TestName = wttestinfo.NAME, TestPersonID = wttestinfo.TESTER_ID, TestStandard = wttestinfo.STANDARD, Test_Purpose = wttestinfo.TEST_PURPOSE, WTPersonName = wttestinfo.CREATOR_NAME, Test_Requirement = wttestinfo.TEST_REQUIREMENTS, Type = wttestinfo.TYPE, }; if (ModelState.IsValid) { projectrepository.SaveRollerProjectInfo(project); Entities context = new Entities(); context.PROCEDURE_ROLLERPROJECTINFO(0); context.SaveChanges(); return(RedirectToAction("Index", "Sample")); } else { return(RedirectToAction("CreateProject")); } }
public void SaveRollerProjectInfo(RollerProjectInfo rollerprojectinfo) { if (rollerprojectinfo.RollerProjectInfoID == 0) { context.RollerProjectInfos.Add(rollerprojectinfo); } else { RollerProjectInfo dbEntry = context.RollerProjectInfos.Find(rollerprojectinfo.RollerProjectInfoID); if (dbEntry != null) { dbEntry.Approve_Time = rollerprojectinfo.Approve_Time; dbEntry.CheckPersonID = rollerprojectinfo.CheckPersonID; dbEntry.Commission = rollerprojectinfo.Commission; dbEntry.CommissionID = rollerprojectinfo.CommissionID; dbEntry.Company_Address = rollerprojectinfo.Company_Address; dbEntry.Platform = rollerprojectinfo.Platform; dbEntry.Product_CateGory = rollerprojectinfo.Product_CateGory; dbEntry.Product_Company = rollerprojectinfo.Product_Company; dbEntry.Product_GL_Code = rollerprojectinfo.Product_GL_Code; dbEntry.Product_Name = rollerprojectinfo.Product_Name; dbEntry.Product_NO = rollerprojectinfo.Product_NO; dbEntry.Product_Type_NO = rollerprojectinfo.Product_Type_NO; dbEntry.ReqStandard = rollerprojectinfo.ReqStandard; dbEntry.Re_Finish_Date = rollerprojectinfo.Re_Finish_Date; dbEntry.RollerProjectInfoID = rollerprojectinfo.RollerProjectInfoID; dbEntry.RollerSampleInfo = rollerprojectinfo.RollerSampleInfo; dbEntry.Standard_Option = rollerprojectinfo.Standard_Option; dbEntry.Standard_Remark = rollerprojectinfo.Standard_Remark; dbEntry.TestID = rollerprojectinfo.TestID; dbEntry.TestName = rollerprojectinfo.TestName; dbEntry.TestPersonID = rollerprojectinfo.TestPersonID; dbEntry.TestStandard = rollerprojectinfo.TestStandard; dbEntry.Test_Purpose = rollerprojectinfo.Test_Purpose; dbEntry.Test_Requirement = rollerprojectinfo.Test_Requirement; dbEntry.Type = rollerprojectinfo.Type; dbEntry.WTPersonDept = rollerprojectinfo.WTPersonDept; dbEntry.WTPersonName = rollerprojectinfo.WTPersonName; } } context.SaveChanges(); }
public void SaveRollerProjectInfo(RollerProjectInfo rollerprojectinfo) { if (rollerprojectinfo.RollerProjectInfoID == 0) { context.RollerProjectInfos.Add(rollerprojectinfo); } else { RollerProjectInfo dbEntry = context.RollerProjectInfos.Find(rollerprojectinfo.RollerProjectInfoID); if (dbEntry != null) { dbEntry.Commission = rollerprojectinfo.Commission; dbEntry.TestCondition = rollerprojectinfo.TestCondition; dbEntry.TestDevice = rollerprojectinfo.TestDevice; dbEntry.TestLocation = rollerprojectinfo.TestLocation; dbEntry.TestName = rollerprojectinfo.TestName; dbEntry.TestPerson = rollerprojectinfo.TestPerson; dbEntry.TestStandard = rollerprojectinfo.TestStandard; } } context.SaveChanges(); }