Ejemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(RegPaymentInvoice model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into RegPaymentInvoice(");
            strSql.Append("regID,invoiceID,invoiceNum,remark");
            strSql.Append(") values (");
            strSql.Append("@regID,@invoiceID,@invoiceNum,@remark");
            strSql.Append(") ");

            SqlParameter[] parameters =
            {
                new SqlParameter("@regID",      SqlDbType.VarChar,  50),
                //new SqlParameter("@regID", SqlDbType.VarChar,50) ,
                new SqlParameter("@invoiceID",  SqlDbType.Int,       4),
                new SqlParameter("@invoiceNum", SqlDbType.VarChar,  50),
                new SqlParameter("@remark",     SqlDbType.NVarChar, 500)
            };

            parameters[0].Value = model.id;
            //parameters[1].Value = model.regID;
            parameters[1].Value = model.invoiceID;
            parameters[2].Value = model.invoiceNum;
            parameters[3].Value = model.remark;
            DBHelper.ExecuteCommand(strSql.ToString(), parameters);
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(RegPaymentInvoice model)
 {
     dal.Add(model);
 }