private void FrmUsingOfEquipment_Load(object sender, EventArgs e) { btnClose.BackgroundImage = Properties.Resources.Close_Window_32px.ToImage(); dgvtotalList.AllowUserToAddRows = false; crtEquipment.ChartAreas[0].AxisX.MajorGrid.Enabled = false; crtEquipment.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot; crtEquipment.Series[0].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; //crtEquipment.ChartAreas[0].AxisY.Interval = 300000; //crtEquipment.ChartAreas[0].AxisX.LabelStyle.Format = "dd.MM-hh:mm"; //"dd.MM-hh:mm"; crtEquipment.ChartAreas[0].AxisY.LabelStyle.Format = "0,000원"; crtEquipment.ChartAreas[0].AxisY.ScaleBreakStyle.Enabled = true; crtEquipment.ChartAreas[0].AxisX.ScaleBreakStyle.Enabled = true; panelImage.BringToFront(); panelImage.Image = Image.FromFile(Application.StartupPath + "\\images\\" + "NewGooDeeWay.png"); DAO.EquipmentDAO dAO = new DAO.EquipmentDAO(); var firstDayOfMonth_year = DateTime.Now.Year; var firstDayOfMonth_month = DateTime.Now.Month; dtpStartDate.Value = new DateTime(firstDayOfMonth_year, firstDayOfMonth_month, 1); equipment = dAO.EquipmentByDate(dtpStartDate.Value, DateTime.Now); crtEquipment.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.RangeColumn; crtEquipment.Series[0].Points.DataBind(equipment, "PurchaseDate", "purchasePrice", null); crtEquipment.Series[0].LegendText = "총액"; DetailInfo(); dgvtotalList.DataSource = SetDataTable(dAO.EquipmentByDate(dtpStartDate.Value, dtpEndDate.Value)); }
/// <summary> /// 검색하기 버튼 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { DAO.EquipmentDAO dAO = new DAO.EquipmentDAO(); equipment = dAO.GroupingDateEquipment(dtpStartDate.Value, dtpEndDate.Value); crtEquipment.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.RangeColumn; crtEquipment.Series[0].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime; crtEquipment.Series[0].Points.DataBind(equipment, "purchaseDate", "purchasePrice", null); DetailInfo(); dgvtotalList.DataSource = SetDataTable(dAO.EquipmentByDate(dtpStartDate.Value, dtpEndDate.Value)); }