Пример #1
0
 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));
 }
 // 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));
 }