// POST: api/M_Companies
        public Responses Post([FromBody] M_CompanyViewModel entity)
        {
            Responses result = new Responses();

            if (ModelState.IsValid)
            {
                result = M_CompanyRepo.Update(entity);
            }
            else
            {
                result.Success = false;
            }
            return(result);
        }
示例#2
0
 public ActionResult Edit(M_CompanyViewModel model)
 {
     if (ModelState.IsValid)
     {
         Responses responses = (M_CompanyRepo.Update(model));
         if (responses.Success)
         {
             return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { success = false, message = responses.Message }, JsonRequestBehavior.AllowGet));
         }
     }
     return(Json(new { success = false, message = "Invalid" }, JsonRequestBehavior.AllowGet));
 }