Beispiel #1
0
        /// <summary>
        /// 修改主键值一致的记录,并返回受影响行数
        /// </summary>

        public static Int32 Modify(EtCarrierType etCarrierType)
        {
            Int32             result = 0;
            DynamicParameters p      = new DynamicParameters();

            p.Add("@CarrierValue", etCarrierType.CarrierValue);
            p.Add("@EDSID", etCarrierType.EDSID);
            p.Add("@Name", etCarrierType.Name);
            p.Add("@CarrierID", etCarrierType.CarrierID);
            p.Add("@Rows", 0, DbType.Int32, ParameterDirection.Output);
            using (var cnn = new SqlConnection(SQLDBHelper.ConnectionString))
            {
                cnn.Open();
                cnn.Execute("[dbo].[usp_UpdateCarrierType]", p, null, null, CommandType.StoredProcedure);
                result = p.Get <int>("@Rows");
                cnn.Close();
            }
            return(result);
        }
 /// <summary>
 /// 修改主键值一致的记录,并返回受影响行数
 /// </summary>
 /// <param name="entityPdt">数据库相对应的对象实例</param>
 public static int Modify(EtCarrierType etCarrierType)
 {
     return(DALCarrierType.Modify(etCarrierType));
 }
 /// <summary>
 /// 添加一个对象,返回新对象ID号
 /// </summary>
 /// <param name="entityPdt"></param>
 /// <returns></returns>
 public static Int32 Add(EtCarrierType etCarrierType)
 {
     return(DALCarrierType.Add(etCarrierType));
 }