示例#1
0
        public frmBroker(iBroker myBrokerInstance)
        {
            InitializeComponent();

            myBroker = myBrokerInstance;

            txtBoxBrokerName.Text      = myBroker.Name;
            txtBoxLandLinePhoneNo.Text = myBroker.LandLineTelNo;
            txtBoxWebSite.Text         = myBroker.Website;
            if (myBroker.Address != null)
            {
                rTxtBoxBrokerAddress.Text = myBroker.Address.FullAddress;
            }

            FillAgencyList();

            FillContactList();

            //Sort out the indicator of the broker type
            if (myBroker.IsAgency == true)
            {
                rButtonAgencyBroker.Checked = true;
            }
            else
            {
                rButtonEmployerBroker.Checked = true;
            }

            SetNotesCount();
        }
示例#2
0
        private void InitialiseContactDropDown(ComboBox thisComboBox, iBroker thisBroker)
        {
            var allContactNames = from m in thisBroker.Contacts select new { m.Name.FullName, m.ContactID };

            thisComboBox.DataSource    = allContactNames.ToList();
            thisComboBox.ValueMember   = "ContactID";
            thisComboBox.DisplayMember = "FullName";
            thisComboBox.SelectedIndex = -1;
        }
示例#3
0
        public frmBroker(bool isAgency)
        {
            InitializeComponent();

            myBroker = InstanceFactory.Broker();

            //Default to Agency for new brokers
            rButtonAgencyBroker.Checked   = isAgency;
            rButtonEmployerBroker.Checked = !isAgency;

            SetNotesCount();
        }
示例#4
0
        private void dataGridAgencies_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            //A row has been double clicked. We need to get the BrokerID value, extract the Broker instance
            //and then pass this to the form to display the Broker.
            int brokerIDSelected = Convert.ToInt32(dataGridAgencies.SelectedRows[0].Cells["BrokerID"].Value.ToString());

            //PUT THIS IN A Using BLOCK?
            JobLeadRepo thisJobLeadRepo = new JobLeadRepo();
            iBroker     brokerSelected  = thisJobLeadRepo.GetBroker(brokerIDSelected);

            frmBroker newBrokerForm = new frmBroker(brokerSelected);

            newBrokerForm.ShowDialog();

            //Now reinitialise the Agency Broker Grid
            ReloadAgencyBrokerGrid();
        }
示例#5
0
        private void btnUpdateClose_Click(object sender, EventArgs e)
        {
            //First thing to do is check that a broker type has been selected.
            if (rButtonAgencyBroker.Checked == false && rButtonEmployerBroker.Checked == false)
            {
                MessageBox.Show("Select a broker type.", "No Type", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //Update the entity level attributes
            myBroker.IsAgency      = rButtonAgencyBroker.Checked;
            myBroker.LandLineTelNo = txtBoxLandLinePhoneNo.Text;
            myBroker.Name          = txtBoxBrokerName.Text;
            myBroker.Website       = txtBoxWebSite.Text;

            myBroker = myBroker.Save();

            CloseBrokerForm();
        }
示例#6
0
        private void ShowExistingBrokerForm(iBroker selectedBroker)
        {
            frmBroker newBrokerForm = new frmBroker(selectedBroker);

            newBrokerForm.ShowDialog();
        }