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)); } }
public void UpdateCashback(Main_Cashback model) { unitOfWork.CashbackRepository.Update(model); }
public void DeleteCashback(Main_Cashback model) { unitOfWork.CashbackRepository.Delete(model); }
public void InsertCashback(Main_Cashback model) { unitOfWork.CashbackRepository.Insert(model); }