Exemple #1
0
        /// <summary>
        /// 新增采购单行
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public int Add(BuyBillItem item)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into BuyOrderItem(");
            strSql.Append("BuyOrderItemID,BuyOrderID,MaterialID,BuyQty,BuyCost,BuyUnitID,Remark)");
            strSql.Append(" values (");
            strSql.Append("@BuyOrderItemID,@BuyOrderID,@MaterialID,@BuyQty,@BuyCost,@BuyUnitID,@Remark)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@BuyOrderItemID", SqlDbType.VarChar, 36),
                new SqlParameter("@BuyOrderID",     SqlDbType.VarChar, 36),
                new SqlParameter("@MaterialID",     SqlDbType.VarChar, 36),
                new SqlParameter("@BuyQty",         SqlDbType.Decimal, 13),
                new SqlParameter("@BuyCost",        SqlDbType.Decimal, 13),
                new SqlParameter("@BuyUnitID",      SqlDbType.VarChar, 36),
                new SqlParameter("@Remark",         SqlDbType.VarChar, 1024)
            };
            parameters[0].Value = item.BuyOrderItemID;
            parameters[1].Value = item.BuyOrderID;
            parameters[2].Value = item.MaterialID;
            parameters[3].Value = item.BuyQty;
            parameters[4].Value = item.BuyCost;
            parameters[5].Value = item.BuyUnitID;
            parameters[6].Value = item.Remark;

            return(DBAccess.ExecuteNonQuery(DB.Type, DB.ConnectionString, CommandType.Text, strSql.ToString(), parameters));
        }
Exemple #2
0
 /// <summary>
 /// 新增采购单行
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public int Add(BuyBillItem item)
 {
     return(iBuyBillItemDAL.Add(item));
 }