private void cmbPayTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            Supplier MySupplier = new Supplier();

            DataType.CustomerDataType _ExCustomer = new DataType.CustomerDataType();
            DataType.SupplierDataType _ExSupplier = new DataType.SupplierDataType();
            Customer MyCustomer = new Customer();
            string   PayTo      = MyCommon.GetSelectedID(cmbPayFor, true);
            string   PayToID    = MyCommon.GetSelectedID(cmbPayTo, true);

            int    CusSupID = 0;
            bool   resp5    = int.TryParse(PayToID, out CusSupID);
            string respond  = "";

            switch (PayTo)
            {
            case "1":
                respond              = MySupplier.GetSupplier(CusSupID, out _ExSupplier, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExSupplier.Address1 + " " + _ExSupplier.Address2 + " " + _ExSupplier.Address3;
                lblToID.Text         = MyAccount.GetSupplierAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "2":
                lblToID.Text         = MyAccount.GetCustomerAccountNumber(CusSupID);
                respond              = MyCustomer.GetGetExistCustomer(CusSupID, out _ExCustomer, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExCustomer.Address1 + " " + _ExCustomer.Address2 + " " + _ExCustomer.Address3;
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "5":
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                lblAddress.Text      = MyAccount.GetOtherPayeeAdd(cmbPayTo.Text);
                break;

            default:
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                break;
            }
        }
Beispiel #2
0
        private void cmbPayTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Added by Manjula
            string SupName = "";

            if (cmbPayTo.SelectedValue != null)
            {
                SupName = cmbPayTo.SelectedValue.ToString();
            }
            LINKPayment objLink = new LINKPayment();

            objLink.SupName = SupName;
            LINKPayment[] objSuppID = objService.GetCreditorFinalSupplier(objLink);

            if (objSuppID.Length > 0)
            {
                SuppID = objSuppID[0].SupplierID.ToString();
            }

            BusinessLayer.Supplier.Supplier MySupplier  = new BusinessLayer.Supplier.Supplier();
            DataType.CustomerDataType       _ExCustomer = new DataType.CustomerDataType();
            DataType.SupplierDataType       _ExSupplier = new DataType.SupplierDataType();
            Customer MyCustomer = new Customer();
            string   PayTo      = MyCommon.GetSelectedID(cmbPayFor, true);
            string   PayToID    = MyCommon.GetSelectedID(cmbPayTo, true);
            int      CusSupID   = 0;
            bool     resp5      = int.TryParse(PayToID, out CusSupID);
            string   respond    = "";

            switch (PayTo)
            {
            case "1":
                // respond = MySupplier.GetSupplier(CusSupID, out _ExSupplier, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExSupplier.Address1 + " " + _ExSupplier.Address2 + " " + _ExSupplier.Address3;
                lblToID.Text         = MyAccount.GetSupplierAccountNumber(CusSupID);
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "2":
                lblToID.Text         = MyAccount.GetCustomerAccountNumber(CusSupID);
                respond              = MyCustomer.GetGetExistCustomer(CusSupID, out _ExCustomer, Program.AccountStatic.LoggingAsLocal);
                lblAddress.Text      = _ExCustomer.Address1 + " " + _ExCustomer.Address2 + " " + _ExCustomer.Address3;
                txtToAccount.Text    = MyAccount.GetAccountName(lblToID.Text);
                txtToAccount.Enabled = false;
                HanchyGrid.Visible   = false;
                break;

            case "5":
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                lblAddress.Text      = MyAccount.GetOtherPayeeAdd(cmbPayTo.Text);
                break;

            default:
                lblToID.Text         = "";
                txtToAccount.Text    = "";
                txtToAccount.Enabled = true;
                break;
            }
        }