public void SetBuyerAddress(int ID) { BuyerAddressBL buyerAddressBL = new BuyerAddressBL(); table = buyerAddressBL.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 button5_Click(object sender, EventArgs e) { BuyerAddressBL contactBL = new BuyerAddressBL(); if (dgvBuyerAddress.SelectedRows.Count > 0) { var id = (int)dgvBuyerAddress.SelectedRows[0].Cells["SellerID"].Value; contactBL.DeleteBuyerAddress(id); LoadBuyerAddress(); } }
private void button1_Click(object sender, EventArgs e) { BuyerAddressBL addressBL = new BuyerAddressBL(); if (table == null) { addressBL.AddBuyerAddress(txtAddress.Text, txtCity.Text, txtPhone.Text, txtStreet.Text, BuyerMasterID); } else { addressBL.UpdateBuyerAddress(txtAddress.Text, txtCity.Text, txtPhone.Text, txtStreet.Text, (int)table.Rows[0]["SellerAddressID"]); } this.Close(); LoadBuyerAddress(); }
public void SetBuyerMaster(int ID) { BuyerMasterBL buyerMasterBL = new BuyerMasterBL(); table = buyerMasterBL.GetBuyerByID(ID); txtCompanyName.Text = table.Rows[0]["CompanyName"].ToString(); BuyerContactBL buyer = new BuyerContactBL(); dgvBuyerContact.DataSource = buyer.GetContactById((int)table.Rows[0]["ID"]); BuyerAddressBL buyerAddress = new BuyerAddressBL(); dgvBuyerAddress.DataSource = buyerAddress.GetAddressById((int)table.Rows[0]["ID"]); }
private void LoadBuyerAddress() { BuyerAddressBL buyer = new BuyerAddressBL(); dgvBuyerAddress.DataSource = buyer.GetBuyerAddress(); }