Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. public partial class XemVeDat : UserControl
  2. {
  3. public static MainWindow mainWindow;
  4. public string MaNguoiDung;
  5. public int STT = 0;
  6. public XemVeDat(MenuHome parent, string _maNguoiDung)
  7. {
  8. //mainWindow = windows;
  9. MaNguoiDung = _maNguoiDung;
  10. InitializeComponent();
  11. var ls = new VeXemPhimBUS().layVeDat(_maNguoiDung);
  12. string ghe = "";
  13.  
  14. if(ls.Count > 0)
  15. {
  16. Model.Models.VeXemPhim v = ls.First();
  17. txtGhe.Text = v.Ghe.DayGhe + v.Ghe.SoTT;
  18. this.DataContext = v;
  19. }
  20. if(ls.Count <= 1)
  21. {
  22. Next.Visibility = Visibility.Hidden;
  23. }
  24.  
  25. Pre.Visibility = Visibility.Hidden;
  26. }
  27.  
  28. private void btnNext_Click(object sender, RoutedEventArgs e)
  29. {
  30. STT = STT + 1;
  31. Pre.Visibility = Visibility.Visible;
  32. var ls = new VeXemPhimBUS().layVeDat(MaNguoiDung);
  33. string ghe = "";
  34.  
  35. Model.Models.VeXemPhim v = ls[STT];
  36. txtGhe.Text = v.Ghe.DayGhe + v.Ghe.SoTT;
  37. this.DataContext = v;
  38. if(STT == ls.Count - 1)
  39. {
  40. Next.Visibility = Visibility.Hidden;
  41. }
  42. }
  43.  
  44. private void btnPrev_Click(object sender, RoutedEventArgs e)
  45. {
  46. STT = STT - 1;
  47. Next.Visibility = Visibility.Visible;
  48. var ls = new VeXemPhimBUS().layVeDat(MaNguoiDung);
  49. string ghe = "";
  50.  
  51. Model.Models.VeXemPhim v = ls[STT];
  52. txtGhe.Text = v.Ghe.DayGhe + v.Ghe.SoTT;
  53. this.DataContext = v;
  54. if (STT == 0)
  55. {
  56. Pre.Visibility = Visibility.Hidden;
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement