/// <summary>
 /// 修改运费配置 对象
 /// </summary>
 /// <param name="deliveryCost">
 /// 要修改的运费配置 对象
 /// </param>
 public void Modify(Config_Delivery_Cost deliveryCost)
 {
     this.configDeliveryCostDA.Update(deliveryCost);
 }
        /// <summary>
        /// 新增一条运费
        /// </summary>
        /// <param name="deliveryCost">
        /// 运费对象
        /// </param>
        /// <returns>
        /// 新增对象的ID
        /// </returns>
        /// <exception cref="Exception">
        /// </exception>
        public int Insert(Config_Delivery_Cost deliveryCost)
        {
            var parameters = new List<SqlParameter>()
                                 {
                                     this.SqlServer.CreateSqlParameter(
                                         "DeliveryCorporationID",
                                         SqlDbType.Int,
                                         deliveryCost.DeliveryCorporationID,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CityID",
                                         SqlDbType.Int,
                                         deliveryCost.CityID,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Duration",
                                         SqlDbType.Int,
                                         deliveryCost.Duration,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Cost",
                                         SqlDbType.Float,
                                         deliveryCost.Cost,
                                         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_Cost_Insert",
                    parameters,
                    null);
                return (int)parameters.Find(parameter => parameter.ParameterName == "ReferenceID").Value;
            }
            catch (Exception exception)
            {
                throw new Exception("Exception - ConfigDeliveryCostDA - Insert", exception);
            }
        }
 /// <summary>
 /// 新增一条运费配置
 /// </summary>
 /// <param name="deliveryCost">运费配置对象</param>
 /// <returns>新增运费配置ID</returns>
 public int Add(Config_Delivery_Cost deliveryCost)
 {
     return this.configDeliveryCostDA.Insert(deliveryCost);
 }
        /// <summary>
        /// 更新一条运费对象
        /// </summary>
        /// <param name="deliveryCost">
        /// 运费对象
        /// </param>
        /// <exception cref="Exception">
        /// </exception>
        public void Update(Config_Delivery_Cost deliveryCost)
        {
            var paraList = new List<SqlParameter>()
                               {
                                   this.SqlServer.CreateSqlParameter(
                                         "ID",
                                         SqlDbType.Int,
                                         deliveryCost.ID,
                                         ParameterDirection.Input),
                                   this.SqlServer.CreateSqlParameter(
                                         "DeliveryCorporationID",
                                         SqlDbType.Int,
                                         deliveryCost.DeliveryCorporationID,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CityID",
                                         SqlDbType.Int,
                                         deliveryCost.CityID,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Duration",
                                         SqlDbType.Int,
                                         deliveryCost.Duration,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "Cost",
                                         SqlDbType.Float,
                                         deliveryCost.Cost,
                                         ParameterDirection.Input),
                                     this.SqlServer.CreateSqlParameter(
                                         "CreateTime",
                                         SqlDbType.DateTime,
                                         DateTime.Now,
                                         ParameterDirection.Input)
                               };

            try
            {
                this.SqlServer.ExecuteNonQuery(
                    CommandType.StoredProcedure,
                    "sp_Config_Delivery_Cost_Update",
                    paraList,
                    null);
            }
            catch (Exception exception)
            {
                throw new Exception("Exception - ConfigDeliveryCostDA - Update", exception);
            }
        }