// GET: Bid public ActionResult Index(/*int page = 1, int pageSize = 4*/) { List <BidModels> list = new List <BidModels>(); //PagedList<BidModels> model = new PagedList<BidModels>(list, page, pageSize); if (ModelState.IsValid) { foreach (var item in bs.getAllBid()) { BidModels PVM = new BidModels(); PVM.BidId = item.BidId; PVM.StartDate = item.StartDate; PVM.EndDate = item.EndDate; PVM.Category = item.Category; PVM.City = item.City; PVM.Description = item.Description; PVM.Type = item.Type; list.Add(PVM); } return(View(list)); } return(View(list)); }
// GET: Bid/Edit/5 public ActionResult Edit(int id) { Bid p = bs.GetById(id); BidModels pm = new BidModels(); pm.Description = p.Description; pm.Category = p.Category; pm.Type = p.Type; pm.StartDate = p.StartDate; pm.EndDate = p.EndDate; pm.City = p.City; pm.SkillName = p.SkillName; return(View(pm)); }
// GET: Bid/Details/5 public ActionResult Details(int id) { Bid p = bs.GetById(id); BidModels pm = new BidModels { Description = p.Description, Type = p.Type, Category = p.Category, EndDate = p.EndDate, StartDate = p.StartDate, SkillName = p.SkillName, City = p.City }; return(View(pm)); }
public ActionResult Edit(int id, BidModels collection) { try { Bid p = bs.GetById(id); p.BidId = collection.BidId; p.StartDate = collection.StartDate; p.EndDate = collection.EndDate; p.Description = collection.Description; p.SkillName = collection.SkillName; bs.Update(p); return(RedirectToAction("Index")); } catch (Exception) { return(RedirectToAction("Edit", "Bid")); } }
public ActionResult Create(BidModels b) { if (ModelState.IsValid) { Bid p = new Bid { Type = b.Type, Description = b.Description, Category = b.Category, EndDate = b.EndDate, StartDate = b.StartDate, City = b.City, SkillName = b.SkillName, MemberId = 7, }; bs.createBid(p); bs.Commit(); } List <MemberModels> md = new List <MemberModels>(); foreach (var item in bs.getMemberBySkill(b.SkillName)) { MemberModels PVM = new MemberModels(); PVM.firstName = item.firstName; PVM.lastName = item.lastName; PVM.email = PVM.email; PVM.skills = PVM.skills; md.Add(PVM); } TempData["members"] = md; return(RedirectToAction("Index", "Member")); }