public async Task <IActionResult> Edit(int id, [Bind("TodayDate,RequestType,RequestByName,EffectiveStart,EffectiveEnd,RequestId")] Requestinfo requestinfo) { if (id != requestinfo.RequestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(requestinfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RequestinfoExists(requestinfo.RequestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(requestinfo)); }
public async Task <IActionResult> Create([Bind("TodayDate,RequestType,RequestByName,EffectiveStart,EffectiveEnd,RequestId")] Requestinfo requestinfo) { if (ModelState.IsValid) { _context.Add(requestinfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(requestinfo)); }
public ActionResult AddRequest(string sk, DateTime sd, DateTime ed, string rn) { TRM t = new TRM(); Requestinfo r = new Requestinfo(); r.Skill = sk; r.Start_date = sd; r.End_date = ed; r.Status = "Request"; int id = int.Parse(Session["id"].ToString()); r.pm_id = id; r.Reqname = rn; t.Requestinfos.Add(r); t.SaveChanges(); return(RedirectToAction("Requestprocess", "Login")); }