public void SetSellerAddress(int ID) { SellerAddressBL sellerContactBL = new SellerAddressBL(); table = sellerContactBL.GetAddressById(ID); txtAddress.Text = table.Rows[0]["Address"].ToString(); txtCity.Text = table.Rows[0]["City"].ToString(); txtPhone.Text = table.Rows[0]["Phone"].ToString(); txtStreet.Text = table.Rows[0]["Street"].ToString(); }
private void button2_Click(object sender, EventArgs e) { SellerAddressBL contactBL = new SellerAddressBL(); if (dgvSellerAddress.SelectedRows.Count > 0) { var id = (int)dgvSellerAddress.SelectedRows[0].Cells["SellerID"].Value; contactBL.DeleteSellerAddress(id); LoadSellerAddress(); } }
private void button1_Click(object sender, EventArgs e) { SellerAddressBL addressBL = new SellerAddressBL(); if (table == null) { addressBL.AddSellerAddress(txtAddress.Text, txtCity.Text, txtPhone.Text, txtStreet.Text, SellerMasterID); } else { addressBL.UpdateSellerAddress(txtAddress.Text, txtCity.Text, txtPhone.Text, txtStreet.Text, (int)table.Rows[0]["SellerAddressID"]); } this.Close(); LoadSellerAddress(); }
public void SetSellerMaster(int ID) { SellerMasterBL sellerMasterBL = new SellerMasterBL(); table = sellerMasterBL.GetSellerByID(ID); txtCompanyName.Text = table.Rows[0]["CompanyName"].ToString(); SellerContactBL seller = new SellerContactBL(); dgvSellerContact.DataSource = seller.GetContactById((int)table.Rows[0]["ID"]); SellerAddressBL sellerAddress = new SellerAddressBL(); dgvSellerAddress.DataSource = sellerAddress.GetAddressById((int)table.Rows[0]["ID"]); }
private void LoadSellerAddress() { SellerAddressBL seller = new SellerAddressBL(); dgvSellerAddress.DataSource = seller.GetSellerAddress(); }