Esempio n. 1
0
        public static bool Insert_VehReceiptType(VehReceiptTypoVM model)
        {
            try
            {
                if (string.IsNullOrEmpty(model.VehRecCode))
                {
                    strAutoCode = sysfun.GetNewMaxID("VehicleReceiptType", "VehRecCode", 5, model.DealerCode);
                }
                else
                {
                    strAutoCode = model.VehRecCode;
                }


                SqlParameter[] param =
                {
                    new SqlParameter("@DealerCode", model.DealerCode),            //0
                    new SqlParameter("@VehRecCode", strAutoCode),                 //1
                    new SqlParameter("@VehRecDesc", model.VehRecDesc),            //2
                    new SqlParameter("@UpdUser", AuthBase.UserId),                //3
                    new SqlParameter("@UpdTerm", General.CurrentIP)               //4
                };
                dt = DataAccess.getDataTable("Sp_Insert_VehicleReceiptType", param, General.GetBMSConString());
                if (dt.Rows.Count > 0)
                {
                }
                IsSaved = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(IsSaved);
        }
Esempio n. 2
0
        public JsonResult Insert_VehicleReceiptType(VehReceiptTypoVM objects)
        {
            bool result = false;

            string msg = "Failed to save record..";

            result = MasterMethods.Insert_VehReceiptType(objects);

            if (result)
            {
                msg = "Successfully Added";
            }

            return(Json(new { Success = result, Message = msg }, JsonRequestBehavior.AllowGet));
        }