예제 #1
0
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="pware"></param>
 /// <param name="SQLCommand"></param>
 /// <returns></returns>
 public bool insertPWarehouseTable_PickingOutBll(PWarehouseTable_PickingOut pware, string SQLCommand)
 {
     if (pwareDal.insertPWarehouseTable_PickingOutDal(pware, SQLCommand) > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
        PWarehouseTable_PickingOut GetPWarehouseTable_PickingOut()
        {
            PWarehouseTable_PickingOut pw = new PWarehouseTable_PickingOut();

            pw.PurchaseReceiptID      = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            pw.PurchaseNo             = TxtBox_PurchaseNo.Text.Trim();
            pw.SupplierName           = TxtBox_SupplierName.Text.Trim();
            pw.BatchNo                = TxtBox_BatchNo.Text.Trim();
            pw.MaterialCode           = TxtBox_MaterialCode.Text.Trim();
            pw.MaterialName           = TxtBox_MaterialName.Text.Trim();
            pw.MaterialSpecifications = TxtBox_MaterialSpecifications.Text.Trim();
            pw.ProductQuantity        = ip_ProductQuantity.Value;
            pw.note           = TxtBox_note.Text.Trim();
            pw.StorageAddress = "";
            pw.UserName       = UsersHelp.Userslist[0].UserName;

            return(pw);
        }
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="pware"></param>
        /// <param name="SQLCommand"></param>
        /// <returns></returns>
        public int insertPWarehouseTable_PickingOutDal(PWarehouseTable_PickingOut pware, string SQLCommand)
        {
            string sql = SQLhelp.GetSQLCommand(SQLCommand);

            SqlParameter[] pms = new SqlParameter[]
            {
                new SqlParameter("@PurchaseReceiptID", SqlDbType.VarChar, 100)
                {
                    Value = pware.PurchaseReceiptID
                },
                new SqlParameter("@PurchaseNo", SqlDbType.VarChar, 80)
                {
                    Value = pware.PurchaseNo
                },
                new SqlParameter("@SupplierName", SqlDbType.VarChar, 80)
                {
                    Value = pware.SupplierName
                },
                new SqlParameter("@BatchNo", SqlDbType.VarChar, 80)
                {
                    Value = pware.BatchNo
                },
                new SqlParameter("@MaterialCode", SqlDbType.VarChar, 80)
                {
                    Value = pware.MaterialCode
                },
                new SqlParameter("@MaterialName", SqlDbType.VarChar, 80)
                {
                    Value = pware.MaterialName
                },
                new SqlParameter("@MaterialSpecifications", SqlDbType.VarChar, 80)
                {
                    Value = pware.MaterialSpecifications
                },
                new SqlParameter("@ProductQuantity", SqlDbType.Int)
                {
                    Value = pware.ProductQuantity
                },
                new SqlParameter("@note", SqlDbType.VarChar, 200)
                {
                    Value = pware.note
                },
                new SqlParameter("@StorageAddress", SqlDbType.VarChar, 255)
                {
                    Value = pware.StorageAddress
                },
                new SqlParameter("@UserName", SqlDbType.VarChar, 50)
                {
                    Value = pware.UserName
                },
            };

            try
            {
                return(SQLhelp.ExecuteNonQuery(sql, CommandType.Text, pms));
            }
            catch (Exception)
            {
                throw;
            }
        }