public ActionResult Edit(PartnershipVM obj) { try { // edit record obj.Partnership.Deleted = obj.isDelete; obj.Partnership.Published = obj.isPublish; repository.Edit(obj.Partnership); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(PartnershipVM obj) { try { // save data obj.Partnership.Deleted = obj.isDelete; obj.Partnership.Published = obj.isPublish; obj.Partnership.CreatedOn = DateTime.Now; if (Session["idxu"] != null && Session["idxu"].ToString().Length > 0) { obj.Partnership.CreatedByID = int.Parse(Session["idxu"].ToString()); } repository.Add(obj.Partnership); return(RedirectToAction("Index")); } catch { return(View()); } }
public PartnershipController() { repository = new PartnershipDAO(); vm = new PartnershipVM(); }