private void LoadBaoCao()
        {
            WaitDialogForm wait = new DevExpress.Utils.WaitDialogForm("Phần mềm đang tải dữ liệu....", "Vui lòng chờ");

            try
            {
                wait.Show();
                DateTime TuNgay  = dateTuNgay.DateTime;
                DateTime DenNgay = dateDenNgay.DateTime;
                int      ID_User = 0;
                ID_User = luedNhanVien.EditValue != null?int.Parse(luedNhanVien.EditValue.ToString()) : 0;

                List <BaoCaoChiTietGhimOBJ> list = Retrofit.instance.BaoCaoChiTietGhim(TuNgay, DenNgay, ID_User);
                gc.DataSource = list;
            }
            catch (Exception ex)
            {
                lg.Error(ex);
                MessageBox.Show("Có lỗi xảy ra vui lòng liên hệ quản trị viên", "Thông báo");
                wait.Close();
            }
            finally
            {
                wait.Close();
            }
        }
Example #2
0
        private void LoadBaoCao()
        {
            WaitDialogForm wait = new DevExpress.Utils.WaitDialogForm("Phần mềm đang tải dữ liệu....", "Vui lòng chờ");

            try
            {
                wait.Show();
                DateTime TuNgay  = dateTuNgay.DateTime;
                DateTime DenNgay = dateDenNgay.DateTime;
                int      ID_User = 0;
                ID_User = luedNhanVien.EditValue != null?int.Parse(luedNhanVien.EditValue.ToString()) : 0;

                int ID_LoaiGhim = 0;
                ID_LoaiGhim = luedLoaiGhim.EditValue != null?int.Parse(luedLoaiGhim.EditValue.ToString()) : 0;

                List <BaoCaoTongHopGhim> list = Retrofit.instance.BaoCaoTongHopGhim(TuNgay, DenNgay, ID_User, ID_LoaiGhim);
                gc.DataSource = list;
            }
            catch (Exception ex)
            {
                lg.Error(ex);
                wait.Close();
            }
            finally
            {
                wait.Close();
            }
        }
Example #3
0
        private void lueDuAn_EditValueChanged_1(object sender, EventArgs e)
        {
            WaitDialogForm wait = new DevExpress.Utils.WaitDialogForm("Phần mềm đang tải dữ liệu....", "Vui lòng chờ");

            try
            {
                wait.Show();
                //Phải cho khác null vào vì có lúc người dùng nó không chọn dự án đỡ mất công gửi lên sever
                //Sau này muốn nếu null mà load toàn bộ dự án thì làm vào phần else là được
                if (lueDuAn.EditValue != null)
                {
                    string id = lueDuAn.EditValue.ToString();
                    LoadWork(id);
                }
            }
            catch (Exception ex)
            {
                lg.Error(ex);
                wait.Close();
            }
            finally
            {
                wait.Close();
            }
        }
Example #4
0
        private void LoadBieuDoTheoDTV()
        {
            WaitDialogForm wait = new DevExpress.Utils.WaitDialogForm("Phần mềm đang tải dữ liệu....", "Vui lòng chờ");

            try
            {
                wait.Show();
                listGhim = Retrofit.instance.Ghim(deTuNgay.DateTime, deDenNgay.DateTime);
                chartBieuDo.Series.Clear();
                chartBieuDo.Titles.Clear();
                chartBieuDo.DataSource = listGhim;
                // Create four side-by-side stacked bar series.
                Series series1 = new Series("Ghim", ViewType.StackedBar);
                for (int i = 0; i < listGhim.Count; i++)
                {
                    series1.Points.Add(new SeriesPoint(listGhim[i].Name, listGhim[i].SoGhim));
                }
                // Add all series to the chart.
                chartBieuDo.Series.AddRange(new Series[] { series1, });
                // Access the type-specific options of the diagram.
                if (listGhim.Count > 0)
                {
                    // Access the view-type-specific options of the series.
                    ((StackedBarSeriesView)series1.View).BarWidth = 0.8;

                    // Access the type-specific options of the diagram.
                    ((XYDiagram)chartBieuDo.Diagram).EnableAxisXZooming = true;
                }


                // Hide the legend (if necessary).
                chartBieuDo.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;

                // Add a title to the chart (if necessary).
                chartBieuDo.Titles.Add(new ChartTitle());
                chartBieuDo.Titles[0].Text     = "";
                chartBieuDo.Titles[0].WordWrap = true;

                //Add the chart to the form.
                chartBieuDo.Dock = DockStyle.Fill;
            }
            catch (Exception ex)
            {
                lg.Error(ex);
                wait.Close();
            }
            finally
            {
                wait.Close();
            }
        }
Example #5
0
        private void LoadWork(string id)
        {
            WaitDialogForm wait = new DevExpress.Utils.WaitDialogForm("Phần mềm đang tải dữ liệu....", "Vui lòng chờ");

            try
            {
                wait.Show();
                List <WorkV2> works = Retrofit.instance.getAllWork(id);
                gridControl1.DataSource = works;
            }
            catch (Exception ex)
            {
                lg.Error(ex);
                wait.Close();
            }
            finally
            {
                wait.Close();
            }
        }
        private void addNewTarget_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
            {
                _waitForm.Show();
                _waitForm.Caption = "正在计算特征值...";

                var img = OpenCvSharp.IplImage.FromFile(openFileDialog1.FileName);
                var fs  = new FaceProcessingWrapper.FaceSpecification();
                var suc = _faceComparer.CalcFeature(img, fs);
                _waitForm.Hide();
                if (!suc)
                {
                    _messageBoxService.ShowError("人像不满足比对要求,请重新选择人像。");
                    return;
                }

                var target = new TargetPerson(_uow);
                target.EyeBrowShape  = fs.EyebrowShape;
                target.EyebrowRatio  = fs.EyebrowRatio;
                target.FeaturePoints = fs.Features;
                var path = System.IO.Path.Combine(Properties.Settings.Default.OutputPath,
                                                  @"TargetFeature\" + Guid.NewGuid() + ".txt");
                var dir = Path.GetDirectoryName(path);
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
                target.FeatureFilePath = path;
                var imgPath = path.Replace(".txt", ".jpg");
                img.SaveImage(imgPath);
                target.ImagePath = imgPath;

                var item = AddGalleryItem(img.ToBitmap());
                item.Tag = target;
                _isDirty = true;
            }
        }