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