public void SaveTest1()
 {
     CommodityImpl target = new CommodityImpl(); // TODO: 初始化为适当的值
     PurchasePayment purchasePayment = new PurchasePayment(); // TODO: 初始化为适当的值
     purchasePayment.PayEmpID = "LK";
     purchasePayment.PaymentAmount = 200;
     purchasePayment.PaymentDate = DateTime.Parse("2010-1-1");
     purchasePayment.PurOrderID = "PO_ID_20101110_00001";
     purchasePayment.Remark = "备注";
     target.POSavePay(purchasePayment);
     Assert.Inconclusive("无法验证不返回值的方法。");
 }
Example #2
0
        public List<PurchasePayment> SearchPurPaymentListByOrderID(string strPurchaseOrderID)
        {
            List<PurchasePayment> purchasePaymentList = new List<PurchasePayment>();

            string sqlStr = dbUtil.getSqlStatement("SQL_Comd_PurchasePayment_SearchByPurOrderID");
            SqlParameter[] sqlParms = {
                new SqlParameter("@PurchaseOrderID",SqlDbType.VarChar,20)
            };
            sqlParms[0].Value = strPurchaseOrderID;

            DataSet searchResult = null;
            try
            {
                searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms);
                foreach (DataTable dt in searchResult.Tables)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        PurchasePayment purchasePayment = new PurchasePayment();

                        purchasePayment.PurOrderID = dr["PurchaseOrderID"].ToString();
                        purchasePayment.PaymentAmount = Convert.ToSingle(dr["PaymentAmount"]);
                        if (dr["PaymentDate"].ToString() == string.Empty)
                        {
                            purchasePayment.PaymentDate = DateTime.MinValue;
                        }
                        else
                        {
                            purchasePayment.PaymentDate = DateTime.Parse(dr["PaymentDate"].ToString());
                        }
                        purchasePayment.PayEmpID = dr["PaymentEmpID"].ToString();
                        purchasePayment.PayEmpName = dr["PaymentEmpName"].ToString();
                        purchasePayment.Remark = dr["Remark"].ToString();

                        purchasePaymentList.Add(purchasePayment);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001");
            }

            return purchasePaymentList;
        }
Example #3
0
        public int AddPurchasePayment(PurchasePayment purchasePayment, string currentUser)
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_Comd_PurchasePayment_Insert");

            SqlParameter[] sqlParms = {
                new SqlParameter("@PurchaseOrderID",SqlDbType.VarChar,20),
                new SqlParameter("@PaymentAmount",SqlDbType.Float),
                new SqlParameter("@PaymentDate",SqlDbType.VarChar,10),
                new SqlParameter("@PaymentEmpID",SqlDbType.VarChar,20),
                new SqlParameter("@Remark",SqlDbType.NVarChar,800),
                new SqlParameter("@CreateUser",SqlDbType.VarChar,20),
                new SqlParameter("@UpdateUser",SqlDbType.VarChar,20)
            };

            sqlParms[0].Value = purchasePayment.PurOrderID;
            sqlParms[1].Value = purchasePayment.PaymentAmount;
            sqlParms[2].Value = purchasePayment.PaymentDate.ToString("yyyy-MM-dd"); ;
            sqlParms[3].Value = purchasePayment.PayEmpID;
            sqlParms[4].Value = purchasePayment.Remark;
            sqlParms[5].Value = currentUser;
            sqlParms[6].Value = currentUser;

            int resultCount = 0;
            try
            {
                resultCount = (int)DAO.DBAccess.ExecuteNonQuery(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms);
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001");
            }
            return resultCount;
        }
Example #4
0
 private void InitPayInfo()
 {
     purPay = new PurchasePayment();
 }
Example #5
0
 public void POSavePay(PurchasePayment purchasePayment)
 {
     if (purchasePayment.PaymentAmount == 0 && (purchasePayment.Remark.Equals("") || purchasePayment.Remark == null))
     {
         return;
     }
     try
     {
         int resultCount = 0;
         resultCount = comdDAO.AddPurchasePayment(purchasePayment, this.currentUser);
         if (resultCount == 0)
         {
             throw new DAOException("E0001");
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Example #6
0
        public void POQuickPay(string strPurOrderID)
        {
            PurPayFormEntity purPayFormEntity = this.POGetPayInfo(strPurOrderID);

            this.validCheckPurPay(purPayFormEntity.PurchaseParent);
            if (purPayFormEntity.PayList != null && purPayFormEntity.PayList.Count > 0)
            {
                //此订单已存在付款记录,不能执行快速付款操作。
                throw new BIZException("W03006");
            }

            PurchasePayment purchasePayment = new PurchasePayment();
            purchasePayment.PurOrderID = purPayFormEntity.PurchaseParent.OrderId;
            purchasePayment.PayEmpID = this.currentUser;
            purchasePayment.PaymentDate = DateTime.Now;
            purchasePayment.Remark = "";
            //purchasePayment.PaymentAmount = purPayFormEntity.PurchaseParent.DuePay();
            purchasePayment.PaymentAmount = purPayFormEntity.AmountPaying;

            this.POSavePay(purchasePayment);

            this.POMarkPaymentComplete(strPurOrderID);
        }