public ActionResult DeleteConfirm(int id) { Responses responses = SellingHeaderRepo.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(SellingHeaderViewModel model) { if (ModelState.IsValid) { Responses responses = SellingHeaderRepo.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", SellingHeaderRepo.GetById(id))); }
public ActionResult List() { return(View("_List", SellingHeaderRepo.Get())); }
//EDIT GET public ActionResult Edit(int id) { return(View("_Edit", SellingHeaderRepo.GetById(id))); }
// DELETE api/<controller>/5 public Responses Delete(int id) { return(SellingHeaderRepo.Delete(id)); }
// PUT api/<controller>/5 public Responses Put(int id, [FromBody] SellingHeaderViewModel entity) { entity.Id = id; return(SellingHeaderRepo.Update(entity)); }
// POST api/<controller> public Responses Post([FromBody] SellingHeaderViewModel entity) { return(SellingHeaderRepo.Update(entity)); }
// GET api/<controller>/5 public SellingHeaderViewModel Get(int id) { return(SellingHeaderRepo.GetById(id)); }
// GET api/<controller> public IEnumerable <SellingHeaderViewModel> Get() { return(SellingHeaderRepo.Get()); }