// add customer public void AddCustomer(ExcoCustomer excoCust, Dictionary <int, Invoice> invoiceMap, int fiscalYear, bool doesIncludeSurcharge, Dictionary <string, List <ExcoMoney> > budgetMap, Dictionary <int, List <string> > partsMap) { Customer customer = new Customer(excoCust, plantID); customer.GetData(invoiceMap, fiscalYear, doesIncludeSurcharge, budgetMap, partsMap); custList.Add(customer); }
public Customer(ExcoCustomer customer) { this.customer = customer; mar.GetData(1, id, curr); mic.GetData(3, id, curr); tex.GetData(5, id, curr); col.GetData(4, id, curr); //sum = mar + mic + tex + col; sum.curr = curr; }
// constructor public Customer(ExcoCustomer excoCustomer, int plantID) { this.excoCustomer = excoCustomer; this.plantID = plantID; for (int i = 0; i <= 12; i++) { budgetList.Add(new ExcoMoney()); actualList.Add(new ExcoMoney()); actualListLastYear.Add(new ExcoMoney()); surchargeList.Add(new ExcoMoney()); solidList.Add(0); hollowList.Add(0); ncrList.Add(0); } }
public void ExcoCustomerTableConstructorTest() { ExcoCustomerTable custTable = ExcoCustomerTable.Instance; // test customer number ExcoODBC database = ExcoODBC.Instance; database.Open(Database.CMSDAT); string query = "select trim(bvcust), trim(upper(bvname)), trim(bvcurr), trim(bvterr) from cmsdat.cust where bvstat='A'"; OdbcDataReader reader = database.RunQuery(query); while (reader.Read()) { string id = reader[0].ToString(); ExcoCustomer cust = custTable.GetCustomer(id); // test id if (false == id.Contains("S")) { Assert.AreEqual(id, cust.BillToID); } else { bool isGood = false; if (0 == cust.BillToID.CompareTo(id) || 0 == cust.ShipToID.CompareTo(id) || 0 == cust.SillyID.CompareTo(id)) { isGood = true; } Assert.IsTrue(isGood); } // test name Assert.AreEqual(reader[1].ToString(), cust.Name); // test currency Assert.AreEqual(reader[2].ToString(), cust.Currency); // test territory if it's a bill-to order if (!reader[3].ToString().Contains("S")) { Assert.AreEqual(reader[3].ToString(), cust.Territory); } } reader.Close(); }