public void SetSellerContact(int ID)
        {
            SellerContactBL sellerContactBL = new SellerContactBL();

            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 btnAdd_Click(object sender, EventArgs e)
        //{
        //    frmDetailSellerContact sellerContact = new frmDetailSellerContact();
        //    sellerContact.Show();
        //    this.Close();
        //}

        private void btnDelete_Click(object sender, EventArgs e)
        {
            SellerContactBL contactBL = new SellerContactBL();

            if (dgvSellerContact.SelectedRows.Count > 0)
            {
                var id = (int)dgvSellerContact.SelectedRows[0].Cells["ID"].Value;
                contactBL.DeleteSellerContact(id);
                LoadSellerContact();
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            SellerContactBL contactBL = new SellerContactBL();

            if (table == null)
            {
                contactBL.AddSellerContact(txtName.Text, txtMobile.Text, txtEmail.Text, txtWhatsapp.Text, SellerMasterID);
            }
            else
            {
                contactBL.UpdateSellerContact(txtName.Text, txtMobile.Text, txtEmail.Text, txtWhatsapp.Text, (int)table.Rows[0]["SellerContactID"]);
            }
            this.Close();
            LoadSellerContact();
        }
Пример #4
0
        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"]);
        }
Пример #5
0
        private void LoadSellerContact()
        {
            SellerContactBL seller = new SellerContactBL();

            dgvSellerContact.DataSource = seller.GetSellerContact();
        }