Пример #1
0
 public JsonResult Modify(Main_Cashback model)
 {
     try
     {
         if (model.Id == 0)
         {
             model.CreateDate = DateTime.Now;
             CashbackService.InsertCashback(model);
         }
         else
         {
             var update = CashbackService.GetCashback(model.Id);
             update.Linked_SiteId = model.Linked_SiteId;
             update.CategoriesId  = model.CategoriesId;
             update.PercentId     = model.PercentId;
             update.CreateDate    = DateTime.Now;
             update.Flag          = model.Flag;
             CashbackService.UpdateCashback(update);
         }
         CashbackService.Save();
         return(Json(new MessageResults {
             Status = "Success"
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new MessageResults {
             Status = "Error"
         }, JsonRequestBehavior.AllowGet));
     }
 }
Пример #2
0
 public void UpdateCashback(Main_Cashback model)
 {
     unitOfWork.CashbackRepository.Update(model);
 }
Пример #3
0
 public void DeleteCashback(Main_Cashback model)
 {
     unitOfWork.CashbackRepository.Delete(model);
 }
Пример #4
0
 public void InsertCashback(Main_Cashback model)
 {
     unitOfWork.CashbackRepository.Insert(model);
 }