public void GetAllEmployee()
        {
            var q = EmpCmd.GetAll();
            ReportDataSource rs = new ReportDataSource();
            List <EmpObj>    ls = new List <EmpObj>();
            int counter         = 0;

            foreach (var item in q)
            {
                counter++;
                ls.Add(new EmpObj()
                {
                    id       = counter,
                    empname  = item.EmpName,
                    empNo    = item.EmpNo,
                    start    = DateTime.Parse(item.StartTime.ToString()),
                    end      = DateTime.Parse(item.EndTime.ToString()),
                    worktime = float.Parse(item.WorkTimeNo.ToString()),
                });
            }
            rs.Name  = "DataSet1";
            rs.Value = ls;
            ReportFrm frm = new ReportFrm();

            frm.reportViewer1.LocalReport.DataSources.Clear();
            frm.reportViewer1.LocalReport.DataSources.Add(rs);
            frm.reportViewer1.LocalReport.ReportEmbeddedResource = "PcdcrSystem.Report.EmpReport.rdlc";
            frm.ShowDialog();
        }
        public void GetRptCollectionByDateAndID(DateTime date1, DateTime date2)
        {
            var q = EmpCmd.GetAll();
            ReportDataSource rs = new ReportDataSource();
            List <MonthyObj> ls = new List <MonthyObj>();

            foreach (var item in q)
            {
                ls.Add(new MonthyObj()
                {
                    id           = item.Id,
                    EmpName      = item.EmpName,
                    empNo        = item.EmpNo,
                    TotalDays    = WorkCmd.GetTotalCountDayWork(date1, date2, item.Id),
                    HoldyDays    = WorkCmd.GetTotalCountDayHolady(date1, date2, item.Id),
                    WorkHouer    = WorkCmd.GetTotalWorkTime(date1, date2, item.Id),
                    RealWorkHour = WorkCmd.GetTotalRealWork(date1, date2, item.Id),
                    Defernce     = WorkCmd.GetTotalDefrncMonth(date1, date2, item.Id),
                });
            }

            rs.Name  = "DataSet1";
            rs.Value = ls;
            ReportFrm frm = new ReportFrm();

            frm.reportViewer1.LocalReport.DataSources.Clear();
            frm.reportViewer1.LocalReport.DataSources.Add(rs);
            frm.reportViewer1.LocalReport.ReportEmbeddedResource = "PcdcrSystem.Report.MonthlyReport.rdlc";

            frm.ShowDialog();
        }
Beispiel #3
0
        private void fillcombo()
        {
            this.EmpComboBox.MultiColumnComboBoxElement.DropDownWidth = 500;
            this.EmpComboBox.ValueMember   = "Id";
            this.EmpComboBox.DisplayMember = "EmpName";
            EmpComboBox.DataSource         = EmpCmd.GetAll();
            this.EmpComboBox.AutoFilter    = true;
            CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor();
            FilterDescriptor          empname         = new FilterDescriptor("EmpName", FilterOperator.Contains, "");
            FilterDescriptor          empNumber       = new FilterDescriptor("EmpNo", FilterOperator.Contains, "");

            compositeFilter.FilterDescriptors.Add(empname);
            compositeFilter.FilterDescriptors.Add(empNumber);
            compositeFilter.LogicalOperator = FilterLogicalOperator.Or;

            this.EmpComboBox.EditorControl.FilterDescriptors.Add(compositeFilter);
        }
Beispiel #4
0
 private void ManagEmpfrm_Load(object sender, EventArgs e)
 {
     EmpGridView.DataSource = EmpCmd.GetAll();
 }