private void onChangeMount(object sender, SelectionChangedEventArgs e) { DTO_HangHoa goods = cbbGoodsName.SelectedItem as DTO_HangHoa; if (goods != null && cbbReportYear.Text != "" && cbbReportMonth.Text != "") { txtImportMount.Text = BUS_BaoCaoTonKho.getImport(goods.MaHangHoa, Int32.Parse(cbbReportMonth.Text), Int32.Parse(cbbReportYear.Text)).ToString(); txtFirstMount.Text = BUS_BaoCaoTonKho.getFirstMount(goods.MaHangHoa).ToString(); txtExportMount.Text = BUS_BaoCaoTonKho.getExport(goods.MaHangHoa, Int32.Parse(cbbReportMonth.Text), Int32.Parse(cbbReportYear.Text)).ToString(); txtLastMount.Text = BUS_BaoCaoTonKho.getLastMount(goods.MaHangHoa, Int32.Parse(cbbReportMonth.Text), Int32.Parse(cbbReportYear.Text)).ToString(); } //txtSumMoney.Text = BUS_PhieuChi.Instance.sumMoneyPC(phieuNhap.MaPhieuNhap).ToString(); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Bạn có muốn xóa dòng này?", "Confirmation", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { if (dgvStockReport.SelectedItem != null) { DTO_BaoCaoTonKho obj = dgvStockReport.SelectedItem as DTO_BaoCaoTonKho; BUS_BaoCaoTonKho.Instance.Delete(obj); dgvStockReport.ItemsSource = BUS_BaoCaoTonKho.showData(); } } }
public UI_ThemBaoCaoTK(Grid gridReport, DTO_BaoCaoTonKho obj) { InitializeComponent(); this.gridReport = gridReport; List <int> month = new List <int>(); for (int i = 1; i <= 12; i++) { month.Add(i); } List <int> year = new List <int>() { 2015, 2016, 2017, 2018, 2019, 2020 }; cbbReportMonth.ItemsSource = month; cbbReportYear.ItemsSource = year; cbbGoodsName.ItemsSource = BUS_BaoCaoTonKho.showGoods(); if (obj == null) { AutoGenerateID(); isNew = true; } else { txtReportID.Text = obj.MaBaoCao; txtLastMount.Text = obj.SoLuongTonCuoi.ToString(); cbbGoodsName.Text = obj.TenHangHoa; txtFirstMount.Text = obj.SoLuongTonDau.ToString(); txtImportMount.Text = obj.SoLuongNhap.ToString(); txtExportMount.Text = obj.SoLuongXuat.ToString(); cbbReportMonth.Text = obj.Thang.ToString(); cbbReportYear.Text = obj.Nam.ToString(); isNew = false; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { dgvStockReport.ItemsSource = BUS_BaoCaoTonKho.showData(); }
private void ShowChart(String switchStr) { var data = BUS_BaoCaoTonKho.showChart(cbbTenHangHoa.Text); chartStock.Series.Clear(); chartStock.AxisX.Clear(); chartStock.AxisY.Clear(); ColumnSeries colNhap = new ColumnSeries() { Title = "Số lượng nhập", DataLabels = true, Values = new ChartValues <int>(), LabelPoint = point => point.Y.ToString() }; ColumnSeries colTonDau = new ColumnSeries() { Title = "Số lượng tồn đầu", DataLabels = true, Values = new ChartValues <int>(), LabelPoint = point => point.Y.ToString() }; ColumnSeries colXuat = new ColumnSeries() { Title = "Số lượng xuất", DataLabels = true, Values = new ChartValues <int>(), LabelPoint = point => point.Y.ToString() }; ColumnSeries colTonCuoi = new ColumnSeries() { Title = "Số lượng tồn cuối", DataLabels = true, Values = new ChartValues <int>(), LabelPoint = point => point.Y.ToString() }; Axis ax = new Axis() { Separator = new Separator() { Step = 1, IsEnabled = false } }; ax.Labels = new List <String>(); foreach (var item in data) { colNhap.Values.Add(item.SoLuongNhap.Value); colXuat.Values.Add(item.SoLuongXuat.Value); colTonCuoi.Values.Add(item.SoLuongTonCuoi.Value); colTonDau.Values.Add(item.SoLuongTonDau.Value); if (switchStr.Contains("Nam")) { ax.Labels.Add(item.Nam.ToString()); } else if (switchStr.Contains("Thang")) { ax.Labels.Add(item.Thang.ToString()); } } chartStock.Series.Add(colNhap); chartStock.Series.Add(colXuat); chartStock.Series.Add(colTonDau); chartStock.Series.Add(colTonCuoi); chartStock.AxisX.Add(ax); chartStock.AxisY.Add(new Axis { LabelFormatter = value => value.ToString(), Separator = new Separator() }); }
public UI_BieuDoBaoCao(Grid gridReport) { InitializeComponent(); this.gridReport = gridReport; cbbTenHangHoa.ItemsSource = BUS_BaoCaoTonKho.showData(); }