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(); }
//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(); }
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 LoadSellerContact() { SellerContactBL seller = new SellerContactBL(); dgvSellerContact.DataSource = seller.GetSellerContact(); }