Ejemplo n.º 1
0
 public UserControlTourDetail(TCH x, int i)
 {
     InitializeComponent();
     _data    = x;
     index    = i;
     get_tour = _data.Name;
 }
Ejemplo n.º 2
0
        public UserControlPieChart(TCH tCH)
        {
            InitializeComponent();
            _data = tCH;
            PieChartView.Series = new SeriesCollection();

            for (int i = 0; i < _data.bill.Count; i++)
            {
                var tmp = new PieSeries()
                {
                    Values = new ChartValues <int>()
                    {
                        _data.bill[i].Cost
                    }, Title = _data.bill[i].CostName
                };
                PieChartView.Series.Add(
                    new PieSeries()
                {
                    Values = new ChartValues <float> {
                        _data.bill[i].Cost
                    },
                    Title = _data.bill[i].CostName
                }
                    );
            }
            PieChartView.DataContext = this;
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _Tour         = new TCH();
            _Tour.Members = new BindingList <list_member>();
            _Tour.bill    = new BindingList <bill>();

            Update();
        }
Ejemplo n.º 4
0
        private void Border_Loaded(object sender, RoutedEventArgs e)
        {
            // đọc file data_travel

            var file     = AppDomain.CurrentDomain.BaseDirectory;
            var database = $"{file}data_travel.txt";
            var lines    = File.ReadAllLines(database);
            var count    = int.Parse(lines[0]);

            _data = new ObservableCollection <TCH>();


            // lấy giá trị các dòng trong file data_travel

            for (int i = 0; i < count; i++)
            {
                var line1 = lines[i * 4 + 1];
                var line2 = lines[i * 4 + 2];

                var line3 = lines[i * 4 + 3];
                var line4 = lines[i * 4 + 4];


                var tmp = new TCH()
                {
                    Name   = line1,
                    Imagee = line3,
                    Intro  = line2,
                    Pass   = line4,
                };
                _data.Add(tmp);
            }

            // xuất

            var temp = _rng.Next(_data.Count);

            NameImg.Text        = _data[temp].Name;
            Intro.Text          = _data[temp].Intro;
            dataFile            = $"{file}imageeeee\\{_data[temp].Imagee}";
            Autoimg.ImageSource = new BitmapImage(new Uri(dataFile));
        }
Ejemplo n.º 5
0
 private void ModifyData_Click(object sender, RoutedEventArgs e)
 {
     //Grid_1.Visibility = Visibility.Hidden;
     Grid_1.Children.Add(new UserControlUpdate(_data, index));
     _data = UserControlUpdate._data;
 }
Ejemplo n.º 6
0
 public UserControlUpdate(TCH x, int i)
 {
     InitializeComponent();
     _data = x;
     index = i;
 }
Ejemplo n.º 7
0
        public void traveling()
        {
            var folder = AppDomain.CurrentDomain.BaseDirectory;

            var database = $"{folder}data_travel.txt";
            var lines    = File.ReadAllLines(database);
            int count    = int.Parse(lines[0]);

            for (int i = 0; i < count; i++)
            {
                var line1 = lines[i * 4 + 1];
                var line2 = lines[i * 4 + 2];

                var line3 = lines[i * 4 + 3];
                var line4 = lines[i * 4 + 4];


                var temp = new TCH()
                {
                    Name   = line1,
                    Imagee = line3,
                    Intro  = line2,
                    Pass   = line4,
                };
                _data.Add(temp);
            }
            _data[1].Advance_Moneys.Add(new Advance_Money()
            {
                Info = "A tra cho B", Money = 100000
            });
            _data[1].Advance_Moneys.Add(new Advance_Money()
            {
                Info = "A tra cho B", Money = 100000
            });
            _data[1].Advance_Moneys.Add(new Advance_Money()
            {
                Info = "A tra cho B", Money = 100000
            });

            // lấy data detail
            for (int index = 0; index < count; index++)
            {
                BindingList <Milestone>   Milestones  = new BindingList <Milestone>();
                BindingList <list_member> list_member = new BindingList <list_member>();
                BindingList <bill>        bill        = new BindingList <bill>();
                folder = AppDomain.CurrentDomain.BaseDirectory;
                folder = folder + $"TourDetail\\{_data[index].Name}\\";

                //lo trinh
                var MemberFile    = File.ReadAllLines(folder + "member.TXT");
                var CostFile      = File.ReadAllLines(folder + "cost.txt");
                var MilestoneFile = File.ReadAllLines(folder + "milestone.txt");

                var num = Int32.Parse(MemberFile[0]);

                for (int i = 0; i < num; i++)
                {
                    list_member.Add(new list_member()
                    {
                        Member_Name = MemberFile[1 + 2 * i], Member_Avatar = $"{ folder }{ MemberFile[2 + 2 * i] }"
                    });
                }

                num = Int32.Parse(CostFile[0]);

                for (int i = 0; i < num; i++)
                {
                    bill.Add(new bill()
                    {
                        CostName = CostFile[1 + 2 * i], Cost = Int32.Parse(CostFile[2 + 2 * i])
                    });
                }

                num = Int32.Parse(MilestoneFile[0]);

                for (int i = 0; i < num; i++)
                {
                    Milestones.Add(new Milestone()
                    {
                        Part        = MilestoneFile[1 + 3 * i],
                        Part_Detail = MilestoneFile[2 + 3 * i],
                        Part_Image  = $"{folder}{MilestoneFile[3 + 3 * i]}",
                    });
                }
                _data[index].Members    = list_member;
                _data[index].bill       = bill;
                _data[index].Milestones = Milestones;
            }
        }