Example #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            DataSet dsNames = PersonClass.FillNames(txtFirstName.Text.Trim(), txtLastName.Text.Trim());

            grdNames.DataSource     = dsNames.Tables[0];
            grdAddresses.DataSource = null;
        }
Example #2
0
 public CRUDAddress(int pID)
 {
     InitializeComponent();
     BindCountry();
     lbPersonId.Text = pID.ToString();
     dsAddress       = PersonClass.FillAllAddresses(pID);
 }
Example #3
0
 public CRUDPerson()
 {
     InitializeComponent();
     dsPerson           = PersonClass.FillNames();
     label5.Visible     = false;
     btnAddress.Visible = false;
 }
Example #4
0
        public void BindCountry()
        {
            DataSet dsCountry = PersonClass.FillCountryNames();

            cmbCountry.DataSource    = dsCountry.Tables[0];
            cmbCountry.DisplayMember = "CountryName";
            cmbCountry.ValueMember   = "CountryID";
        }
Example #5
0
        private void CountryMaster_Load(object sender, EventArgs e)
        {
            DataSet dsCountry = PersonClass.FillCountryNames();

            lstCountryMaster.DataSource    = dsCountry.Tables[0];
            lstCountryMaster.DisplayMember = "CountryName";
            lstCountryMaster.ValueMember   = "CountryID";
        }
Example #6
0
        public CRUDPerson(int pID)
        {
            InitializeComponent();
            dsPerson  = PersonClass.FillNames();
            lbID.Text = pID.ToString();
            DataRow row = dsPerson.Tables[0].Select("ID = " + pID + "").FirstOrDefault();

            txtFirstName.Text = row[0].ToString();
            txtLastName.Text  = row[1].ToString();

            dpDOB.Value      = DateTime.ParseExact(row[2].ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            txtNickName.Text = row[3].ToString();
        }
Example #7
0
        public CRUDAddress(int pID, int ID)
        {
            InitializeComponent();
            lbPersonId.Text = pID.ToString();
            lbID.Text       = ID.ToString();
            dsAddress       = PersonClass.FillAllAddresses(pID);
            BindCountry();
            DataRow row = dsAddress.Tables[0].Select("ID = " + ID + "").FirstOrDefault();

            txtAddressLine1.Text = row[0].ToString();
            txtAddressLine2.Text = row[1].ToString();

            cmbCountry.Text  = row[2].ToString().Trim();
            txtPostCode.Text = row[3].ToString();
        }
Example #8
0
 private void grdNames_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         DataSet dsAddress = PersonClass.FillAllAddresses(Convert.ToInt32(grdNames.Rows[e.RowIndex].Cells[4].Value));
         //FillAllAddresses(Convert.ToInt32(grdNames.Rows[e.RowIndex].Cells[4].Value));
         if (dsAddress.Tables[0].Rows.Count > 0)
         {
             grdAddresses.DataSource = dsAddress.Tables[0];
             grdAddresses.Visible    = true;
         }
         else
         {
             MessageBox.Show("No Address Found.Please Edit Person to Add Address", "Message");
             grdAddresses.DataSource = null;
         }
     }
 }
Example #9
0
 private void Person_Load(object sender, EventArgs e)
 {
     PersonClass.FillNames();
 }