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 ViewResult CreateProject() { SettingViewModel settingviewModel = new SettingViewModel(baserepository); ViewData["StandardList"] = settingviewModel.GetStandardList(); ViewData["LocationList"] = settingviewModel.GetLocationList(); ViewData["ConditionList"] = settingviewModel.GetConditionList(); ViewData["DeviceList"] = settingviewModel.GetDeviceList(); var userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext())); ApplicationUser user = userManager.FindByNameAsync(User.Identity.Name).Result; return(View("EditProject", new RollerProjectInfo() { TestPerson = user.UserName })); }
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)); } }