예제 #1
0
 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());
     }
 }
예제 #2
0
 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());
     }
 }
예제 #3
0
 public PartnershipController()
 {
     repository = new PartnershipDAO();
     vm         = new PartnershipVM();
 }