public ActionResult DeleteConfirm(int id) { Responses responses = SellingDetailRepo.Delete(id); if (responses.Success) { return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, message = "Error msg" }, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(SellingDetailViewModel model) { if (ModelState.IsValid) { Responses responses = SellingDetailRepo.Update(model); if (responses.Success) { return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = "Error msg" }, JsonRequestBehavior.AllowGet)); } } return(Json(new { success = false, message = "Invalid" }, JsonRequestBehavior.AllowGet)); }
//DELETE GET public ActionResult Delete(int id) { return(View("_Delete", SellingDetailRepo.GetById(id))); }
public ActionResult List() { return(View("_List", SellingDetailRepo.Get())); }
//EDIT GET public ActionResult Edit(int id) { return(View("_Edit", SellingDetailRepo.GetById(id))); }
// DELETE api/<controller>/5 public Responses Delete(int id) { return(SellingDetailRepo.Delete(id)); }
// PUT api/<controller>/5 public Responses Put(int id, [FromBody] SellingDetailViewModel entity) { entity.Id = id; return(SellingDetailRepo.Update(entity)); }
// POST api/<controller> public Responses Post([FromBody] SellingDetailViewModel entity) { return(SellingDetailRepo.Update(entity)); }
// GET api/<controller>/5 public SellingDetailViewModel Get(int id) { return(SellingDetailRepo.GetById(id)); }
// GET api/<controller> public IEnumerable <SellingDetailViewModel> Get() { return(SellingDetailRepo.Get()); }