public void BindSupplierList() { DataSet dsSuplierMasterList = CSupplierMasterServices.SupplierMasterList(); GvSupplierList.DataSource = dsSuplierMasterList; GvSupplierList.DataBind(); }
protected void ButUpdate_Click(object sender, EventArgs e) { TblAddEdit.Visible = true; ButCancle.Visible = true; ButInsert.Visible = false; int intReturnValue = CSupplierMasterServices.SupplierUpdate( Convert.ToInt32(TxtSupplierId.Text), TxtSuppliername.Text, TxtAddress.Text, Txtarea.Text, Txtcity.Text, Convert.ToInt32(TxtPincode.Text), TxtContect.Text, TxtEmailId.Text); if (intReturnValue > 0) { BindSupplierList(); TxtSuppliername.Text = ""; TxtAddress.Text = ""; Txtarea.Text = ""; Txtcity.Text = ""; TxtPincode.Text = ""; TxtContect.Text = ""; TxtEmailId.Text = ""; Lblmsg.Text = "Supplier Update"; } else { Lblmsg.Text = "Error occured while Update Supplier."; } }
public void BindSuppliername() { DataSet dsSuplierMasterList = CSupplierMasterServices.SupplierMasterList(); Dropsupplierlist.DataSource = dsSuplierMasterList; Dropsupplierlist.DataTextField = "Suppliername"; Dropsupplierlist.DataValueField = "SupplierId"; Dropsupplierlist.DataBind(); }
protected void GvSupplierList_RowDeleting(object sender, GridViewDeleteEventArgs e) { TblAddEdit.Visible = false; ButCancle.Visible = true; ButUpdate.Visible = true; ButInsert.Visible = false; int intSupplierId = Convert.ToInt32(GvSupplierList.DataKeys[e.RowIndex].Value); CSupplierMaster ObjSupplier = new CSupplierMaster(intSupplierId); if (ObjSupplier.IsExit == true) { TxtSupplierId.Text = ObjSupplier.SupplierId.ToString(); TxtSuppliername.Text = ObjSupplier.Suppliername.ToString(); TxtAddress.Text = ObjSupplier.Address.ToString(); Txtarea.Text = ObjSupplier.Area.ToString(); Txtcity.Text = ObjSupplier.City.ToString(); TxtContect.Text = ObjSupplier.Contactno.ToString(); TxtPincode.Text = ObjSupplier.Pincode.ToString(); TxtEmailId.Text = ObjSupplier.EmailId.ToString(); } int intReturnValue = CSupplierMasterServices.SupplierDelete(Convert.ToInt32(TxtSupplierId.Text)); if (intReturnValue > 0) { BindSupplierList(); TxtSupplierId.Text = ""; TxtSuppliername.Text = ""; TxtAddress.Text = ""; Txtarea.Text = ""; Txtcity.Text = ""; TxtContect.Text = ""; TxtPincode.Text = ""; TxtEmailId.Text = ""; Lblmsg.Text = "Supplier Delete."; } else { Lblmsg.Text = "Error occured while Delete Supplier."; } }