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