コード例 #1
0
        public static bool Insert_VehLocation(VehicleLocationVM model)
        {
            try
            {
                if (string.IsNullOrEmpty(model.VehLocCode))
                {
                    strAutoCode = sysfun.GetNewMaxID("VehicleLocation", "VehLocCode", 5, model.DealerCode);
                }
                else
                {
                    strAutoCode = model.VehLocCode;
                }


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

            return(IsSaved);
        }
コード例 #2
0
        public JsonResult Insert_VehLocation(VehicleLocationVM objects)
        {
            bool result = false;

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

            result = MasterMethods.Insert_VehLocation(objects);

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

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