Beispiel #1
0
        public static OperationResult AddPickUpTransportPoint(AddPickUpTransportPointModel model, int currentUserID)
        {
            string _EFInfo = ChangeCoordinateSystem(model.EFType, model.EFInfo, 1); //地图坐标转车机坐标,存入数据库

            #region 参数
            List <SqlParameter> paras = new List <SqlParameter>()
            {
                new SqlParameter("@SettingType", SqlDbType.TinyInt),
                new SqlParameter("@AddressName", SqlDbType.NVarChar),
                new SqlParameter("@AddressCode", SqlDbType.NVarChar),
                new SqlParameter("@EFType", SqlDbType.TinyInt),

                new SqlParameter("@EFInfo", SqlDbType.NVarChar),
                new SqlParameter("@CreateUser", SqlDbType.Int),
                new SqlParameter("@CreateTime", SqlDbType.DateTime),
            };

            paras[0].Value = 1;  //1-提货点
            paras[1].Value = model.AddressName.Trim();
            paras[2].Value = model.AddressCode.Trim();
            paras[3].Value = model.EFType;

            paras[4].Value = _EFInfo;
            paras[5].Value = currentUserID;
            paras[6].Value = DateTime.Now;
            #endregion

            #region
            string sql    = @"INSERT  INTO dbo.MGJH_TransportPointSetting
                ( [SettingType]
      ,[AddressName]
      ,[AddressCode]
      ,[EFType]
      ,[EFInfo]
      ,[CreateUser]
      ,[CreateTime]
                )
        VALUES  ( @SettingType , 
                    @AddressName, 
                    @AddressCode,
                    @EFType , 
                    @EFInfo, 
                    @CreateUser,
                    @CreateTime
                )";
            bool   result = MSSQLHelper.ExecuteNonQuery(CommandType.Text, sql, paras.ToArray()) > 0;

            #endregion

            return(new OperationResult()
            {
                Success = result,
                Message = result ? PromptInformation.OperationSuccess : PromptInformation.DBError
            });
        }
 public ActionResult AddPickUpTransportPoint(AddPickUpTransportPointModel model)
 {
     if (ModelState.IsValid)
     {
         var result = MGJH_TransportPointBLL.AddPickUpTransportPoint(model, base.CurrentUserID);
         base.DoLog(OperationTypeEnum.Add, result, "PickUpAddressName:" + model.AddressName);
         return(Json(result));
     }
     else
     {
         return(PartialView("_AddPickUpTransportPoint", model));
     }
 }
        public ActionResult AddPickUpTransportPoint()
        {
            AddPickUpTransportPointModel model = new AddPickUpTransportPointModel();

            return(PartialView("_AddPickUpTransportPoint", model));
        }