protected void GvSupplierList_RowEditing(object sender, GridViewEditEventArgs e) { TblAddEdit.Visible = true; ButInsert.Visible = false; ButUpdate.Visible = true; ButCancle.Visible = true; int intSupplierId = Convert.ToInt32(GvSupplierList.DataKeys[e.NewEditIndex].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(); TxtPincode.Text = ObjSupplier.Pincode.ToString(); TxtContect.Text = ObjSupplier.Contactno.ToString(); TxtEmailId.Text = ObjSupplier.EmailId.ToString(); } }
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."; } }