Guest User

Untitled

a guest
Jun 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. protected void rgStateTax_PreRender( object sender, EventArgs e )
  2. {
  3. if( rgStateTax.MasterTableView.IsItemInserted )
  4. {
  5. foreach( GridItem item in rgStateTax.Items )
  6. {
  7. item.Visible = false;
  8. }
  9. }
  10.  
  11. if( rgStateTax.EditItems.Count > 0 )
  12. {
  13. foreach( GridDataItem item in rgStateTax.Items )
  14. {
  15. if( item != rgStateTax.EditItems[0] )
  16. {
  17. item.Visible = false;
  18. }
  19. }
  20. }
  21.  
  22. ContentAdministrationServiceClient client = null;
  23. List<DCTaxRate> taxRate = null;
  24. try
  25. {
  26. client = new ContentAdministrationServiceClient();
  27. taxRate = client.GetTaxRatesByCountryIdAndLocationTypeName( locationId, "State" );
  28. client.Close();
  29. }
  30. catch( FaultException )
  31. {
  32. AbortClient(client);
  33. throw;
  34. }
  35.  
  36. rgStateTax.DataSource = taxRate;
  37. rgStateTax.Rebind();
  38.  
  39. }
  40.  
  41. return taxRates.ToList();
  42. }
  43.  
  44. public void GetByCountryIdAndLoactionTypeName( long countryId, string locationTypeName )
  45. {
  46. IBOTaxRateCollection iboTaxRates = new BOTaxRateCollection();
  47. iboTaxRates.GetByCountryIdAndLocationTypeName( countryId, locationTypeName );
  48.  
  49. SetItems( iboTaxRates );
  50. }
  51.  
  52. public void GetByCountryIdAndLocationTypeName( long countryId, string locationTypeName )
  53. {
  54. ISingleResult<TaxRate> taxRates = Database.TaxRateReadByCountryIdAndLocationTypeName( countryId, locationTypeName );
  55. PopulateCollection( taxRates );
  56. }
  57.  
  58. <asp:DropDownList ID="dd_bound" runat="server" AppendDataBoundItems="True">
  59. <asp:ListItem Value="" Text="Select one..." />
  60. </asp:DropDownList>
Add Comment
Please, Sign In to add comment