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)));
 }
Esempio n. 6
0
 // DELETE api/<controller>/5
 public Responses Delete(int id)
 {
     return(SellingDetailRepo.Delete(id));
 }
Esempio n. 7
0
 // PUT api/<controller>/5
 public Responses Put(int id, [FromBody] SellingDetailViewModel entity)
 {
     entity.Id = id;
     return(SellingDetailRepo.Update(entity));
 }
Esempio n. 8
0
 // POST api/<controller>
 public Responses Post([FromBody] SellingDetailViewModel entity)
 {
     return(SellingDetailRepo.Update(entity));
 }
Esempio n. 9
0
 // GET api/<controller>/5
 public SellingDetailViewModel Get(int id)
 {
     return(SellingDetailRepo.GetById(id));
 }
Esempio n. 10
0
 // GET api/<controller>
 public IEnumerable <SellingDetailViewModel> Get()
 {
     return(SellingDetailRepo.Get());
 }