/// <summary>
        /// name: Linh
        /// content: Load du lieu cong viec cho cac cot trong bieu do cot
        /// </summary>
        private void LoadChart()
        {
            List <eCongViec> listTong         = _congViec.GetManyItemByCondition(x => x.NgayBatDau.Month == DateTime.Now.Month || x.NgayKetThuc.Month == DateTime.Now.Month);
            List <eCongViec> listDangThucHien = _congViec.GetManyItemByCondition(x => (x.NgayBatDau.Month == DateTime.Now.Month || x.NgayKetThuc.Month == DateTime.Now.Month) && x.TrangThai.Equals("Đang thực hiện"));
            List <eCongViec> listChuaThucHien = _congViec.GetManyItemByCondition(x => (x.NgayBatDau.Month == DateTime.Now.Month || x.NgayKetThuc.Month == DateTime.Now.Month) && x.TrangThai.Equals("Chưa thực hiện"));
            List <eCongViec> listHoanThanh    = _congViec.GetManyItemByCondition(x => (x.NgayBatDau.Month == DateTime.Now.Month || x.NgayKetThuc.Month == DateTime.Now.Month) && x.TrangThai.Equals("Hoàn thành"));

            this.chartCongViec.Series["Công việc (30-30 ngày)"].Points.AddXY("Tổng", listTong.Count);
            this.chartCongViec.Series["Công việc (30-30 ngày)"].Points.AddXY("Đang thực hiện", listDangThucHien.Count);
            this.chartCongViec.Series["Công việc (30-30 ngày)"].Points.AddXY("Chưa thực hiện", listChuaThucHien.Count);
            this.chartCongViec.Series["Công việc (30-30 ngày)"].Points.AddXY("Hoàn thành", listHoanThanh.Count);
        }
Ejemplo n.º 2
0
 private void dgv_duAn_SelectionChanged(object sender, EventArgs e)
 {
     if (dgv_duAn.CurrentRow != null)
     {
         int rowindex = dgv_duAn.CurrentRow.Index;
         if (rowindex >= 0)
         {
             DataGridViewRow  row    = dgv_duAn.Rows[rowindex];
             string           maDuAn = row.Cells[0].Value.ToString();
             BUSCongViec      cv     = new BUSCongViec();
             List <eCongViec> list   = cv.GetManyItemByCondition(x => x.DuAn.MaDuAn == maDuAn);
             dgv_congViec.DataSource = list;
             LoadDgvCongViec();
             lbl_tenDuAn.Text      = row.Cells[1].Value.ToString();
             lbl_ngayThangNam.Text = row.Cells[2].Value.ToString() + "-" + row.Cells[3].Value.ToString();
             lbl_trangThai.Text    = "Trạng thái: " + row.Cells[5].Value.ToString();
         }
     }
 }
Ejemplo n.º 3
0
        private void btnChon_Click(object sender, EventArgs e)
        {
            string maCongViec = txtMaCongViec.Text.Trim();

            string[] arrDuAn     = cboDuAn.Text.Split('-');
            string   tenCongViec = txtTenCongViec.Text;
            DateTime ngayBatDau  = DateTime.Parse(dtmNgayBatDau.Value.ToString("yyyy/MM/dd"));
            DateTime ngayKetThuc = DateTime.Parse(dtmNgayKetThuc.Value.ToString("yyyy/MM/dd"));

            if (maCongViec != string.Empty && btnMaCongViec.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.MaCongViec == maCongViec).ToList();
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
            else if (btnMaCongViec.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                lblThongBao.Text = "Nhập mã công việc cần tìm.";
            }
            if (tenCongViec != string.Empty && btnTenCongViec.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.TenCongViec == tenCongViec);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
            else if (btnTenCongViec.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                lblThongBao.Text = "Nhập tên công việc cần tìm.";
            }
            if (cboTrangThai.SelectedItem != null && btnTrangThai.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.TrangThai == cboTrangThai.Text);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
            else if (btnTrangThai.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                lblThongBao.Text = "Chọn trạng thái công việc cần tìm.";
            }

            if (nudTienDoCongViec.Value >= 0 && nudTienDoCongViec.Value <= 100 && btnTienDoCongViec.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.Tiendo == nudTienDoCongViec.Value);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
            if (ngayBatDau != null && btnNgayBatDau.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.NgayBatDau == ngayBatDau);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }

            if (ngayKetThuc != null && btnNgayKetThuc.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.NgayKetThuc == ngayKetThuc);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }

            if (cboDuAn.SelectedItem != null && btnDuAn.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.DuAn.MaDuAn == arrDuAn[0].Trim());
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
            else if (btnDuAn.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                lblThongBao.Text = "Chọn dự án của công việc cần tìm.";
            }

            if (cboDuAn.SelectedItem != null && cboTrangThai.SelectedItem != null && nudTienDoCongViec.Value >= 0 && ngayBatDau != null && dtmNgayKetThuc != null && btnTimKiem.Normalcolor == Color.FromArgb(39, 99, 109))
            {
                List <eCongViec> listCongViec = _congViec.GetManyItemByCondition(x => x.DuAn.MaDuAn == arrDuAn[0].Trim() && x.TrangThai == cboTrangThai.Text && x.Tiendo >= nudTienDoCongViec.Value && x.NgayBatDau >= ngayBatDau && x.NgayKetThuc <= ngayKetThuc);
                if (listCongViec.Count > 0)
                {
                    searchCongViec(listCongViec);
                }
                else
                {
                    lblThongBao.Text = "Không tìm thấy công việc yêu cầu.";
                }
            }
        }