public ActionResult acceptProposalModule(string id) { int propID = Convert.ToInt16(id); tbProposal Proposal = db.tbProposals.Where(p => p.propID == propID).FirstOrDefault(); tbModule mod = db.tbModules.Where(p => p.modID == Proposal.modID).FirstOrDefault(); tbModuleWorkroom model = new tbModuleWorkroom(); model.tbAwardedModule = new tbAwardedModule(); model.tbAwardedModule.modID = Proposal.modID; model.tbAwardedModule.devID = Proposal.devID; model.tbAwardedModule.propID = Proposal.propID; int awModCount = Convert.ToInt32(Proposal.tbDeveloper.tbClient.awardedProjects); awModCount++; Proposal.tbDeveloper.tbClient.awardedProjects = Convert.ToString(awModCount); mod.status = "Working"; db.tbModuleWorkrooms.Add(model); db.SaveChanges(); int awID = model.modID; TempData["page"] = "messages"; return(RedirectToAction("MessagesMod", new { id = awID })); }
public ActionResult progressModWR(string id) { int modID = Convert.ToInt32(id); tbModule model = db.tbAwardedModules.Where(aw => aw.modID == modID).FirstOrDefault().tbModule; ViewBag.projID = id; TempData["page"] = "Submissions"; return(View(model)); }
public ActionResult viewBidsMod(string id, int?page) { int modID = Convert.ToInt16(id); int pageNo = page ?? 1; moduleViewModel model = new moduleViewModel(); tbModule Module = db.tbModules.Where(m => m.modID.Equals(modID)).FirstOrDefault(); model.tbMod = Module; model.tbProposals = Module.tbProposals.Reverse().ToPagedList <tbProposal>(pageNo, 8); TempData["page"] = "projects"; return(View(model)); }
public ActionResult editMod(int id, int wrID, projViewModel model) { tbModule module = db.tbModules.Find(id); module.description = model.tbModule.description; module.closeDate = model.tbModule.closeDate; module.devSkillLevel = model.tbModule.devSkillLevel; module.devType = model.tbModule.devType; module.category = model.tbModule.category; module.budget = model.tbModule.budget; module.skillReq = model.tbModule.skillReq; if (model.file != null) { foreach (HttpPostedFileBase file in model.files) { if (file == null) { continue; } else { if (HttpContext.Request.Files.AllKeys.Any()) { var httpPostedFile = HttpContext.Request.Files[0]; if (httpPostedFile != null) { var fileSavePath = Path.Combine(Server.MapPath("~/App_Data/ModuleFiles"), file.FileName); httpPostedFile.SaveAs(fileSavePath); module.filename = file.FileName; } } } } } db.SaveChanges(); return(RedirectToAction("Submission", "RequirementEngineer", new { id = wrID })); }
public ActionResult submitProposal(string id, int?page) { int pageNo = page ?? 1; int modId = Convert.ToInt16(id); var uName = Session["dev"].ToString(); var devID = db.tbClients.Where(u => u.tbUser.tbUserCredential.username.Equals(uName)).FirstOrDefault().tbDevelopers.FirstOrDefault().devID; proposalViewModel model = new proposalViewModel(); tbModule mod = db.tbModules.Find(modId); model.tbModule = mod; model.tbProposals = mod.tbProposals.ToPagedList(pageNo, 5); var prop = mod.tbProposals.Where(p => p.devID == devID).FirstOrDefault(); if (prop == null) { return(View(model)); } else { return(RedirectToAction("viewProposal", new { id = prop.modID })); } }