Пример #1
0
        public int AddSalePayment(SalePayment salePayment, string currentUser)
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_Comd_SalePayment_Insert");

            SqlParameter[] sqlParms = {
                new SqlParameter("@SaleOrderID",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 = salePayment.SaleOrderID;
            sqlParms[1].Value = salePayment.PaymentAmount;
            sqlParms[2].Value = salePayment.PaymentDate.ToString("yyyy-MM-dd"); ;
            sqlParms[3].Value = salePayment.PayEmpID;
            sqlParms[4].Value = salePayment.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;
        }
Пример #2
0
        public List<SalePayment> SearchSalePaymentListByOrderID(string strSaleOrderID)
        {
            List<SalePayment> salePaymentList = new List<SalePayment>();

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

            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)
                    {
                        SalePayment salePayment = new SalePayment();

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

                        salePaymentList.Add(salePayment);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001");
            }

            return salePaymentList;
        }
Пример #3
0
 public void SOSavePay(SalePayment salePayment)
 {
     if (salePayment.PaymentAmount == 0 && (salePayment.Remark.Equals("") || salePayment.Remark == null))
     {
         return;
     }
     try
     {
         int resultCount = 0;
         resultCount = comdDAO.AddSalePayment(salePayment, this.currentUser);
         if (resultCount == 0)
         {
             throw new DAOException("E0001");
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #4
0
 private void InitPayInfo()
 {
     soPay = new SalePayment();
 }
Пример #5
0
        public void SOQuickPay(string strSaleOrderID)
        {
            SOPayFormEntity soPayFormEntity = this.SOGetPayInfo(strSaleOrderID);
            this.SOCheckValidPay(soPayFormEntity.SaleParent);
            if (soPayFormEntity.PayList != null && soPayFormEntity.PayList.Count > 0)
            {
                //此订单已存在付款记录,不能执行快速付款操作。
                throw new BIZException("W03006");
            }

            SalePayment salePayment = new SalePayment();
            salePayment.SaleOrderID = soPayFormEntity.SaleParent.OrderId;
            salePayment.PayEmpID = this.currentUser;
            salePayment.PaymentDate = DateTime.Now;
            salePayment.Remark = "";
            //purchasePayment.PaymentAmount = purPayFormEntity.PurchaseParent.DuePay();
            salePayment.PaymentAmount = soPayFormEntity.AmountPaying;

            this.SOSavePay(salePayment);

            this.SOMarkPaymentComplete(strSaleOrderID);
        }