コード例 #1
0
 /// <summary>
 /// 更新一条配送方式
 /// </summary>
 /// <param name="configDeliveryMethod">
 /// 需更新的配送方式
 /// </param>
 public void Modify(Config_Delivery_Method configDeliveryMethod)
 {
     this.configDeliveryMethodDA.Update(configDeliveryMethod);
 }
コード例 #2
0
        /// <summary>
        /// 新增配送方式
        /// </summary>
        /// <param name="deliveryMethod">
        /// 要新增的配送方式
        /// </param>
        /// <returns>
        /// 新增的配送方式Id
        /// </returns>
        /// <exception cref="Exception">
        /// </exception>
        public int Insert(Config_Delivery_Method deliveryMethod)
        {
            var paraList = new List<SqlParameter>()
                               {
                                   this.SqlServer.CreateSqlParameter(
                                       "Name",
                                       SqlDbType.NVarChar,
                                       deliveryMethod.Name,
                                       ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                       "Description",
                                       SqlDbType.NVarChar,
                                       deliveryMethod.Description,
                                       ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                       "CreateTime",
                                       SqlDbType.DateTime,
                                       DateTime.Now,
                                       ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                       "ReferenceID",
                                       SqlDbType.Int,
                                       null,
                                       ParameterDirection.Output)
                               };

            try
            {
                this.SqlServer.ExecuteNonQuery(
                                   CommandType.StoredProcedure,
                                   "sp_Config_Delivery_Method_Insert",
                                   paraList,
                                   null);
                return (int)paraList.Find(parameter => parameter.ParameterName == "ReferenceID").Value;
            }
            catch (Exception exception)
            {
                throw new Exception("Exception - ConfigDeliveryMethodDA - Insert", exception);
            }
        }
コード例 #3
0
 /// <summary>
 /// 添加一条配送方式
 /// </summary>
 /// <param name="deliveryMethod">
 /// 需要添加的配送方式
 /// </param>
 /// <returns>
 /// 新增的配送ID
 /// </returns>
 public int Add(Config_Delivery_Method deliveryMethod)
 {
     return configDeliveryMethodDA.Insert(deliveryMethod);
 }
コード例 #4
0
        /// <summary>
        /// 更新配送方式
        /// </summary>
        /// <param name="deliveryMethod">
        /// 更新的配送方式
        /// </param>
        /// <exception cref="Exception">
        /// </exception>
        public void Update(Config_Delivery_Method deliveryMethod)
        {
            var paraList = new List<SqlParameter>()
                               {
                                   this.SqlServer.CreateSqlParameter(
                                       "Name",
                                       SqlDbType.NVarChar,
                                       deliveryMethod.Name,
                                       ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                       "Description",
                                       SqlDbType.NVarChar,
                                       deliveryMethod.Description,
                                       ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                       "CreateTime",
                                       SqlDbType.DateTime,
                                       DateTime.Now,
                                       ParameterDirection.Input),
                                       this.SqlServer.CreateSqlParameter(
                                       "ID",
                                       SqlDbType.Int,
                                       deliveryMethod.ID,
                                       ParameterDirection.Input)
                               };

            try
            {
                this.SqlServer.ExecuteNonQuery(
                                   CommandType.StoredProcedure,
                                   "sp_Config_Delivery_Method_Update",
                                   paraList,
                                   null);

            }
            catch (Exception exception)
            {
                throw new Exception("Exception - ConfigDeliveryMethodDA - Update", exception);
            }
        }