Exemplo n.º 1
0
        private void frmChamCong_Load(object sender, EventArgs e)
        {
            dtpFromDay.Format       = DateTimePickerFormat.Custom;
            dtpFromDay.CustomFormat = "yyyy-MM-dd";
            dtpToDay.Format         = DateTimePickerFormat.Custom;
            dtpToDay.CustomFormat   = "yyyy-MM-dd";

            dtpFromTime.Format     = DateTimePickerFormat.Time;
            dtpFromTime.ShowUpDown = true;
            dtpToTime.Format       = DateTimePickerFormat.Time;
            dtpToTime.ShowUpDown   = true;

            #region Xử lý lookupEdit
            dtBoPhan = BUS_BoPhan.LoadBoPhan(ad_org_id);

            lkBoPhan.Properties.DataSource    = dtBoPhan;
            lkBoPhan.Properties.DisplayMember = "description";
            lkBoPhan.Properties.ValueMember   = "id";
            lkBoPhan.Properties.NullText      = "Chọn bộ phận";
            lkBoPhan.EditValue = dtBoPhan.Rows[0][0];


            lkBoPhan.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkBoPhan.Properties.DropDownRows = dtBoPhan.Rows.Count;
            //lkInput.Properties.ReadOnly = true;
            #endregion
        }
Exemplo n.º 2
0
        public void LoadCombobox()
        {
            #region Xử lý lookupEdit
            DataTable lstBoPhan = BUS_BoPhan.LoadBoPhan(BoPhan);

            lkBoPhan.Properties.DataSource    = lstBoPhan;
            lkBoPhan.Properties.DisplayMember = "description";
            lkBoPhan.Properties.ValueMember   = "id";
            lkBoPhan.Properties.NullText      = "Chọn bộ phận";
            lkBoPhan.EditValue = lstBoPhan.Rows[0][0];

            lkBoPhan.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkBoPhan.Properties.DropDownRows = lstBoPhan.Rows.Count;
            //lkInput.Properties.ReadOnly = true;
            #endregion


            //Gọi nghiệp vụ load tình trạng từ class BUL
            cmbTinhtrang.DataSource    = BUS_TinhTrang.LoadTinhTrang();
            cmbTinhtrang.DisplayMember = "StatusDescription";
            cmbTinhtrang.ValueMember   = "ID";

            //Gọi nghiệp vụ load tình trạng từ class BUL
            cmbChucvu.DataSource    = BUS_ChucVu.LoadChucVu();
            cmbChucvu.DisplayMember = "TitleName";
            cmbChucvu.ValueMember   = "IDT";
        }
Exemplo n.º 3
0
 public frmHistory(string ad_user_id, string ad_org_id, DataTable dtProcess)
 {
     InitializeComponent();
     this.ad_user_id = ad_user_id;
     this.ad_org_id  = ad_org_id;
     this.dtProcess  = dtProcess;
     dtboPhan        = BUS_BoPhan.LoadBoPhan(ad_org_id);
     utility.SearchProcess(this.Controls, dtProcess);
     GetData(DateTime.Now.ToString("yyyy-MM-") + "01", DateTime.Now.ToString("yyyy-MM-dd"), ad_org_id);
 }
Exemplo n.º 4
0
 public frmDiemDanh(string ad_user_id, string ad_org_id, DataTable dtProcess)
 {
     InitializeComponent();
     this.ad_user_id = ad_user_id;
     this.ad_org_id  = ad_org_id;
     this.dtProcess  = dtProcess;
     dtCa            = BUS_Ca.LoadCaShift(DateTime.Now.Date, ad_org_id);
     dtboPhan        = BUS_BoPhan.LoadBoPhan(ad_org_id);
     utility.SearchProcess(this.Controls, dtProcess);
 }
Exemplo n.º 5
0
 private void frmToChuc_Load(object sender, EventArgs e)
 {
     #region Load treeview
     dt = BUS_BoPhan.LoadNode(ad_org_id);
     TreeNode t = treeView.Nodes.Add(ad_org_description);
     t.Name = ad_org_id;
     PopulateTreeView(Convert.ToInt16(ad_org_id), t);
     treeView.ExpandAll();
     #endregion
 }
