private void labelThuocBanChay_Click(object sender, EventArgs e) { ColumnHeader0 = "STT"; ColumnHeader1 = "Tên Thuốc"; ColumnHeader2 = "Số Đơn vị đã bán"; ColumnHeader3 = ""; SetColumnHeader(ColumnHeader0, ColumnHeader1, ColumnHeader2, ColumnHeader3); listViewGeneral.Columns[listViewGeneral.Columns.Count - 1].Width = 0; labelTen.Text = "Tên Thuốc: " + instance.NameMedicine; labelSoDonHang.Text = "Tổng số bán được: " + instance.TotalSold.ToString(); labelSoTienBan.Text = ""; if (instance.ImageMedicine != null) { pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMap(pictureBoxDetail, instance.ImageMedicine); } else { pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMapResource(pictureBoxDetail, Resources.icons8_pill_240px); } listViewGeneral.Visible = true; List <MedicineStatistic> medicines = ThongKeHelper.GetMedicineStatistic(); int i = 0; listViewGeneral.Items.Clear(); foreach (var item in medicines) { i++; ListViewItem listViewItem = new ListViewItem(new string[] { i.ToString(), item.Name_Medicine, item.TotalSold.ToString() }); listViewGeneral.Items.Add(listViewItem); } }
private void PictureBoxThongKe_Click(object sender, EventArgs e) { panelThongKe.Visible = true; List <MoneyInMonth> revenues = ThongKeHelper.GetRevenueInMonths(2020); List <MoneyInMonth> salaries = ThongKeHelper.GetSalaryInMonths(2020); List <MoneyInMonth> importCosts = ThongKeHelper.GetImportCostInMonth(2020); List <MoneyInMonth> soldMoney = ThongKeHelper.GetMoneyInMonth(2020); foreach (var item in revenues) { chartThongKeDoanhThu.Series["Lợi Nhuận Trong Tháng"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money); } foreach (var item in salaries) { chartThongKeDoanhThu.Series["Lương Nhân Viên"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money); } foreach (var item in importCosts) { chartThongKeDoanhThu.Series["Nhập Kho"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money); } foreach (var item in soldMoney) { chartThongKeDoanhThu.Series["Bán ra"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money); } }
private void pictureBoxKhachHangThanQuen_Click(object sender, EventArgs e) { ColumnHeader0 = "STT"; ColumnHeader1 = "Tên"; ColumnHeader2 = "Đơn hàng đã Mua"; ColumnHeader3 = "Số tiền đã Mua"; SetColumnHeader(ColumnHeader0, ColumnHeader1, ColumnHeader2, ColumnHeader3); listViewGeneral.Columns[listViewGeneral.Columns.Count - 1].Width = 123; //pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMap(pictureBoxDetail, instance.) labelTen.Text = "Họ Và Tên: " + instance.CustomerName; labelSoDonHang.Text = "Số Đơn Hàng Mua: " + instance.NumberInvoiceOfCustomer.ToString(); labelSoTienBan.Text = "Số Tiền Mua: " + ExtensionHelper.ChangeToCurrency(instance.TotalCost.ToString()) + " VND"; listViewGeneral.Visible = true; List <CustomerStatistic> customer = ThongKeHelper.GetCustomerStatistic(); int i = 0; listViewGeneral.Items.Clear(); foreach (var item in customer) { i++; ListViewItem listViewItem = new ListViewItem(new string[] { i.ToString(), item.Name_Customer, item.TotalInvoice.ToString(), ExtensionHelper.ChangeToCurrency(item.TotalMoney.ToString()) }); listViewGeneral.Items.Add(listViewItem); } pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMapResource(pictureBoxDetail, Resources.icons8_user_100px); }
public void LoadComboBoxNam() { comboBoxChonNam.Items.Clear(); foreach (int year in ThongKeHelper.GetAllYear()) { ComboBoxItem item = new ComboBoxItem { Text = year.ToString(), Value = year }; comboBoxChonNam.Items.Add(item); } }
public void Load() { listViewChiTieu.Items.Clear(); List <Expense> expenses = ThongKeHelper.GetExpenses(); int i = 0; foreach (var item in expenses) { ListViewItem listViewItem = new ListViewItem(new string[] { i.ToString(), item.Type, ExtensionHelper.ChangeToCurrency(item.Cost.ToString()), item.Detail, item.DayCost.ToString(), item.ID.ToString() }); listViewChiTieu.Items.Add(listViewItem); i++; } }
private void pictureBoxNhanVienXuatSac_Click_1(object sender, EventArgs e) { ColumnHeader0 = "STT"; ColumnHeader1 = "Tên"; ColumnHeader2 = "Đơn hàng đã bán"; ColumnHeader3 = "Số tiền đã bán"; SetColumnHeader(ColumnHeader0, ColumnHeader1, ColumnHeader2, ColumnHeader3); listViewGeneral.Columns[listViewGeneral.Columns.Count - 1].Width = 123; if (instance.Image_Manager != null) { try { pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMap(pictureBoxDetail, instance.Image_Manager); } catch (Exception ex) { } } else { try { pictureBoxDetail.Image = ChangeBitmapHelper.ChangeBitMapResource(pictureBoxDetail, Resources.icons8_manager_100px); } catch (Exception ex) { } } labelTen.Text = "Họ Và Tên: " + instance.Name_Manager; labelSoDonHang.Text = "Số Đơn Hàng Bán: " + instance.TotalInvoiceSold.ToString(); labelSoTienBan.Text = "Số Tiền Bán: " + ExtensionHelper.ChangeToCurrency(instance.TotalMoneySold.ToString()) + " VND"; listViewGeneral.Visible = true; List <ManagerStatistic> managers = ThongKeHelper.GetManagerStatistic(); int i = 0; listViewGeneral.Items.Clear(); foreach (var item in managers) { i++; ListViewItem listViewItem = new ListViewItem(new string[] { i.ToString(), item.Name_Manager, item.TotalInvoice.ToString(), ExtensionHelper.ChangeToCurrency(item.TotalMoneySold.ToString()) }); listViewGeneral.Items.Add(listViewItem); } }
private void LoadChart(int year) { List <MoneyInMonth> revenues = new List <MoneyInMonth>(); revenues = ThongKeHelper.GetRevenueInMonths(year); var cnv = new Bunifu.DataViz.Canvas(); var dataPoint = new Bunifu.DataViz.DataPoint(Bunifu.DataViz.BunifuDataViz._type.Bunifu_splineArea); foreach (var revenue in revenues) { switch (revenue.Month) { case 1: dataPoint.addLabely("Tháng 1", revenue.Money.ToString()); break; case 2: dataPoint.addLabely("Tháng 2", revenue.Money.ToString()); break; case 3: dataPoint.addLabely("Tháng 3", revenue.Money.ToString()); break; case 4: dataPoint.addLabely("Tháng 4", revenue.Money.ToString()); break; case 5: dataPoint.addLabely("Tháng 5", revenue.Money.ToString()); break; case 6: dataPoint.addLabely("Tháng 6", revenue.Money.ToString()); break; case 7: dataPoint.addLabely("Tháng 7", revenue.Money.ToString()); break; case 8: dataPoint.addLabely("Tháng 8", revenue.Money.ToString()); break; case 9: dataPoint.addLabely("Tháng 9", revenue.Money.ToString()); break; case 10: dataPoint.addLabely("Tháng 10", revenue.Money.ToString()); break; case 11: dataPoint.addLabely("Tháng 11", revenue.Money.ToString()); break; case 12: dataPoint.addLabely("Tháng 12", revenue.Money.ToString()); break; } } cnv.addData(dataPoint); bunifuDataViz1.colorSet.Add(Color.Red); bunifuDataViz1.Render(cnv); List <MoneyInMonth> importedCosts = new List <MoneyInMonth>(); importedCosts = ThongKeHelper.GetImportCostInMonth(CurrentChosenYear); decimal total1 = 0; foreach (var imported in importedCosts) { total1 += imported.Money; } List <MoneyInMonth> soldValues = new List <MoneyInMonth>(); soldValues = ThongKeHelper.GetMoneyInMonth(CurrentChosenYear); decimal total2 = 0; foreach (var value in soldValues) { total2 += value.Money; } importCost.Text = ExtensionHelper.ChangeToCurrency(total1.ToString()) + " VNĐ"; soldValue.Text = ExtensionHelper.ChangeToCurrency(total2.ToString()) + " VNĐ"; amountCustomer.Text = ThongKeHelper.NumberOfCustomerInYear(CurrentChosenYear).ToString(); }
public void LoadProgress() { List <MoneyInMonth> salaries = new List <MoneyInMonth>(); salaries = ThongKeHelper.GetSalaryInMonths(DateTime.Now.Year); decimal thisMonth = 0; decimal total = 0; foreach (var salary in salaries) { if (salary.Month == DateTime.Now.Month) { thisMonth = salary.Money; total += salary.Money; } else { total += salary.Money; } } decimal x = (thisMonth / total); x *= 100; salaryCircleProgressbar3.Value = (int)x; List <MoneyInMonth> importedCosts = new List <MoneyInMonth>(); importedCosts = ThongKeHelper.GetImportCostInMonth(DateTime.Now.Year); decimal thisMonth1 = 0; decimal total1 = 0; decimal x1 = 0; foreach (var imported in importedCosts) { if (imported.Month == DateTime.Now.Month) { thisMonth1 = imported.Money; total1 += imported.Money; } else { total1 += imported.Money; } } if (total1 != 0) { x1 = (thisMonth1 / total1); x1 *= 100; } importedCircleProgressbar2.Value = (int)x1; List <MoneyInMonth> soldValues = new List <MoneyInMonth>(); soldValues = ThongKeHelper.GetMoneyInMonth(2020); decimal thisMonth2 = 0; decimal total2 = 0; foreach (var value in soldValues) { if (value.Month == DateTime.Now.Month) { thisMonth2 = value.Money; total2 += value.Money; } else { total2 += value.Money; } } decimal x2 = (thisMonth2 / total2); x2 *= 100; soldCircleProgressbar1.Value = (int)x2; }