// GET: Document/Create public ActionResult Create() { if (sig != null) { MdlDocument obj = new MdlDocument(); return(View(obj)); } else { return(RedirectToAction("Index", "Login")); } }
// GET: Document/Edit/5 public ActionResult Edit(int id) { if (sig != null) { MngDocument mobj = new MngDocument(); MdlDocument obj = new MdlDocument(); obj = mobj.EditDocument(id); return(View(obj)); } else { return(RedirectToAction("Index", "Login")); } }
public ActionResult Edit(MdlDocument obj) { if (sig != null) { try { // TODO: Add update logic here MngDocument mobj = new MngDocument(); mobj.UpdateDocument(obj); return(RedirectToAction("Index")); } catch { return(View()); } } else { return(RedirectToAction("Index", "Login")); } }
public ActionResult Create(MdlDocument obj) { if (sig != null) { try { // TODO: Add insert logic here MngDocument mobj = new MngDocument(); mobj.AddNewDocument(obj); return(RedirectToAction("Index")); } catch { return(View()); } } else { return(RedirectToAction("Index", "Login")); } }
public ActionResult Delete(MdlDocument obj) { if (sig != null) { try { // TODO: Add delete logic here MngDocument mobj = new MngDocument(); // int id = obj.DocumentID; mobj.DelteDocType(obj.DocumentID); return(RedirectToAction("Index")); } catch { return(View()); } } else { return(RedirectToAction("Index", "Login")); } }