Exemplo n.º 6
0
 public frmNguoiDung(string ad_user_id, string ad_org_id, DataTable dtProcess)
 {
     InitializeComponent();
     this.v_ad_user_id = ad_user_id;
     this.v_ad_org_id  = ad_org_id;
     this.dtProcess    = dtProcess;
     dtNguoiDung       = BUS_HeThong.LoadAdUserFull(ad_org_id);
     dtboPhan          = BUS_BoPhan.LoadBoPhan(ad_org_id);
     utility.SearchProcess(this.Controls, dtProcess);
 }
Exemplo n.º 7
0
        private void frmQLSapXepCa_Load(object sender, EventArgs e)
        {
            dtboPhan = BUS_BoPhan.LoadNode(ad_org_id);
            TreeNode t = treeView.Nodes.Add(ad_org_description);

            t.Name = ad_org_id;
            treeView.SelectedNode = t;
            PopulateTreeView(Convert.ToInt16(ad_org_id), t);
            treeView.ExpandAll();

            dataSelect(ad_org_id);
        }
Exemplo n.º 8
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            int i = BUS_BoPhan.UpdateBoPhan(deptID, txtSuaMaBP.Text, txtSuaTenTA.Text, txtSuaTenTV.Text, tinhTrang);

            if (i == 1)
            {
                MessageBox.Show("Cập nhật thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Cập nhật không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 9
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            int i = BUS_BoPhan.InsertBoPhan(txtThemMaBP.Text, txtThemTenTA.Text, txtThemTenTV.Text, tinhTrang, deptID, levelID);

            if (i == 1)
            {
                MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Bộ phận đã tồn tại!", "Không thành công", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 10
0
        private void frmNhanVienFinal_Load(object sender, EventArgs e)
        {
            lblHoten.Left = (tableLayoutPanel1.Width - lblHoten.Width) / 2;
            //Gọi nghiệp vụ load tình trạng từ class BUL

            dt = BUS_BoPhan.LoadNode(ad_org_id);
            TreeNode t = treeView.Nodes.Add(ad_org_description);

            t.Name = ad_org_id;
            treeView.SelectedNode = t;
            PopulateTreeView(Convert.ToInt16(ad_org_id), t);
            treeView.ExpandAll();

            dataSelect(ad_org_id);
        }
Exemplo n.º 11
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string tinhTrang = "0";

            if (MessageBox.Show("Bạn có chắc chắn muốn xóa?", "Thông báo", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                int i = BUS_BoPhan.UpdateBoPhan(deptID, txtSuaMaBP.Text, txtSuaTenTA.Text, txtSuaTenTV.Text, tinhTrang);
                if (i == 1)
                {
                    MessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Xóa không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 12
0
        public frmNhSanLuong(string ad_user_id, string ad_org_id, DataTable dtProcess)
        {
            InitializeComponent();
            dateEdit1.EditValue = DateTime.Now.Date;
            dateEdit2.EditValue = DateTime.Now.Date;
            this.ad_user_id     = ad_user_id;
            this.ad_org_id      = ad_org_id;
            this.dtProcess      = dtProcess;
            dtboPhan            = BUS_BoPhan.LoadBoPhan(ad_org_id);
            utility.SearchProcess(this.Controls, dtProcess);

            dtInout          = BUS_SanXuat.GetInout(ad_org_id, dateEdit1.DateTime.Date.ToString("yyyy-MM-dd"), dateEdit2.DateTime.Date.ToString("yyyy-MM-dd"));
            dtTypename       = BUS_SanXuat.LoadTypename();
            dtPartname       = BUS_SanXuat.LoadPartname();
            dtRecentTypePart = BUS_SanXuat.LoadRecentTypePart(ad_org_id);
            dtDocument       = BUS_SanXuat.LoadDocumenttype();
        }
Exemplo n.º 13
0
        private void frmDieuChuyen_Load(object sender, EventArgs e)
        {
            grdDieuchuyen.DataSource = lstNhanVien;

            #region Xử lý lookupEdit
            DataTable lstBoPhan = BUS_BoPhan.LoadBoPhan(dtBoPhan);

            lkBoPhan.Properties.DataSource    = lstBoPhan;
            lkBoPhan.Properties.DisplayMember = "description";
            lkBoPhan.Properties.ValueMember   = "id";
            lkBoPhan.Properties.NullText      = "Chọn bộ phận";
            lkBoPhan.EditValue = lstBoPhan.Rows[0][0];

            lkBoPhan.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkBoPhan.Properties.DropDownRows = lstBoPhan.Rows.Count;
            //lkInput.Properties.ReadOnly = true;
            #endregion
        }
Exemplo n.º 14
0
        public frmQtyReport(string ad_user_id, string ad_org_id, DataTable dtProcess)
        {
            InitializeComponent();
            dateEdit.DateTime  = DateTime.Now;
            dateEdit1.DateTime = DateTime.Now;
            this.ad_user_id    = ad_user_id;
            this.ad_org_id     = ad_org_id;
            this.dtProcess     = dtProcess;
            dtboPhan           = BUS_BoPhan.LoadBoPhan(ad_org_id);
            utility.SearchProcess(this.Controls, dtProcess);

            dateEdit.DateTime  = DateTime.Now;
            dateEdit1.DateTime = DateTime.Now;
            dateEdit2.DateTime = DateTime.Now;

            #region Chart control 1
            // Create an empty Bar series and add it to the chart.
            chartControl1.Series.Add(series1);
            series1.View.Color = Color.Green;

            chartControl1.Series.Add(series2);
            series2.View.Color = Color.DarkGoldenrod;

            chartControl1.Series.Add(series3);
            series3.View.Color = Color.Red;

            //Show point view lable and customize it
            chartControl1.Series["Sản lượng mục tiêu"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label1 = chartControl1.Series["Sản lượng mục tiêu"].Label as SideBySideBarSeriesLabel;
            if (label1 != null)
            {
                label1.Position = BarSeriesLabelPosition.Top;
            }

            chartControl1.Series["Sản lượng thực tế"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label2 = chartControl1.Series["Sản lượng thực tế"].Label as SideBySideBarSeriesLabel;
            if (label2 != null)
            {
                label2.Position = BarSeriesLabelPosition.Top;
            }

            chartControl1.Series["Tỉ lệ đạt mục tiêu(%)"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label3 = chartControl1.Series["Tỉ lệ đạt mục tiêu(%)"].Label as SideBySideBarSeriesLabel;
            if (label3 != null)
            {
                label3.Position = BarSeriesLabelPosition.Top;
            }

            // Cast Diagram to the XYDiagram type.
            XYDiagram diagram = chartControl1.Diagram as XYDiagram;
            diagram.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            diagram.AxisY.Title.Text       = "Sản lượng (k)";
            diagram.AxisY.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);

            // Add a title to the chart (if necessary).
            chartTitle1.Text = "BIỂU ĐỒ SẢN LƯỢNG HẰNG NGÀY\n(" + DateTime.Now.ToString("dd/MM/yyyy") + ")";
            chartTitle1.Font = new Font("Times New Roman", 15, FontStyle.Bold);
            chartControl1.Titles.Add(chartTitle1);

            // Control legend & position
            chartControl1.Legend.Visibility          = DevExpress.Utils.DefaultBoolean.True;
            chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
            chartControl1.Legend.AlignmentVertical   = LegendAlignmentVertical.BottomOutside;
            chartControl1.Legend.Direction           = LegendDirection.LeftToRight;
            chartControl1.Legend.EquallySpacedItems  = true;

            //Create secondary Y-Axis, and add them to the chart's diagram
            SecondaryAxisY myAxisY = new SecondaryAxisY("Y-Axis");
            ((XYDiagram)chartControl1.Diagram).SecondaryAxesY.Add(myAxisY);

            //Assign series3 to the created axis
            ((LineSeriesView)series3.View).AxisY = myAxisY;

            //Customize the apperance of the secondary axis
            myAxisY.Title.Text       = "Tỉ lệ đạt mục tiêu(%)";
            myAxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            myAxisY.Title.TextColor  = Color.Red;
            myAxisY.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);
            myAxisY.Label.TextColor  = Color.Red;
            myAxisY.Color            = Color.Red;
            #endregion

            #region Chart control 2
            // Create an empty Bar series and add it to the chart.
            chartControl2.Series.Add(series4);
            series4.View.Color = Color.Green;

            chartControl2.Series.Add(series5);
            series5.View.Color = Color.DarkGoldenrod;

            chartControl2.Series.Add(series6);
            series6.View.Color = Color.Red;

            //Show point view lable and customize it
            chartControl2.Series["Sản lượng mục tiêu"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label4 = chartControl2.Series["Sản lượng mục tiêu"].Label as SideBySideBarSeriesLabel;
            if (label4 != null)
            {
                label4.Position = BarSeriesLabelPosition.Top;
            }

            chartControl2.Series["Sản lượng thực tế"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label5 = chartControl2.Series["Sản lượng thực tế"].Label as SideBySideBarSeriesLabel;
            if (label5 != null)
            {
                label5.Position = BarSeriesLabelPosition.Top;
            }

            //chartControl2.Series["Tỉ lệ đạt mục tiêu(%)"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            //SideBySideBarSeriesLabel label6 = chartControl2.Series["Tỉ lệ đạt mục tiêu(%)"].Label as SideBySideBarSeriesLabel;
            //if (label6 != null)
            //{
            //    label6.Position = BarSeriesLabelPosition.Top;
            //}

            // Cast Diagram to the XYDiagram type.
            XYDiagram diagram2 = chartControl2.Diagram as XYDiagram;
            diagram2.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            diagram2.AxisY.Title.Text       = "Sản lượng (k)";
            diagram2.AxisY.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);

            // Add a title to the chart (if necessary).
            chartTitle2.Text = "BIỂU ĐỒ SẢN LƯỢNG HẰNG THÁNG\n(" + "01/" + DateTime.Now.ToString("MM/yyyy") + " - " + DateTime.Now.ToString("dd/MM/yyyy") + ")";
            chartTitle2.Font = new Font("Times New Roman", 15, FontStyle.Bold);
            chartControl2.Titles.Add(chartTitle2);

            // Control legend & position
            chartControl2.Legend.Visibility          = DevExpress.Utils.DefaultBoolean.True;
            chartControl2.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
            chartControl2.Legend.AlignmentVertical   = LegendAlignmentVertical.BottomOutside;
            chartControl2.Legend.Direction           = LegendDirection.LeftToRight;
            chartControl2.Legend.EquallySpacedItems  = true;

            //Create secondary Y-Axis, and add them to the chart's diagram
            SecondaryAxisY myAxisY2 = new SecondaryAxisY("Y-Axis2");
            ((XYDiagram)chartControl2.Diagram).SecondaryAxesY.Add(myAxisY2);

            //Assign series3 to the created axis
            ((LineSeriesView)series6.View).AxisY = myAxisY2;

            //Customize the apperance of the secondary axis
            myAxisY2.Title.Text       = "Tỉ lệ đạt mục tiêu(%)";
            myAxisY2.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            myAxisY2.Title.TextColor  = Color.Red;
            myAxisY2.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);
            myAxisY2.Label.TextColor  = Color.Red;
            myAxisY2.Color            = Color.Red;
            #endregion

            dtChart1 = BUS_SanXuat.ChartQtyDaily(DateTime.Now.ToString("yyyy-MM-dd"), ad_org_id);
            DateTime today     = DateTime.Today;
            DateTime yesterday = today.AddDays(-1);
            lblQtyNgay.Text = "Sản lượng ngày trước (k): " + BUS_SanXuat.ChartQtyTotal(yesterday.ToString("yyyy-MM-dd"), yesterday.ToString("yyyy-MM-dd"), ad_org_id);
            CreateChart1(dtChart1);

            dtChart2 = BUS_SanXuat.ChartQtyMonthly(DateTime.Now.ToString("yyyy-MM-") + "01", DateTime.Now.ToString("yyyy-MM-dd"), ad_org_id);
            DateTime currentMonth = DateTime.Today;
            DateTime lastMonth    = currentMonth.AddMonths(-1);
            lblQtyMonth.Text = "Sản lượng tháng trước (k): " + BUS_SanXuat.ChartQtyTotal(lastMonth.ToString("yyyy-MM-") + "01", lastMonth.ToString("yyyy-MM-") + "31", ad_org_id);
            CreateChart2(dtChart2);
        }
Exemplo n.º 15
0
        private void frmKTPhanCa_Load(object sender, EventArgs e)
        {
            #region Xử lý lookupEdit
            dtboPhan = BUS_BoPhan.LoadBoPhan(ad_org_id);

            lkBoPhan.Properties.DataSource    = dtboPhan;
            lkBoPhan.Properties.DisplayMember = "description";
            lkBoPhan.Properties.ValueMember   = "id";
            lkBoPhan.Properties.NullText      = "Chọn bộ phận";
            lkBoPhan.EditValue = dtboPhan.Rows[0][0];

            lkBoPhan.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkBoPhan.Properties.DropDownRows = dtboPhan.Rows.Count;
            //lkInput.Properties.ReadOnly = true

            //List<DTO_Ca> lstCa = new List<DTO_Ca>();
            DataTable dtCa = BUS_Ca.LoadCa();


            lkShift.Properties.DataSource    = dtCa;
            lkShift.Properties.DisplayMember = "name";
            lkShift.Properties.ValueMember   = "id";
            lkShift.Properties.NullText      = "Chọn ca làm việc";
            //lkShift.EditValue = dtCa.Rows[0][0];

            lkShift.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkShift.Properties.DropDownRows = dtCa.Rows.Count;
            //lkInput.Properties.ReadOnly = true;
            #endregion

            radioGroup.SelectedIndex = 0;
            groupBox2.Enabled        = false;
            groupBox3.Enabled        = false;
            Reset.Enabled            = false;
            dateEdit.EditValue       = DateTime.Now.Date;
            dateEdit1.EditValue      = DateTime.Now.Date;
            #region Redundance

            /*
             * //List<DTO_Ca> lstCa = new List<DTO_Ca>();
             * DataTable dtCa = BUS_Ca.LoadCa();
             *
             *
             * lkShift.Properties.DataSource = dtCa;
             * lkShift.Properties.DisplayMember = "name";
             * lkShift.Properties.ValueMember = "id";
             * lkShift.Properties.NullText = "Chọn ca làm việc";
             * lkShift.EditValue = dtCa.Rows[0][0];
             *
             * lkShift.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
             * // Specify the dropdown height.
             * lkShift.Properties.DropDownRows = dtCa.Rows.Count;
             * //lkInput.Properties.ReadOnly = true;
             #endregion
             * radioGroup.SelectedIndex = 0;
             *
             * int i = Convert.ToInt16(user_level_id);
             * if (i > 1)
             * {
             *  btnUpdate.Enabled = true;
             * }
             * else
             * {
             *  btnUpdate.Enabled = false;
             * }
             */
            #endregion
        }
Exemplo n.º 16
0
        public frmAttReport(string ad_user_id, string ad_org_id, DataTable dtProcess)
        {
            InitializeComponent();
            dateEdit.DateTime  = DateTime.Now;
            dateEdit1.DateTime = DateTime.Now;
            this.ad_user_id    = ad_user_id;
            this.ad_org_id     = ad_org_id;
            this.dtProcess     = dtProcess;
            dtCa     = BUS_Ca.LoadCaShift(DateTime.Now.Date, ad_org_id);
            dtboPhan = BUS_BoPhan.LoadBoPhan(ad_org_id);
            utility.SearchProcess(this.Controls, dtProcess);

            #region Chart control 1
            // Create an empty Bar series and add it to the chart.
            chartControl1.Series.Add(series1);
            series1.View.Color = Color.Green;

            chartControl1.Series.Add(series2);
            series2.View.Color = Color.DarkGoldenrod;

            chartControl1.Series.Add(series3);
            series3.View.Color = Color.Red;

            chartControl1.Series.Add(series4);
            series4.View.Color = Color.Red;

            //Show point view lable and customize it
            chartControl1.Series["Tổng số người"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label1 = chartControl1.Series["Tổng số người"].Label as SideBySideBarSeriesLabel;
            if (label1 != null)
            {
                label1.Position = BarSeriesLabelPosition.Top;
            }

            chartControl1.Series["Số người vắng"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label2 = chartControl1.Series["Số người vắng"].Label as SideBySideBarSeriesLabel;
            if (label2 != null)
            {
                label2.Position = BarSeriesLabelPosition.Top;
            }

            chartControl1.Series["Số người nghỉ việc"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label3 = chartControl1.Series["Số người nghỉ việc"].Label as SideBySideBarSeriesLabel;
            if (label3 != null)
            {
                label3.Position = BarSeriesLabelPosition.Top;
            }

            chartControl1.Series["Tỉ lệ người vắng(%)"].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            SideBySideBarSeriesLabel label4 = chartControl1.Series["Tỉ lệ người vắng(%)"].Label as SideBySideBarSeriesLabel;
            if (label4 != null)
            {
                label4.Position = BarSeriesLabelPosition.Top;
            }

            // Cast Diagram to the XYDiagram type.
            XYDiagram diagram = chartControl1.Diagram as XYDiagram;
            diagram.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            diagram.AxisY.Title.Text       = "Số lượng người";
            diagram.AxisY.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);

            // Add a title to the chart (if necessary).
            chartTitle1.Text = "BIỂU ĐỒ NHÂN SỰ\n(" + "01" + DateTime.Now.ToString("/MM/yyyy") + " - " + DateTime.Now.ToString("dd/MM/yyyy") + ")";
            chartTitle1.Font = new Font("Times New Roman", 15, FontStyle.Bold);
            chartControl1.Titles.Add(chartTitle1);

            // Control legend & position
            chartControl1.Legend.Visibility          = DevExpress.Utils.DefaultBoolean.True;
            chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
            chartControl1.Legend.AlignmentVertical   = LegendAlignmentVertical.BottomOutside;
            chartControl1.Legend.Direction           = LegendDirection.LeftToRight;
            chartControl1.Legend.EquallySpacedItems  = true;

            //Create secondary Y-Axis, and add them to the chart's diagram
            SecondaryAxisY myAxisY2 = new SecondaryAxisY("Y-Axis2");
            ((XYDiagram)chartControl1.Diagram).SecondaryAxesY.Add(myAxisY2);

            //Assign series4 to the created axis
            ((LineSeriesView)series4.View).AxisY = myAxisY2;

            //Customize the apperance of the secondary axis
            myAxisY2.Title.Text       = "Tỉ lệ người vắng(%)";
            myAxisY2.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            myAxisY2.Title.TextColor  = Color.Red;
            myAxisY2.Title.Font       = new Font("Times New Roman", 10, FontStyle.Regular);
            myAxisY2.Label.TextColor  = Color.Red;
            myAxisY2.Color            = Color.Red;
            #endregion

            #region Chart control 2
            // Add a title to the chart (if necessary).
            chartControl2.Titles.Clear();
            chartTitle2.Text = "BIỂU ĐỒ TỈ LỆ NGƯỜI VẮNG\n(" + "01" + DateTime.Now.ToString("/MM/yyyy") + " - " + DateTime.Now.ToString("dd/MM/yyyy") + ")";
            chartTitle2.Font = new Font("Times New Roman", 15, FontStyle.Bold);
            chartControl2.Titles.Add(chartTitle2);


            #endregion
            dtChart1 = BUS_ChamCong.ChartDiemDanh(DateTime.Now.ToString("yyyy-MM-") + "01", DateTime.Now.ToString("yyyy-MM-dd"), ad_org_id, "0");
            dtChart2 = Utility.CopyChart(dtChart1, "01", DateTime.Now.ToString("dd"));
            CreateChart(dtChart1, dtChart2);
        }