コード例 #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //allows to search the database for a client
            string id = txtSearchClient.Text;
            IndividualClientBLL bll = new IndividualClientBLL();

            IndividualClient ic = bll.GetIndividualClientByID(id);

            BindingSource source = new BindingSource();

            source.Add(ic);

            dgvClientDetails.DataSource = source;
        }
コード例 #2
0
 private void btnAddIC_Click(object sender, EventArgs e)
 {
     try
     {
         IndividualClientBLL clientData = new IndividualClientBLL();
         IndividualClient    client     = new IndividualClient();
         client.clientID   = txtID.Text;
         client.Name       = txtName.Text;
         client.Surname    = txtSurname.Text;
         client.Phone      = txtPhone.Text;
         client.Email      = txtEmail.Text;
         client.AddressID  = txtAddress.Text;
         client.ContractID = txtContract.Text;
         clientData.InsertIndividualClient(client);
     }
     catch (Exception exp)
     {
         MessageBox.Show($"Error AddClient Form {exp.Message}");
     }
 }
コード例 #3
0
        public override void Regiter()
        {
            try
            {
                IndividualClient client = new IndividualClient();
                client.clientID   = this.clientID;
                client.Name       = this.Name;
                client.Surname    = this.Surname;
                client.Phone      = this.Phone;
                client.Email      = this.Email;
                client.AddressID  = this.AddressID;
                client.ContractID = this.ContractID;

                IndividualClientBLL individualData = new IndividualClientBLL();
                individualData.InsertIndividualClient(client);
            }
            catch (Exception e)
            {
                MessageBox.Show($"Error on IndividualClient class : {e.Message}");
            }
        }