// GET: /Inventory/UoM/CreateUoM public JsonResult CreateUoM(InvUoM aObj) { var data = _aManager.CreateUoM(aObj); // var data = _aManager.CreatAssetCategory(aObj); return(Json(new { success = data.Status, data }, JsonRequestBehavior.AllowGet)); // return null; }
public ResponseModel CreateUoM(InvUoM aObj) { try { if (aObj.UoMId == 0) { aObj.CreatedDate = DateTime.Now; _aRepository.Insert(aObj); _aRepository.Save(); return(_aModel.Respons(true, "New UoM Successfully Saved")); } else { _aRepository.Update(aObj); _aRepository.Save(); return(_aModel.Respons(true, "UoM Successfully Updated")); } } catch (Exception) { return(_aModel.Respons(false, "Sorry! Some Error Happned.")); } }