public ActionResult EditExecuter(int id) { var executer = ExecuterManager.FindExecuter(id); if (executer != null) { var set = new EditExecuterBindingModel { FirstName = executer.FirstName, LastName = executer.LastName, MasterId = executer.MasterId, CollegeId = executer.CollegeId, EducationalGroupId = executer.EducationalGroupId, Email = executer.Email, Phone = executer.Phone, Explain = executer.Explain, }; ViewBag.ExecuterResearchgroup = ExecuterManager.FindExecuterResearchGroups(id); var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(executer.CollegeId); ViewBag.ResearchGroup = ResearchGroupManager.List(); return(View(set)); } return(RedirectToAction("Index")); }
protected void Page_Load(object sender, EventArgs e) { DepartmentManager departmentManager = new DepartmentManager(); department = departmentManager.SelectDepartment(); AreaManager areaManager = new AreaManager(); areas = areaManager.SelectArea(); ReSourceManager reSourceManager = new ReSourceManager(); reSources = reSourceManager.SelectMultySelect(); RequestManager requestManager = new RequestManager(); requests = requestManager.SelectRequests(); HeadNameResourceManager headNameResourceManager = new HeadNameResourceManager(); headNameResources = headNameResourceManager.SelectHeadNameResource(); CollegeManager collegeManager = new CollegeManager(); colleges = collegeManager.SelectColleges(); }
public ActionResult EditResearchGroup(EditResearchGroupBindingModel model) { //validation of model that collegeid and educationalgroup should be required if (!ModelState.IsValid) { ViewBag.ModelState = ModelState; } //if model is valid else { var result = ResearchGroupManager.Update(model); switch (result) { case ResearchGroupManager.researchgroupcreatestatus.failed: ViewBag.Failed = Fa.Error; break; case ResearchGroupManager.researchgroupcreatestatus.duplicate: ViewBag.Duplicate = Fa.DuplicateResearchGroup; break; default: return(RedirectToAction("Index")); } } var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(model.CollegeId.Value); return(View(model)); }
public ActionResult RegisterCollege(College College) { var cManager = new CollegeManager(); cManager.CreateCollege(College); return(View("Index")); }
public ActionResult RegisterExamination(Examination Examination) { var cManager = new CollegeManager(); var college = cManager.GetCollege(Examination.CollegeId); Examination.LocationId = college.LocationId; //Exam location would be same as College - Assumption var eManager = new ExaminationManager(); eManager.CreateExamination(Examination); return(View("Index")); }
public ActionResult CreateExecuter() { var colleges = CollegeManager.List(); ViewBag.College = colleges; if (colleges.Count > 0) { ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(colleges.FirstOrDefault().Id); } else { ViewBag.EducationalGroup = new List <EducationalGroupModel>(); } return(View()); }
public ActionResult EditResearchGroup(int id) { var researchgroup = ResearchGroupManager.Find(id); if (researchgroup != null) { var set = new EditResearchGroupBindingModel { Name = researchgroup.Name, CollegeId = researchgroup.CollegeId, EducationalGroupId = researchgroup.EducationalGroupId, }; var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(researchgroup.CollegeId); return(View(set)); } return(RedirectToAction("Index")); }
public ActionResult CreateProject(CreateProjectBindingModel model) { if (!ModelState.IsValid) { ViewBag.ModelState = ModelState; } else { var result = ProjectManager.Create(model); switch (result) { case ProjectManager.createprojectstatus.failed: ViewBag.Failed = Fa.Error; break; case ProjectManager.createprojectstatus.duplicate: ViewBag.Duplicate = Fa.DuplicateExecuter; break; default: return(RedirectToAction("Index")); } } ViewBag.Employers = EmployerManager.List(); var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.ResearchGroup = ResearchGroupManager.List(); if (colleges.Count > 0) { var educationalgroup = EducationalGroupManager.FindByCollegeId(colleges.FirstOrDefault().Id); ViewBag.EducationalGroup = educationalgroup; ViewBag.Executer = ExecuterManager.FindByCollegeId(colleges.FirstOrDefault().Id); } else { ViewBag.EducationalGroup = new List <EducationalGroupModel>(); ViewBag.Executer = new List <ExecuterModel>(); } ViewBag.ResearchGroup = ResearchGroupManager.List(); return(View(model)); }
public ActionResult CreateProject() { ViewBag.Employers = EmployerManager.List(); var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.ResearchGroup = ResearchGroupManager.List(); if (colleges.Count > 0) { var educationalgroup = EducationalGroupManager.FindByCollegeId(colleges.FirstOrDefault().Id); ViewBag.EducationalGroup = educationalgroup; ViewBag.Executer = ExecuterManager.FindByCollegeId(colleges.FirstOrDefault().Id); } else { ViewBag.EducationalGroup = new List <EducationalGroupModel>(); ViewBag.Executer = new List <ExecuterModel>(); } ViewBag.ResearchGroup = ResearchGroupManager.List(); return(View()); }
public ActionResult EditProject(int id) { var project = ProjectManager.Find(id); if (project != null) { var set = new EditProjectBindingModel { ProjectId = project.ProjectId, Title = project.Title, EmployerId = project.EmployerId, CollegeId = project.CollegeId, EducationalGroupId = project.EducationalGroupId, ExecuterId = project.ExecuterId, ResearchGroupId = project.ResearchGroupId, Price = project.Price, OverHeadPrice = project.OverHeadPrice, ReceivePrice = project.ReceivePrice, RemainPrice = project.RemainPrice, PaymentPrice = project.PaymentPrice, MainContractId = project.MainContractId, MainContractDateStr = Utility.DateToString(project.MainContractDate), InternalContractId = project.MainContractId, InternalContractDateStr = Utility.DateToString(project.InternalContractDate), ProjectEndDateStr = Utility.DateToString(project.ProjectEndDate), PhasesNum = project.PhasesNum, ProjectStatus = project.ProjectStatus, ProjectType = project.ProjectType, Explain = project.Explain, }; var colleges = CollegeManager.List(); ViewBag.College = colleges; ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(project.CollegeId); ViewBag.ResearchGroup = ResearchGroupManager.List(); ViewBag.Employers = EmployerManager.List(); ViewBag.Executer = ExecuterManager.FindByCollegeId(project.CollegeId); return(View(set)); } return(RedirectToAction("Index")); }
public ActionResult CreateResearchGroup(CreateResearchGroupBindingModel model) { //validation of model that collegeid and educationalgroup should be required if (!ModelState.IsValid) { ViewBag.ModelState = ModelState; } //if model is valid else { var result = ResearchGroupManager.Create(model); switch (result) { case ResearchGroupManager.researchgroupcreatestatus.failed: ViewBag.Failed = Fa.Error; break; case ResearchGroupManager.researchgroupcreatestatus.duplicate: ViewBag.Duplicate = Fa.DuplicateEducationalGroup; break; default: return(RedirectToAction("Index")); } } //if researchgroupcreatestatus was failed or duplicate or modelstate is invalid should assign viewbags var colleges = CollegeManager.List(); ViewBag.College = colleges; if (colleges.Count > 0) { ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(colleges.FirstOrDefault().Id); } else { ViewBag.EducationalGroup = new List <EducationalGroupModel>(); } return(View(model)); }
public ActionResult ProjectInfo(int id) { var project = ProjectManager.Find(id); if (project != null) { var set = new ProjectViewModel { Title = project.Title, ProjectId = project.ProjectId, Price = project.Price, OverHeadPrice = project.OverHeadPrice, ReceivePrice = project.ReceivePrice, RemainPrice = project.RemainPrice, PaymentPrice = project.PaymentPrice, MainContractId = project.MainContractId, MainContractDate = Utility.DateToString(project.MainContractDate), InternalContractId = project.MainContractId, InternalContractDate = Utility.DateToString(project.InternalContractDate), ProjectEndDate = Utility.DateToString(project.ProjectEndDate), PhasesNum = project.PhasesNum, ProjectStatus = project.ProjectStatus, ProjectType = project.ProjectType, Explain = project.Explain, Id = project.Id, }; set.Employer = EmployerManager.Find(project.EmployerId).Name; var executer = ExecuterManager.FindExecuter(project.ExecuterId); set.Executer = executer.FirstName + " " + executer.LastName; set.College = CollegeManager.Find(project.CollegeId).Name; set.EducationalGroup = EducationalGroupManager.Find(project.EducationalGroupId).Name; set.ResearchGroup = ResearchGroupManager.Find(project.ResearchGroupId).Name; ViewBag.ProjectInfo = set; return(View()); } return(RedirectToAction("Error")); }
public ActionResult CreateExecuter(CreateExecuterBindingModel model) { if (!ModelState.IsValid) { ViewBag.ModelState = ModelState; } else { var result = ExecuterManager.Create(model); switch (result) { case ExecuterManager.ExecuterStatus.failed: ViewBag.Failed = Fa.Error; break; case ExecuterManager.ExecuterStatus.duplicate: ViewBag.Duplicate = Fa.DuplicateExecuter; break; default: return(RedirectToAction("Index")); } } var colleges = CollegeManager.List(); ViewBag.College = colleges; if (colleges.Count > 0) { ViewBag.EducationalGroup = EducationalGroupManager.FindByCollegeId(colleges.FirstOrDefault().Id); } else { ViewBag.EducationalGroup = new List <EducationalGroupModel>(); } return(View(model)); }