public void SetBuyerContact(int ID)
        {
            BuyerContactBL sellerContactBL = new BuyerContactBL();

            table            = sellerContactBL.GetContactById(ID);
            txtName.Text     = table.Rows[0]["Name"].ToString();
            txtMobile.Text   = table.Rows[0]["Mobile"].ToString();
            txtEmail.Text    = table.Rows[0]["Email"].ToString();
            txtWhatsapp.Text = table.Rows[0]["Whatsapp"].ToString();
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            BuyerContactBL contactBL = new BuyerContactBL();

            if (dgvBuyerContact.SelectedRows.Count > 0)
            {
                var id = (int)dgvBuyerContact.SelectedRows[0].Cells["BuyerMasterID"].Value;
                contactBL.DeleteBuyerContact(id);
                LoadBuyerContact();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BuyerContactBL contactBL = new BuyerContactBL();

            if (table == null)
            {
                contactBL.AddBuyerContact(txtName.Text, txtMobile.Text, txtEmail.Text, txtWhatsapp.Text, BuyerMasterID);
            }
            else
            {
                contactBL.UpdateBuyerContact(txtName.Text, txtMobile.Text, txtEmail.Text, txtWhatsapp.Text, (int)table.Rows[0]["BuyerMasterID"]);
            }
            this.Close();
            LoadBuyerContact();
        }
예제 #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 LoadBuyerContact()
        {
            BuyerContactBL seller = new BuyerContactBL();

            dgvBuyerContact.DataSource = seller.GetBuyerContact();
        }