示例#1
0
        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();
        }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
        }
示例#4
0
        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"]);
        }
示例#5
0
        private void LoadBuyerAddress()
        {
            BuyerAddressBL buyer = new BuyerAddressBL();

            dgvBuyerAddress.DataSource = buyer.GetBuyerAddress();
        }