Ejemplo n.º 1
0
        public bool FindPayableListByCustomerCode(string CustomerCode)
        {
            bool bResult = false;

            using (DbManager db = new DbManager())
            {
                try
                {
                    db.Command.CommandText = string.Format(@"select * from CUSTOMER_PAYABLE_TBL 
where CUSTCODE = '{0}'", CustomerCode);

                    using (IDataReader dbReader = (IDataReader)db.ExecuteReader())
                    {
                        CustomerPayableClass commpayable;
                        payableList.Clear();
                        while (dbReader.Read())
                        {
                            commpayable = new CustomerPayableClass();
                            commpayable.CustomerCode  = CustomerCode;
                            commpayable.PayableCode   = dbReader.GetString(dbReader.GetOrdinal("PAYABLE_CODE"));
                            commpayable.PayableAmount = (float)Convert.ToDecimal(dbReader.GetValue(dbReader.GetOrdinal("PAYABLE_AMOUNT")));

                            payableList.Add(commpayable);
                            bResult = true;
                        }
                        dbReader.Close();
                    }
                }
                catch (Exception except)
                {
                    throw new Exception("Error in retrieving payable obligation!");
                }
            }
            return(bResult);
        }
Ejemplo n.º 2
0
        public bool FindPayableListByCustomerCode(string CustomerCode)
        {
            bool bResult = false;

            using (DbManager db = new DbManager())
            {
                try
                {
                    db.Command.CommandText = string.Format(@"select * from CUSTOMER_PAYABLE_TBL
            where CUSTCODE = '{0}'", CustomerCode);

                    using (IDataReader dbReader = (IDataReader)db.ExecuteReader())
                    {
                        CustomerPayableClass commpayable;
                        payableList.Clear();
                        while (dbReader.Read())
                        {
                            commpayable = new CustomerPayableClass();
                            commpayable.CustomerCode = CustomerCode;
                            commpayable.PayableCode = dbReader.GetString(dbReader.GetOrdinal("PAYABLE_CODE"));
                            commpayable.PayableAmount = (float)Convert.ToDecimal(dbReader.GetValue(dbReader.GetOrdinal("PAYABLE_AMOUNT")));

                            payableList.Add(commpayable);
                            bResult = true;
                        }
                        dbReader.Close();
                    }
                }
                catch (Exception except)
                {
                    throw new Exception("Error in retrieving payable obligation!");
                }
            }
            return bResult;
        }
Ejemplo n.º 3
0
 public void AddPayable(CustomerPayableClass payable)
 {
     payableList.Add(payable);
 }
Ejemplo n.º 4
0
 public void AddPayable(CustomerPayableClass payable)
 {
     payableList.Add(payable);
 }
        private string GetPayablesValue(string PayableCode)
        {
            CustomerPayableClass payableItem = new CustomerPayableClass();

            payableItem = this.customerPayableListAccessor.AllPayables.Find(delegate(CustomerPayableClass cpayable)
            {
                return (cpayable.PayableCode == PayableCode);
            });

            if (payableItem == null)
                return "0.00";
            else
                return string.Format("{0:0.00}", payableItem.PayableAmount);
        }