public JsonResult Insert_DeliveryCheckList(DeliveryCheckListVM objects) { bool result = false; string msg = "Failed to save record.."; result = MasterMethods.Insert_DeliveryCheckList(objects); if (result) { msg = "Successfully Added"; } return(Json(new { Success = result, Message = msg }, JsonRequestBehavior.AllowGet)); }
public static bool Insert_DeliveryCheckList(DeliveryCheckListVM model) { try { if (string.IsNullOrEmpty(model.DelChkListCode)) { strAutoCode = sysfun.GetNewMaxID("DelChkList", "DelChkListCode", 3, model.DealerCode); } else { strAutoCode = model.DelChkListCode; } SqlParameter[] param = { new SqlParameter("@DealerCode", model.DealerCode), //0 new SqlParameter("@DelChkListCode", strAutoCode), //1 new SqlParameter("@DelChkListDesc", model.DelChkListDesc.ToUpper()), //2 new SqlParameter("@Type", model.Type), //3 new SqlParameter("@IsActive", model.IsActive), //4 new SqlParameter("@OptFlag", model.OptFlag), //5 new SqlParameter("@UpdUser", AuthBase.UserId), //6 new SqlParameter("@UpdTerm", General.CurrentIP) //7 }; dt = DataAccess.getDataTable("Sp_Insert_DelChkList", param, General.GetBMSConString()); if (dt.Rows.Count > 0) { } IsSaved = true; } catch (Exception) { throw; } return(IsSaved); }