public async Task <ActionResult> DeleteConfirmed(int id) { M_MasterTable m_MasterTable = await db.M_MasterTable.FindAsync(id); db.M_MasterTable.Remove(m_MasterTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "MasterId,MasterValue,MasterTable")] M_MasterTable m_MasterTable) { if (ModelState.IsValid) { db.Entry(m_MasterTable).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(m_MasterTable)); }
public async Task <ActionResult> Create([Bind(Include = "MasterId,MasterValue,MasterTable")] M_MasterTable m_MasterTable) { if (ModelState.IsValid) { db.M_MasterTable.Add(m_MasterTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(m_MasterTable)); }
public async Task <ActionResult> Create([Bind(Include = "ID,MasterValue,TableName,Remarks,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate,Active")] M_MasterTable m_MasterTable) { if (ModelState.IsValid) { db.M_MasterTable.Add(m_MasterTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(m_MasterTable)); }
public async Task <ActionResult> Edit([Bind(Include = "MasterID,MasterValue,TableName,SequenceNo,CreatedBy,CreatedDate,Active")] M_MasterTable m_MasterTable) { if (ModelState.IsValid) { m_MasterTable.ModifiedBy = Session["CurrentUser"].ToString(); m_MasterTable.ModifiedDate = DateTime.Now; db.Entry(m_MasterTable).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(m_MasterTable)); }
// GET: MasterTable/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } M_MasterTable m_MasterTable = await db.M_MasterTable.FindAsync(id); if (m_MasterTable == null) { return(HttpNotFound()); } return(View(m_MasterTable)); }
public async Task <ActionResult> Create([Bind(Include = "MasterID,MasterValue,TableName,SequenceNo")] M_MasterTable m_MasterTable) { if (ModelState.IsValid) { m_MasterTable.CreatedBy = Session["CurrentUser"].ToString(); m_MasterTable.CreatedDate = DateTime.Now; m_MasterTable.ModifiedBy = Session["CurrentUser"].ToString(); m_MasterTable.ModifiedDate = DateTime.Now; m_MasterTable.Active = true; db.M_MasterTable.Add(m_MasterTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(m_MasterTable)); }