public static void Main() { // 2 methods to call this meethos. 1. create instance of main class. 2. create instance of abstract clas referencing to main class CustClass CC = new CustClass(); CC.print(); CustomerAbstract CA = new CustClass(); CA.print(); }
private CustAddress GetHydratedCustAddress(CustClass custClass, API.Enums.CustAddrType type) { var custAdress = new CustAddress(); custAdress.AllowInvtSubst = custClass.AllowInvtSubst; custAdress.BackOrdPrice = 0; custAdress.BOLReqd = 0; custAdress.CarrierBillMeth = 6; custAdress.CloseSOLineOnFirstShip = 0; custAdress.CloseSOOnFirstShip = 0; custAdress.CreateDate = DateTime.Now; custAdress.CreateType = 0; custAdress.CreateUserID = Environment.UserName; custAdress.CurrID = custClass.CurrID; custAdress.CustAddrID = "Test - " + type.ToString(); custAdress.FOBKey = custClass.FOBKey; custAdress.FreightMethod = 2; custAdress.InvoiceReqd = 0; custAdress.LanguageID = custClass.LanguageID; custAdress.PackListContentsReqd = 0; custAdress.PackListReqd = 0; custAdress.PriceAdj = 0; custAdress.PriceBase = 0; custAdress.PrintOrderAck = 0; custAdress.PmtTermsKey = 22; custAdress.RequireSOAck = custClass.RequireSOAck; custAdress.ShipComplete = custClass.ShipComplete; custAdress.ShipDays = 3; custAdress.ShipLabelFormKey = custClass.ShipLabelFormKey; custAdress.ShipLabelsReqd = 0; custAdress.SOAckFormKey = custClass.SOAckFormKey; custAdress.SOAckMeth = 0; custAdress.SperKey = custClass.SperKey; //billtoCustAddress.WhseKey = accountSettings.WarehouseKey; custAdress.UsePromoPrice = 0; custAdress.ShipMethKey = custClass.ShipMethKey; //billtoCustAddress.WhseKey = accountSettings.WarehouseKey; custAdress.InvcFormKey = custClass.InvcFormKey; //billtoCustAddress.PackListFormKey = accountSettings.PackListFormKey; //billtoCustAddress.SalesTerritoryKey = accountSettings.TerritoryKey; custAdress.Type = type; return(custAdress); }
//-----------------------LOAD------------------------- private void Billing_Load(object sender, EventArgs e) { settings = new AccountSettings(); service = new LookUpService(); var custClasses = service.GetCustClasses(); custClass = custClasses.FirstOrDefault(c => c.Key == CustClassKey); custTypes = service.GetCustClasses(); paymentTerms = service.GetPaymentTerms(); shipMethods = service.GetShipMethods(); //do we need? invoiceCopies = service.GetDistinctInvoiceCopies(); invoiceCopies = invoiceCopies.OrderBy(c => c).ToList(); invoiceCopies.Insert(0, ""); invoiceCopies.RemoveAll(c => c == null); cboPaymentTerms.DisplayMember = "Id"; cboPaymentTerms.ValueMember = "Key"; cboPaymentTerms.DataSource = paymentTerms; cboShipMethod.DisplayMember = "ShipMethID"; cboShipMethod.ValueMember = "Key"; cboShipMethod.DataSource = shipMethods; lblStatus.Text = "Set additional account settings."; lblStatus.ForeColor = Color.Red; if (CustClassKey == 0) { rdoEndUser.Checked = true; } else { SetControlsFromPassedInFields(); } containerValidator.Validate(); }
private void SetDefaultSettings(string accountType) { CustClass type = custTypes.First(c => c.Name == accountType); settings.CustClass = type; settings.PricePackSlip = chkPricePackingSlip.Checked ? "Yes" : "No"; settings.CustClass.StmtFormKey = type.StmtFormKey; settings.CustClass.ShipMethKey = type.ShipMethKey; cboPaymentTerms.SelectedIndex = paymentTerms.FindIndex(terms => terms.Key == type.PmtTermsKey); var periodIndex = type.CreditLimit.ToString().IndexOf('.'); if (periodIndex == -1) { txtCreditLimit.Text = "$" + type.CreditLimit.ToString() + ".00"; } else { txtCreditLimit.Text = "$" + type.CreditLimit.ToString().Substring(0, periodIndex + 3); } cboShipMethod.SelectedIndex = shipMethods.FindIndex(meth => meth.Key == type.ShipMethKey); }
public AccountSettings() { CustClass = new CustClass(); }