Ejemplo n.º 1
0
        private void UC_ThongKe_Load(object sender, EventArgs e)
        {
            comboBox1.DataSource  = HoaDonBUS.GetNamHD();
            comboBox1.ValueMember = "YEAR";
            try
            {
                chart1.DataSource = HoaDonBUS.GetThangHD(int.Parse(comboBox1.SelectedValue.ToString()));


                chart1.Series["chartthu"].XValueMember  = "thang";
                chart1.Series["chartthu"].YValueMembers = "tien";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            try
            {
                chart2.DataSource = PhieuNhapBUS.GetThangPN(int.Parse(comboBox1.SelectedValue.ToString()));


                chart2.Series["chartchi"].XValueMember  = "thangPN";
                chart2.Series["chartchi"].YValueMembers = "tienPN";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            lbdoanhthu.Text = HoaDonBUS.TongDoanhThu(int.Parse(comboBox1.SelectedValue.ToString())).ToString();
            lbChiPhi.Text   = PhieuNhapBUS.TongChiPhi(int.Parse(comboBox1.SelectedValue.ToString())).ToString();
        }
Ejemplo n.º 2
0
        private void UC_BieuDo_Load(object sender, EventArgs e)
        {
            try
            {
                chart1.DataSource = HoaDonBUS.GetThangHD(year);


                chart1.Series["chartthu"].XValueMember  = "thang";
                chart1.Series["chartthu"].YValueMembers = "tien";
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            try
            {
                chart2.DataSource = PhieuNhapBUS.GetThangPN(year);


                chart2.Series["chartchi"].XValueMember  = "thangPN";
                chart2.Series["chartchi"].YValueMembers = "tienPN";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            lbdoanhthu.Text = HoaDonBUS.TongDoanhThu(year).ToString();
            lbChiPhi.Text   = PhieuNhapBUS.TongChiPhi(year).ToString();
        }