Ejemplo n.º 1
0
 private void cmdOK_Click(object sender, EventArgs e)
 {
     Data.Branch clsBranch = new Data.Branch();
     BranchDetails = clsBranch.Details(cboBranch.Text);
     clsBranch.CommitAndDispose();
     Result = System.Windows.Forms.DialogResult.OK;
     this.Hide();
 }
Ejemplo n.º 2
0
        private void LoadOptions()
        {
            cboBranch.Items.Clear();
            Data.Branch clsBranch = new Data.Branch();
            foreach (System.Data.DataRow dr in clsBranch.ListAsDataTable().Rows)
            {
                cboBranch.Items.Add(dr["BranchCode"]);
            }
            clsBranch.CommitAndDispose();

            if (cboBranch.Items.Count == 0)
                cboBranch.Items.Add("Please Reload");
            else if (BranchDetails.BranchID != 0)
                cboBranch.SelectedIndex = cboBranch.Items.IndexOf(BranchDetails.BranchCode);
            else
                cboBranch.SelectedIndex = 0;

        }
Ejemplo n.º 3
0
		protected void cboBranch_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			Data.Branch clsBranch = new Data.Branch();
			Data.BranchDetails clsDetails = clsBranch.Details(Convert.ToInt16(cboBranch.SelectedItem.Value));
			clsBranch.CommitAndDispose();
			
			txtBranchAddress.Text = clsDetails.Address;
		}
Ejemplo n.º 4
0
        private void LoadOptions()
        {
            cboBranch.Items.Clear();
            Data.Branch clsBranch = new Data.Branch();
            foreach (System.Data.DataRow dr in clsBranch.ListAsDataTable(TerminalNo: TerminalDetails.TerminalNo).Rows)
            {
                cboBranch.Items.Add(dr["BranchCode"]);
            }

            Int32 iBranchCount = new Data.Terminal(clsBranch.Connection, clsBranch.Transaction).BranchCount(txtTerminalNo.Text);

            clsBranch.CommitAndDispose();

            if (iBranchCount == 0)
            {
                cboBranch.Items.Add("No Applicable Branch");
            }
            else if (iBranchCount != 0)
            {
                cboBranch.SelectedIndex = cboBranch.Items.IndexOf(BranchDetails.BranchCode);
                cboBranch.Enabled = false;
            }
            else
            {
                cboBranch.SelectedIndex = cboBranch.Items.IndexOf(BranchDetails.BranchCode);
                cboBranch.Enabled = true;
            }

            txtTerminalName.Text = TerminalDetails.TerminalName;
            txtTerminalNo.Text = TerminalDetails.TerminalNo;
        }