/// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件对象</param>
 /// <param name="e">事件参数</param>
 private void BtnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewResult.Stop();
         this.Cursor = Cursors.WaitCursor;
         DateTime  bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
         DateTime  edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
         int       queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("GetFinacialDispenseData", frmName, bdate, edate, queryWorkId);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("Title", cmbWorker.Text.Trim() + "发药人员工作量统计");
         myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
         myDictionary.Add("Printer", currentUserName);
         GridReport gridreport = new GridReport();
         gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4019, 0, myDictionary, dtReport);
         GridViewResult.Report = gridreport.Report;
         GridViewResult.Start();
         GridViewResult.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #2
0
        /// <summary>
        /// 绑定报表数据
        /// </summary>
        /// <param name="dt">数据源</param>
        public void BindGridData(DataTable dt)
        {
            PrintDt = dt;
            DateTime dtTemp = Convert.ToDateTime(dtYearMonth.Text + "-01");
            //本月第一天时间
            DateTime dtFirst = dtTemp.AddDays(-(dtTemp.Day) + 1);

            //将本月月数+1
            DateTime dt2 = dtTemp.AddMonths(1);

            //本月最后一天时间
            DateTime dtLast          = dt2.AddDays(-(dtTemp.Day));
            string   currentUserName = (string)InvokeController("GetCurrentUserName");
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("开始时间", dtFirst);
            myDictionary.Add("结束时间", dtLast);
            myDictionary.Add("科室", CmbDeptRoom.Text);
            myDictionary.Add("查询人", currentUserName);
            myDictionary.Add("查询时间", DateTime.Now);
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4028, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
Example #3
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender">控件对象</param>
 /// <param name="e">事件参数</param>
 private void BtnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewResult.Stop();
         this.Cursor = Cursors.WaitCursor;
         DateTime  bdate           = dtTimer.Bdate.Value;
         DateTime  edate           = dtTimer.Edate.Value;
         int       queryWorkId     = Convert.ToInt32(cbbWork.SelectedValue);
         string    queryTimeType   = Convert.ToString(cbbTimeType.SelectedValue);
         string    qyeryDocType    = Convert.ToString(cbbDocType.SelectedValue);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("QueryInpatientWorkLoad", queryWorkId, bdate.ToString("yyyy-MM-dd 00:00:00"), edate.ToString("yyyy-MM-dd 23:59:59"), qyeryDocType, queryTimeType);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("Title", cbbWork.Text.Trim() + "住院医生工作量统计");
         myDictionary.Add("DateRange", dtTimer.Bdate.Value.ToString("yyyy-MM-dd") + "至" + dtTimer.Edate.Value.ToString("yyyy-MM-dd"));
         myDictionary.Add("Printer", currentUserName);
         myDictionary.Add("DocType", "医生类型:" + cbbDocType.Text);
         myDictionary.Add("TimeType", "时间类型:" + cbbTimeType.Text);
         GridReport gridreport = new GridReport();
         gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3011, 0, myDictionary, dtReport);
         GridViewResult.Report = gridreport.Report;
         GridViewResult.Start();
         GridViewResult.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #4
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            switch (cmbReportType.Text)
            {
            case "Grid":
                GridReport gR = new GridReport();
                gR.setVars(cmbGroupBy.Text, cmbSY.Text);
                gR.Show();
                break;

            case "Bar Chart":
                BarChart bC = new BarChart();
                bC.setVars(cmbGroupBy.Text, cmbSY.Text);
                bC.Show();
                break;

            case "Line Chart":
                LineChart lC = new LineChart();
                lC.setVars(cmbGroupBy.Text, cmbSY.Text);
                lC.Show();
                break;

            case "Pie Chart":
                PieChart pC = new PieChart();
                pC.setVars(cmbGroupBy.Text, cmbSY.Text);
                pC.Show();
                break;
            }
        }
Example #5
0
    private void DashBoardReportGrid(string RepCondition)
    {
        try
        {
            DS = Obj_Call.GetDashBoard(RepCondition, out StrError);

            if (DS.Tables.Count > 0)
            {
                if (DS.Tables[0].Rows.Count > 0)
                {
                    GridReport.DataSource = DS.Tables[0];
                    GridReport.DataBind();
                }
                if (DS.Tables[1].Rows.Count > 0)
                {
                    GridReport1.DataSource = DS.Tables[1];
                    GridReport1.DataBind();
                }
                //if (DS.Tables[2].Rows.Count > 0)
                //{
                //    GridReport2.DataSource = DS.Tables[2];
                //    GridReport2.DataBind();
                //}
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
 /// <summary>
 /// 事件
 /// </summary>
 /// <param name="sender">对象</param>
 /// <param name="e">参数</param>
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         axGRDisplayViewer.Stop();
         this.Cursor = Cursors.WaitCursor;
         int       queryYear       = Convert.ToInt32(cmbQueryYear.SelectedValue);
         int       queryMonth      = Convert.ToInt32(cmbQueryMonth.SelectedValue);
         int       deptId          = Convert.ToInt32(cmbDept.SelectedValue);
         int       typeId          = Convert.ToInt32(cmbQueryType.SelectedValue);
         string    currentUserName = (string)InvokeController("GetCurrentUserName");
         DataTable dtReport        = (DataTable)InvokeController("InventoryStatistic", frmName, deptId, queryYear, queryMonth, typeId);
         Dictionary <string, object> myDictionary = new Dictionary <string, object>();
         myDictionary.Add("会计年", cmbQueryYear.Text);
         myDictionary.Add("会计月", cmbQueryMonth.Text);
         myDictionary.Add("查询科室", cmbDept.Text);
         myDictionary.Add("类型", cmbQueryType.Text);
         myDictionary.Add("查询人", currentUserName);
         myDictionary.Add("HospitalName", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName + "药品进销存报表");
         GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4016, 0, myDictionary, dtReport);
         axGRDisplayViewer.Report = gridreport.Report;
         axGRDisplayViewer.Start();
         axGRDisplayViewer.Refresh();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #7
0
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     switch (cmbReportType.Text)
     {
         case "Grid":
             GridReport gR = new GridReport();
             gR.setVars(cmbGroupBy.Text, cmbSY.Text);
             gR.Show();
             break;
         case "Bar Chart":
             BarChart bC = new BarChart();
             bC.setVars(cmbGroupBy.Text, cmbSY.Text);
             bC.Show();
             break;
         case "Line Chart":
             LineChart lC = new LineChart();
             lC.setVars(cmbGroupBy.Text, cmbSY.Text);
             lC.Show();
             break;
         case "Pie Chart":
             PieChart pC = new PieChart();
             pC.setVars(cmbGroupBy.Text, cmbSY.Text);
             pC.Show();
             break;
     }
 }
Example #8
0
        private CompactionReportResult ConvertTRexGridResult(CompactionReportGridRequest request, Stream stream)
        {
            log.LogDebug($"{nameof(ConvertTRexGridResult)}: Retrieving response data from TRex");

            var griddedReportResult = new GriddedReportResult(ReportType.Gridded);

            griddedReportResult.Read((stream as MemoryStream)?.ToArray());

            var gridRows = new GridRow[griddedReportResult.GriddedData.NumberOfRows];

            // Populate an array of grid rows from the data
            for (var i = 0; i < griddedReportResult.GriddedData.NumberOfRows; i++)
            {
                gridRows[i] = GridRow.CreateRow(griddedReportResult.GriddedData.Rows[i], request);
            }

            var startTime = request.Filter != null && request.Filter.StartUtc.HasValue
        ? request.Filter.StartUtc.Value
        : DateTime.Now;
            var endTime = request.Filter != null && request.Filter.EndUtc.HasValue
        ? request.Filter.EndUtc.Value
        : DateTime.Now;

            var gridReport = GridReport.CreateGridReport(startTime, endTime, gridRows);

            return(CompactionReportResult.CreateExportDataResult(gridReport, 1));
        }
Example #9
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender">控件对象</param>
        /// <param name="e">事件参数</param>
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
                DateTime edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
                int      queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
                string   currentUserName = (string)InvokeController("GetCurrentUserName");
                int      queryType       = 0;//0收入流水账 1预交金流水账
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                if (superTabControl1.SelectedTabIndex == 0)
                {
                    GVResultRevenue.Stop();
                    this.Cursor = Cursors.WaitCursor;
                    DataTable dtReport = (DataTable)InvokeController("GetFinacialIPAccountBookData", frmName, bdate, edate, queryWorkId, queryType);

                    myDictionary.Add("Title", cmbWorker.Text.Trim() + "住院收入流水账");
                    myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
                    myDictionary.Add("Printer", currentUserName);
                    decimal[] beginEnd = GetBeginAndEnd(0, dtReport);
                    myDictionary.Add("BeginFeeTotal", beginEnd[0]);
                    myDictionary.Add("EndFeeTotal", beginEnd[1]);
                    GridReport gridreport = new GridReport();
                    gridreport             = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3012, 0, myDictionary, dtReport);
                    GVResultRevenue.Report = gridreport.Report;
                    GVResultRevenue.Start();
                    GVResultRevenue.Refresh();
                }
                else
                {
                    queryType = 1;
                    GVResultDeposit.Stop();
                    this.Cursor = Cursors.WaitCursor;
                    DataTable dtReport = (DataTable)InvokeController("GetFinacialIPAccountBookData", frmName, bdate, edate, queryWorkId, queryType);

                    myDictionary.Add("Title", cmbWorker.Text.Trim() + "住院预交金流水账");
                    myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
                    myDictionary.Add("Printer", currentUserName);
                    decimal[] beginEnd = GetBeginAndEnd(1, dtReport);
                    myDictionary.Add("BeginFeeTotal", beginEnd[0]);
                    myDictionary.Add("EndFeeTotal", beginEnd[1]);
                    GridReport gridreport = new GridReport();
                    gridreport             = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3013, 0, myDictionary, dtReport);
                    GVResultDeposit.Report = gridreport.Report;
                    GVResultDeposit.Start();
                    GVResultDeposit.Refresh();
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #10
0
 private void ChangeInitializeComponentsVisibility()
 {
     TitleLabel.Content   = "Ver reporte";
     GridTable.Visibility = Visibility.Hidden;
     GridReport.SetValue(Grid.RowProperty, 1);
     GridReport.SetValue(Grid.RowSpanProperty, 2);
     GradeReportButton.Visibility = Visibility.Collapsed;
     CancelButton.SetValue(Grid.ColumnProperty, 6);
 }
Example #11
0
        /// <summary>
        /// 获取医技确费统计信息
        /// </summary>
        /// <param name="dt">医技确费统计数据</param>
        public void BindThatFeeCount(DataTable dt)
        {
            PrintData = dt;
            Dictionary <string, object> myDictionary = GetDictionary();
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, (int)OP_Enum.PrintReport.医技工作量统计, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="dtData">统计数据</param>
        public void LoadData(DataTable dtData)
        {
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("Title", cmbWorker.Text.Trim() + "药品医生开方统计");
            myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
            myDictionary.Add("Printer", (InvokeController("this") as AbstractController).LoginUserInfo.EmpName);

            gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 6001, 0, myDictionary, dtData);
            GridViewResult.Report = gridreport.Report;
            GridViewResult.Start();
            GridViewResult.Refresh();
        }
Example #13
0
        /// <summary>
        /// 绑定药品网格信息
        /// </summary>
        /// <param name="dt">报表数据</param>
        public void BindDgData(DataTable dt)
        {
            PrintDt = dt;
            string currentUserName = (string)InvokeController("GetCurrentUserName");
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("开始时间", dtpBillDate.Bdate.Value);
            myDictionary.Add("结束时间", dtpBillDate.Edate.Value);
            myDictionary.Add("科室", DeptRoom.Text);
            myDictionary.Add("查询人", currentUserName);
            myDictionary.Add("查询时间", DateTime.Now);
            GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4018, 0, myDictionary, dt);

            axGRDisplayViewer.Report = gridreport.Report;
            axGRDisplayViewer.Start();
            axGRDisplayViewer.Refresh();
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender">控件对象</param>
        /// <param name="e">事件参数</param>
        private void BtQuery_Click(object sender, EventArgs e)
        {
            if (txtItem.Text == string.Empty)
            {
                MessageBoxEx.Show("请选择查询项目!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if ((Convert.ToInt16(cbbPatType.SelectedValue) == 1) && (Convert.ToString(cbbTimeType.SelectedValue) == "ChargeDate"))
            {
                MessageBoxEx.Show("门诊类型按记帐时间统计单项目收入!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int      workID    = Convert.ToInt32(cmbWork.SelectedValue);
            DateTime queryDate = dtTimer.Value;
            int      patType   = Convert.ToInt32(cbbPatType.SelectedValue);
            string   timeType  = Convert.ToString(cbbTimeType.SelectedValue);
            string   itemInfo  = ItemID;

            try
            {
                GridViewResult.Stop();
                this.Cursor = Cursors.WaitCursor;
                string    currentUserName = (string)InvokeController("GetCurrentUserName");
                DataTable dtReport        = (DataTable)InvokeController("GetItmeItemStatistics", workID, queryDate, patType, timeType, itemInfo);
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                myDictionary.Add("TjTime", "统计时间:" + dtTimer.Value.ToString("yyyy-MM"));
                myDictionary.Add("Printer", "制表人:" + currentUserName);
                myDictionary.Add("PrintTime", "制表时间:" + DateTime.Now.ToString("yyyy-MM-dd"));
                myDictionary.Add("ItemName", txtItem.Text);
                GridReport gridreport = new GridReport();
                gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 2009, 0, myDictionary, dtReport);
                GridViewResult.Report = gridreport.Report;
                GridViewResult.Start();
                GridViewResult.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #15
0
    private void SetInitialRowReportGrid()
    {
        DataTable dt = new DataTable();
        DataRow   dr;

        dt.Columns.Add("#", typeof(Int32));
        dt.Columns.Add("InwardNo", typeof(string));
        dt.Columns.Add("Date", typeof(string));
        dt.Columns.Add("EmpName", typeof(string));
        dr             = dt.NewRow();
        dr["#"]        = 0;
        dr["InwardNo"] = "";
        dr["Date"]     = "";
        dr["EmpName"]  = "";
        dt.Rows.Add(dr);
        ViewState["CurrentReportTable"] = dt;
        GridReport.DataSource           = dt;
        GridReport.DataBind();
    }
Example #16
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender">控件对象</param>
        /// <param name="e">事件参数</param>
        private void BtnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                GridViewResult.Stop();
                this.Cursor = Cursors.WaitCursor;
                DateTime  bdate           = Convert.ToDateTime(sdtDate.Bdate.Value.ToString("yyyy-MM-dd 00:00:00"));
                DateTime  edate           = Convert.ToDateTime(sdtDate.Edate.Value.ToString("yyyy-MM-dd 23:59:59"));
                int       queryWorkId     = Convert.ToInt32(cmbWorker.SelectedValue);
                int       queryTimeType   = cmbTimeType.SelectedIndex;//0收费时间 1缴款时间
                string    currentUserName = (string)InvokeController("GetCurrentUserName");
                DataTable dtReport        = (DataTable)InvokeController("GetFinacialOPDoctorData", frmName, bdate, edate, queryWorkId, queryTimeType);
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                myDictionary.Add("Title", cmbWorker.Text.Trim() + "门诊医生工作量统计");
                myDictionary.Add("DateRange", sdtDate.Bdate.Value.ToString("yyyy-MM-dd") + "至" + sdtDate.Edate.Value.ToString("yyyy-MM-dd"));
                myDictionary.Add("Printer", currentUserName);
                if (dtReport.Rows.Count > 0)
                {
                    decimal allDrugFee     = Convert.ToDecimal(dtReport.Compute("sum(DrugFee)", string.Empty));
                    decimal allMeterialFee = Convert.ToDecimal(dtReport.Compute("sum(MeterialFee)", string.Empty));
                    decimal allFee         = Convert.ToDecimal(dtReport.Compute("sum(TotalFee)", string.Empty));
                    myDictionary.Add("AllDrugFeePerCent", allDrugFee / allFee);
                    myDictionary.Add("AllMeterailFeePerCent", allMeterialFee / allFee);
                }

                GridReport gridreport = new GridReport();
                gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 2005, 0, myDictionary, dtReport);
                GridViewResult.Report = gridreport.Report;
                GridViewResult.Start();
                GridViewResult.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #17
0
        private CompactionReportResult ConvertGridResult(CompactionReportGridRequest request, Stream stream)
        {
            log.LogDebug($"{nameof(ConvertGridResult)}");

            // Unpack the data for the report and construct a stream containing the result
            var reportPackager = new TRaptorReportsPackager(TRaptorReportType.rrtGridReport)
            {
                ReturnCode = TRaptorReportReturnCode.rrrcUnknownError
            };

            reportPackager.GridReport.ElevationReport   = request.ReportElevation;
            reportPackager.GridReport.CutFillReport     = request.ReportCutFill;
            reportPackager.GridReport.CMVReport         = request.ReportCMV;
            reportPackager.GridReport.MDPReport         = request.ReportMDP;
            reportPackager.GridReport.PassCountReport   = request.ReportPassCount;
            reportPackager.GridReport.TemperatureReport = request.ReportTemperature;

            log.LogDebug($"{nameof(ConvertGridResult)}: Retrieving response data");

            reportPackager.ReadFromStream(stream);

            var gridRows = new GridRow[reportPackager.GridReport.NumberOfRows];

            // Populate an array of grid rows from the data
            for (var i = 0; i < reportPackager.GridReport.NumberOfRows; i++)
            {
                gridRows[i] = GridRow.CreateRow(reportPackager.GridReport.Rows[i], request);
            }

            var startTime = request.Filter != null && request.Filter.StartUtc.HasValue
        ? request.Filter.StartUtc.Value
        : DateTime.Now;
            var endTime = request.Filter != null && request.Filter.EndUtc.HasValue
        ? request.Filter.EndUtc.Value
        : DateTime.Now;

            var gridReport = GridReport.CreateGridReport(startTime, endTime, gridRows);

            return(CompactionReportResult.CreateExportDataResult(gridReport, 1));
        }
Example #18
0
        /// <summary>
        /// 绑定医嘱明细数据
        /// </summary>
        /// <param name="dtLongOrder">长期医嘱数据</param>
        /// <param name="dtTempOrder">临时医嘱数据</param>
        public void BindOrderDetail(DataTable dtLongOrder, DataTable dtTempOrder)
        {
            superTabControl1.SelectedTabIndex = 0;
            try
            {
                LongGridViewResult.Stop();
                this.Cursor = Cursors.WaitCursor;
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                int       rowindex = dgvPatInfo.CurrentCell.RowIndex;
                DataTable dt       = (DataTable)dgvPatInfo.DataSource;
                myDictionary.Add("医院名称", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName);
                myDictionary.Add("科室", dt.Rows[rowindex]["deptName"]);
                myDictionary.Add("姓名", dt.Rows[rowindex]["PatName"]);
                myDictionary.Add("性别", dt.Rows[rowindex]["PatSex"]);
                myDictionary.Add("年龄", GetAge(dt.Rows[rowindex]["Age"].ToString()));
                myDictionary.Add("床号", dt.Rows[rowindex]["BedNo"]);
                myDictionary.Add("住院号", dt.Rows[rowindex]["SerialNumber"]);

                gridreport = new GridReport();
                gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3201, 0, myDictionary, dtLongOrder);
                LongGridViewResult.Report = gridreport.Report;
                LongGridViewResult.Start();
                LongGridViewResult.Refresh();

                TempGridViewResult.Stop();
                GridReport gridreportTemp = new GridReport();
                gridreportTemp            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3203, 0, myDictionary, dtTempOrder);
                TempGridViewResult.Report = gridreportTemp.Report;
                TempGridViewResult.Start();
                TempGridViewResult.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #19
0
        private void SortGridView(string sortExpression, string direction)
        {
            //  Here we are going to sort the  gridview  depending on the column selected and  the direction of sorting
            DataTable RequiredList = new DataTable();

            if (ViewState["datatable"] != null)
            {
                RequiredList = (DataTable)ViewState["datatable"];
            }
            else
            {
                RequiredList = GetReport().Tables[0];
            }

            ViewState["datatable"] = RequiredList;
            DataView dv = new DataView(RequiredList);

            dv.Sort = sortExpression + direction;

            GridReport.DataSource = dv;

            GridReport.DataBind();
        }
Example #20
0
 private void ReportGrid(string RepCondition)
 {
     try
     {
         DS = Obj_DailyInwardOutwardRegister.GetDailyInwardOutward(StrCondition, out StrError);
         if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
         {
             //GridReport.DataSource = DS.Tables[0];
             //GridReport.DataBind();
         }
         else
         {
             GridReport.DataSource = null;
             GridReport.DataBind();
         }
         Obj_DailyInwardOutwardRegister = null;
         DS = null;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #21
0
            public AoAGridExperiment(GridReport reporter)
            {
                report_dlg            = reporter;
                opt                   = new AoAPsoOptimization(reporter_internal);
                opt.sas               = 0.0f; // we'll only use aerodynamic control
                opt.aerodynamics      = AeroModel.StockAero;
                opt.dt                = 0.05f;
                opt.experiment_length = 6.0f;

                // default spans
                Cl1_min   = 0.0f;
                Cl1_max   = 200.0f;
                Cl1_count = 6;

                Cl2_min   = -10.0f;
                Cl2_max   = 10.0f;
                Cl2_count = 6;

                Cm1_min   = -10.0f;
                Cm1_max   = 5.0f;
                Cm1_count = 15;

                Cm2_min   = 0.2f;
                Cm2_max   = 10.0f;
                Cm2_count = 10;

                // array inits
                phys_space_points[0] = Cl1_points;
                phys_space_points[1] = Cl2_points;
                phys_space_points[2] = Cm1_points;
                phys_space_points[3] = Cm2_points;

                matrix_space_points[0] = A00_points;
                matrix_space_points[1] = B0_points;
                matrix_space_points[2] = A10_points;
                matrix_space_points[3] = B1_points;
            }
Example #22
0
        /// <summary>
        /// 加载报表数据
        /// </summary>
        /// <param name="dtPatientFeeSum">病人费用数据</param>
        /// <param name="dtPatientFeeInfo">住院总费用</param>
        public void LoadPatientFeeInfo(DataTable dtPatientFeeSum, DataTable dtPatientFeeInfo)
        {
            try
            {
                int iListType = Convert.ToInt32(((ComboBoxItem)cmbListType.SelectedItem).Tag);

                GetDataAndShowFromTable(dgvCostMsg, dtPatientFeeInfo);
                CreateSumCol(iListType);

                decimal totalFee = 0;
                foreach (DataRow dr in dtPatientFeeInfo.Rows)
                {
                    totalFee += Convert.ToDecimal(dr["TotalFee"]);
                }

                if (dtPatientFeeSum != null && dtPatientFeeSum.Rows.Count > 0)
                {
                    myDictionary["TotalDespoit"] = Convert.ToDecimal(dtPatientFeeSum.Rows[0]["TotalDespoit"]);
                    myDictionary["TotalFee"]     = Convert.ToDecimal(dtPatientFeeSum.Rows[0]["TotalFee"]);
                    myDictionary["YE"]           = Convert.ToDecimal(dtPatientFeeSum.Rows[0]["YE"]);
                    myDictionary["BANumber"]     = dtPatientFeeSum.Rows[0]["CaseNumber"].ToString();
                }

                myDictionary["Fee"] = totalFee;

                ReportViewer.Stop();
                this.Cursor = Cursors.WaitCursor;
                GridReport gridreport = new GridReport();
                if (iListType == 1)
                {
                    myDictionary["Title"] = "项目明细清单";
                    gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3006, 0, myDictionary, dtPatientFeeInfo);
                }
                else if (iListType == 2)
                {
                    myDictionary["Title"] = "一日清单";

                    DataTable  dtPrint = new DataTable();
                    DataColumn col     = new DataColumn();
                    col.ColumnName = "InFpName";
                    col.DataType   = typeof(string);
                    dtPrint.Columns.Add(col);

                    DataColumn col1 = new DataColumn();
                    col1.ColumnName = "TotalFee";
                    col1.DataType   = typeof(string);
                    dtPrint.Columns.Add(col1);

                    DataColumn col2 = new DataColumn();
                    col2.ColumnName = "InFpName1";
                    col2.DataType   = typeof(string);
                    dtPrint.Columns.Add(col2);

                    DataColumn col3 = new DataColumn();
                    col3.ColumnName = "TotalFee1";
                    col3.DataType   = typeof(string);
                    dtPrint.Columns.Add(col3);

                    DataColumn col4 = new DataColumn();
                    col4.ColumnName = "Date";
                    col4.DataType   = typeof(string);
                    dtPrint.Columns.Add(col4);

                    for (int i = 0; i < dtPatientFeeInfo.Rows.Count; i++)
                    {
                        string  sInFpName = dtPatientFeeInfo.Rows[i]["InFpName"].ToString();
                        decimal dTotalFee = Convert.ToDecimal(dtPatientFeeInfo.Rows[i]["TotalFee"]);
                        if (!Convert.ToBoolean(i % 2))  //偶数行
                        {
                            DataRow dr = dtPrint.NewRow();
                            dr["InFpName"] = sInFpName;
                            dr["TotalFee"] = dTotalFee;
                            dr["Date"]     = dtPatientFeeInfo.Rows[i]["Date"];

                            dtPrint.Rows.Add(dr);
                        }
                        else
                        {
                            int j = i / 2;
                            dtPrint.Rows[j]["InFpName1"] = sInFpName;
                            dtPrint.Rows[j]["TotalFee1"] = dTotalFee;
                        }
                    }

                    //foreach (DataRow dr in dtPatientFeeInfo.Rows)
                    //{
                    //    string sInFpName = dr["InFpName"].ToString();
                    //    if (myDictionary.Keys.Contains(sInFpName))
                    //    {
                    //        myDictionary[sInFpName] = Convert.ToDecimal(dr["TotalFee"]);
                    //    }
                    //    else
                    //    {
                    //        myDictionary.Add(sInFpName, Convert.ToDecimal(dr["TotalFee"]));
                    //    }
                    //}



                    gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3005, 0, myDictionary, dtPrint);
                }
                else if (iListType == 3)
                {
                    myDictionary["Title"] = "发票项目";
                    gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3007, 0, myDictionary, dtPatientFeeInfo);
                }
                else if (iListType == 4)
                {
                    myDictionary["Title"] = "项目汇总";
                    gridreport            = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 3008, 0, myDictionary, dtPatientFeeInfo);
                }

                ReportViewer.Report = gridreport.Report;
                ReportViewer.Start();
                ReportViewer.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        public ActionResult GradeSheetOverview()
        {
            List<Assessment> assessments = dataRepository.GetAllNonTestBankAssessments(courseTerm,false);
            List<Profile> profiles = dataRepository.GetStudentProfiles(courseTerm);

            Func<Assessment, string> ylabel = (a => a.Name);
            Func<Assessment, string> ydetail = (a => dataRepository.GetWeightedPointValue(a).ToString("0.00"));
            Func<Assessment, double> yval = a => dataRepository.GetWeightedPointValue(a);
            Func<Profile,string> xlabel = p => p.FullName;
            Func<Profile,Assessment,double> cellval = (p,a) =>
                {
                    Grade g = new Grade(a,p);
                    double wv = dataRepository.GetWeightedPointValue(a);
                    return (a.IsExtraCredit)? g.Points : (g.Percentage/100.0) * wv;
                };
            bool showcoltotals = true;
            bool showcolavgs = false;
            bool showcolpfmes = false;
            bool showcolgrade = true;
            bool showrowavgs = true;

            GridReport<Profile, Assessment> report = new GridReport<Profile, Assessment>(profiles,
                assessments,
                ylabel, ydetail, yval,
                xlabel, cellval,
                showcoltotals, showcolavgs, showcolpfmes, showcolgrade, showrowavgs);

            return View(report);
        }
Example #24
0
        /// <summary>
        /// 事件
        /// </summary>
        /// <param name="sender">对象</param>
        /// <param name="e">参数</param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime beginTime = new DateTime();
                DateTime endTime   = new DateTime();
                GetQueryTime(ref beginTime, ref endTime);
                axGRDisplayViewer.Stop();
                if (txtCode.Text.Trim() == string.Empty)
                {
                    MessageBoxEx.Show("请选择药品");
                    txtCode.Focus();
                    return;
                }

                int queryType = 1;
                if (ratAccount.Checked)
                {
                    if (cmbQueryYear.Text == string.Empty)
                    {
                        MessageBoxEx.Show("会计年不能为空");
                        cmbQueryYear.Focus();
                        return;
                    }

                    if (cmbQueryMonth.Text == string.Empty)
                    {
                        MessageBoxEx.Show("会计月不能为空");
                        cmbQueryMonth.Focus();
                        return;
                    }

                    queryType = 2;
                }
                else
                {
                    queryType = 1;
                }

                int       deptId     = Convert.ToInt32(cmbDept.SelectedValue);
                int       drugId     = Convert.ToInt32(txtCode.MemberValue);
                int       queryYear  = Convert.ToInt32(cmbQueryYear.SelectedValue);
                int       queryMonth = Convert.ToInt32(cmbQueryMonth.SelectedValue);
                DataTable dtReport   = (DataTable)InvokeController("GetAccountDetail", frmName, deptId, queryYear, queryMonth, beginTime.ToString("yyyy-MM-dd HH:mm:ss"), endTime.ToString("yyyy-MM-dd HH:mm:ss"), drugId, queryType);
                orderDt = dtReport;
                Dictionary <string, object> myDictionary = new Dictionary <string, object>();
                myDictionary.Add("开始时间", beginTime.ToString("yyyy-MM-dd HH:mm:ss"));
                myDictionary.Add("结束时间", endTime.ToString("yyyy-MM-dd HH:mm:ss"));
                myDictionary.Add("名称", txtCode.Text);
                myDictionary.Add("生产厂家", ((DataRow)txtCode.SelectedValue)["ProductName"].ToString());
                myDictionary.Add("HospitalName", (InvokeController("this") as AbstractController).LoginUserInfo.WorkName + "药品明细账报表");
                GridReport gridreport = ReportTool.GetReport((InvokeController("this") as AbstractController).LoginUserInfo.WorkId, 4017, 0, myDictionary, dtReport);
                axGRDisplayViewer.Report = gridreport.Report;
                axGRDisplayViewer.Start();
                axGRDisplayViewer.Refresh();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
        }
        public ActionResult ProgramOutcomeSummary()
        {
            List<ProgramOutcome> outcomes = site.ProgramOutcomes.ToList();
            List<Profile> profiles = dataRepository.GetStudentProfiles(courseTerm);

            Func<ProgramOutcome, string> ylabel = (o => o.Label);
            Func<ProgramOutcome, string> ydetail = outcome =>
                {
                    StringBuilder taglist = new StringBuilder();
                    foreach (var tag in outcome.TagProgramOutcomes.Where(tpo => tpo.Tag.CourseTerm == courseTerm))
                    {
                        taglist.Append(tag.Tag.Name);
                        taglist.Append(", ");
                    }
                    taglist.Remove(taglist.Length - 2, 2);
                    return taglist.ToString();
                };
            Func<ProgramOutcome, double> yval = null;
            Func<Profile, string> xlabel = p => p.FullName;
            Func<Profile, ProgramOutcome, double> cellval = (profile, outcome) =>
            {
                double total = 0.0;
                double count = 0;
                foreach (var tag in outcome.TagProgramOutcomes.Where(tpo => tpo.Tag.CourseTerm == courseTerm))
                {
                    count++;
                    total += dataRepository.GetStudentPfmeForTag(tag.Tag, profile);
                }
                if (count > 0)
                    return total / count;
                else
                    return 0.0;
            };
            bool showcoltotals = false;
            bool showcolavgs = true;
            bool showcolpfmes = false;
            bool showcolgrade = false;
            bool showrowavgs = true;

            GridReport<Profile, ProgramOutcome> report = new GridReport<Profile, ProgramOutcome>(profiles,
                outcomes,
                ylabel, ydetail, yval,
                xlabel, cellval,
                showcoltotals, showcolavgs, showcolpfmes, showcolgrade, showrowavgs);

            return View(report);
        }
        public ActionResult TagPerformanceSummary()
        {
            List<Tag> tags = dataRepository.GetNonCourseOutcomes(courseTerm, false);
            List<Profile> profiles = dataRepository.GetStudentProfiles(courseTerm);

            Func<Tag, string> ylabel = tag =>
            {
                string tagname = string.IsNullOrEmpty(tag.DescriptiveName) ? tag.Name : tag.DescriptiveName;
                string url = Url.Action("TagPerformanceDetails", "Reports", new { id = tag.TagID, siteShortName = site.ShortName, courseTermShortName = courseTerm.ShortName });
                return string.Format(@"<a href=""{0}"" title=""Click to view Tag Performance Details Report"">{1}</a>", url, tagname);
            };

            Func<Profile, string> xlabel = p => p.FullName;
            Func<Profile, Tag, double> cellval = (p, t) =>
            {

                return dataRepository.GetStudentPfmeForTag(t, p);
            };
            bool showcoltotals = false;
            bool showcolavgs = true;
            bool showcolpfmes = false;
            bool showcolgrade = false;
            bool showrowavgs = true;

            IGridReport report = new GridReport<Profile, Tag>(profiles,
                tags,
                ylabel, null, null,
                xlabel, cellval,
                showcoltotals, showcolavgs, showcolpfmes, showcolgrade, showrowavgs);

            return View(report);
        }
Example #27
0
        /// <summary>
        /// This method is used to binding the datagrid with the help of sql query.
        /// </summary>
        public void BindTheData()
        {
            //InventoryClass obj=new InventoryClass();
            //SqlDataReader rdr=null;
            //SqlConnection SqlCon =new SqlConnection(System .Configuration.ConfigurationSettings.AppSettings["Servosms"]);
            //SqlCon.Open();
            //string sqlstr="select Prod_Code,Category,Prod_Name,Pack_Type from Products";
            //SqlDtr=obj.GetRecordSet(sqlstr);
            //SqlCommand cmd;
            //string PName="";
            //	dbobj.SelectQuery(sqlstr,ref rdr);
            //	while(rdr.Read())
            //	{
            //		PName=rdr["Prod_Name"].ToString();
            //		if(PName.StartsWith("SERVO"))
            //			PName=PName.Substring(5);
            //dbobj.ExecProc(OprType.Insert,"sp_stockmovement",ref op,"@id",Int32.Parse(rdr["productid"].ToString()),"@fromdate",getdate(txtDateFrom.Text,true).Date.ToShortDateString(),"@todate",getdate(txtDateTo.Text,true).Date.ToShortDateString());
            //count++;
            //		cmd=new SqlCommand("insert into ProdTable values("+rdr.GetValue(0).ToString()+",'"+rdr.GetValue(1).ToString()+"','"+PName+"','"+rdr.GetValue(3).ToString()+"')",SqlCon);
            //		cmd.ExecuteNonQuery();
            //	}
            //	rdr.Close();
            //	SqlCon.Close();
            //	SqlCon.Open();

            //string sqlstr="select Category,Prod_Name,Pack_Type from Products";

            /********** Impliment to hase table *************
             * SqlDtr=obj.GetRecordSet(sqlstr);
             * Hashtable ht1 = new Hashtable();
             * int i=0;
             * ArrayList Data=new ArrayList();
             *
             * Hashtable ht=new Hashtable();
             * Data.Add("Category");
             * Data.Add("Prod_Name");
             * Data.Add("Pack_Type");
             * Data.Add("Prod_Code");
             * ht.Add(i,Data);
             * i++;
             * while(SqlDtr.Read())
             * {
             *
             *      Data.Add(SqlDtr["Category"].ToString());
             *      Data.Add(SqlDtr["Prod_Name"].ToString());
             *      Data.Add(SqlDtr["Pack_Type"].ToString());
             *      Data.Add(SqlDtr["Prod_Code"].ToString());
             *      ProdName[i]=SqlDtr["Prod_Name"].ToString();
             *      PackType[i]=SqlDtr["Pack_Type"].ToString();
             *      ProdCode[i]=SqlDtr["Prod_Code"].ToString();
             *      ht.Add(i,Data);
             *      i++;
             * }
             */
            //SqlDataReader rdr=null;
            SqlConnection SqlCon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["Servosms"]);

            SqlCon.Open();
            string sqlstr = "select Prod_ID,Prod_Code,Category,Prod_Name,Pack_Type,Unit,Total_Qty,Store_In from Products";


            if (DropValue.Value != "All")
            {
                if (DropSearchBy.SelectedIndex == 1)
                {
                    string[] pname = DropValue.Value.Split(new char[] { ':' }, DropValue.Value.Length);
                    sqlstr += " where prod_name='" + pname[0].ToString() + "' and pack_type='" + pname[1].ToString() + "'";
                }
                else if (DropSearchBy.SelectedIndex == 2)
                {
                    sqlstr += " where Prod_Name='" + DropValue.Value + "'";
                }
                else if (DropSearchBy.SelectedIndex == 3)
                {
                    sqlstr += " where Pack_Type='" + DropValue.Value + "'";
                }
                else if (DropSearchBy.SelectedIndex == 4)
                {
                    sqlstr += " where Category='" + DropValue.Value + "'";
                }
            }

            /*
             * SqlCommand cmd;
             * string PName="";
             * dbobj.SelectQuery(sqlstr,ref rdr);
             * while(rdr.Read())
             * {
             *      PName=rdr["Prod_Name"].ToString();
             *      if(PName.StartsWith("SERVO"))
             *              PName=PName.Substring(5);
             *      cmd=new SqlCommand("insert into ProdTable values("+rdr.GetValue(0).ToString()+",'"+rdr.GetValue(1).ToString()+"','"+rdr.GetValue(2).ToString()+"','"+PName.Trim().ToString()+"','"+rdr.GetValue(4).ToString()+"')",SqlCon);
             *      cmd.ExecuteNonQuery();
             * }
             * rdr.Close();
             * SqlCon.Close();
             * SqlCon.Open();
             * int x=0;
             * sqlstr="select Prod_ID,Prod_Code,Category,Prod_Name,Pack_Type from ProdTable";
             */
            DataSet        ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(sqlstr, SqlCon);

            da.Fill(ds, "Products");
            DataTable dtCustomers = ds.Tables["Products"];
            DataView  dv          = new DataView(dtCustomers);

            dv.Sort             = strOrderBy;
            Cache["strOrderBy"] = strOrderBy;
            if (dv.Count == 0)
            {
                MessageBox.Show("Data not available");
                GridReport.Visible = false;
            }
            else
            {
                GridReport.DataSource = dv;
                GridReport.DataBind();
                GridReport.Visible = true;
            }
            SqlCon.Close();
            // truncate table after use.
            //dbobj.Insert_or_Update("truncate table ProdTable", ref x);
            //TextBox1.Text=ht.Values.ToString();

            /*
             * GridReport.DataSource=ht.Values;
             * GridReport.DataBind();
             * GridReport.Visible=true;*/
        }
        public ActionResult TagPerformanceDetails(Guid id)
        {
            Tag tag = dataRepository.GetTagByID(courseTerm, id);
            if (tag == null)
                return View("TagNotFound");
            List<ITaggable> taggeditems = dataRepository.GetTaggedItems(tag);
            List<Profile> profiles = dataRepository.GetStudentProfiles(courseTerm);

            Func<ITaggable, string> ylabel = (tagged => tagged.Name);
            Func<ITaggable, double> yval = (tagged => tagged.Weight);
            Func<ITaggable, string> ydetail = (tagged => tagged.Weight.ToString("0.00"));

            Func<Profile, string> xlabel = p => p.FullName;
            Func<Profile, ITaggable, double> cellval = (p, t) =>
            {

                return t.Score(p);
            };
            bool showcoltotals = true;
            bool showcolavgs = false;
            bool showcolpfmes = true;
            bool showcolgrade = false;
            bool showrowavgs = true;

            IGridReport report = new GridReport<Profile, ITaggable>(profiles,
                taggeditems,
                ylabel, ydetail, yval,
                xlabel, cellval,
                showcoltotals, showcolavgs, showcolpfmes, showcolgrade, showrowavgs);

            CourseOutcomeDetailsModel model = new CourseOutcomeDetailsModel() { CourseOutcome = tag, Report = report };
            return View(model);
        }
Example #29
0
        void Report()
        {
            int Starthour = 8;
            int Endhour   = 20;
            int day       = 1;

            GetGridTime(ref Starthour, ref Endhour, ref day);
            GRReport.Visible  = true;
            GRReport.Size     = new Size(1424, 500);
            GRReport.Location = new Point(12, 353);

            LBDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            LBHour.Text = DateTime.Now.ToString("HH:mm:ss");
            DateTime start = DateTime.Now;
            DateTime end   = DateTime.Now;

            if (day == 0)
            {
                start = DateTime.Now.AddHours(-(DateTime.Now.Hour - Starthour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second));
                end   = DateTime.Now.AddHours(-(DateTime.Now.Hour - Endhour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second)).AddDays(day);
            }
            else if (DateTime.Now.Hour >= 22)
            {
                start = DateTime.Now.AddHours(-(DateTime.Now.Hour - Starthour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second));
                end   = DateTime.Now.AddHours(-(DateTime.Now.Hour - Endhour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second)).AddDays(day);
            }
            else if (DateTime.Now.Hour >= 0)
            {
                start = DateTime.Now.AddHours(-(DateTime.Now.Hour - Starthour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second)).AddDays(-day);
                end   = DateTime.Now.AddHours(-(DateTime.Now.Hour - Endhour)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second));
            }


            //var start = DateTime.Parse("18.10.2020 20:00:00");
            //var end = DateTime.Parse("19.10.2020 08:00:00");

            if (GetReport(start, end))
            {
                return;
            }

            var list = (from DataGridViewRow a in _grid.Rows
                        select new { Name = a.Cells["Name"].Value.ToString(), Product = a.Cells["Product"].Value.ToString(), Line = a.Cells["Line"].Value.ToString(), Objective = a.Cells["Objective"].Value.ToString() }).Distinct().ToList();

            GridReport.RowCount = list.Count();
            foreach (var item in list) //Получаем инфо в ОтчётГрид по модели изделию и линии
            {
                var i = list.IndexOf(item);
                GridReport[0, i].Value  = item.Name;
                GridReport[1, i].Value  = item.Product;
                GridReport[2, i].Value  = item.Line;
                GridReport[10, i].Value = item.Objective;
            }

            //Сложный цикл в котором запутается даже автор этого говна || получаем данные в ОтчётГрид по волновой пайке по времени
            for (int k = 0; k < GridReport.RowCount; k++)
            {
                var Сцепить = GridReport[0, k].Value.ToString() + GridReport[1, k].Value.ToString() + GridReport[2, k].Value.ToString();
                for (int i = 3; i < GridReport.ColumnCount; i++)
                {
                    var СцепитьВремя = Сцепить + GridReport.Columns[i].HeaderText;

                    for (int l = 0; l < _grid.RowCount; l++)
                    {
                        var Сцепить_grid = _grid[0, l].Value.ToString() + _grid[1, l].Value.ToString() + _grid[2, l].Value.ToString() + _grid[3, l].Value.ToString();
                        if (Сцепить_grid == СцепитьВремя)
                        {
                            GridReport[i, k].Value = _grid[5, l].Value;
                        }
                    }
                }
            }

            for (int i = 0; i < GridReport.RowCount; i++)     // Цикл который считает за смену
            {
                var sumlist = new List <int>()
                {
                    0, 0
                };
                for (int k = 3; k < GridReport.ColumnCount - 2; k++)
                {
                    if (GridReport[k, i].Value == null)
                    {
                        continue;
                    }
                    sumlist[0] = sumlist[0] + int.Parse(GridReport[k, i].Value.ToString());
                    sumlist[1] = sumlist[1] + 1;
                }
                GridReport[9, i].Value = sumlist[0] / sumlist[1];
            }

            for (int i = 0; i < GridReport.RowCount; i++)
            {
                if (GridReport[10, i].Value.ToString() == "")
                {
                    continue;
                }
                if (int.Parse(GridReport[9, i].Value.ToString()) > int.Parse(GridReport[10, i].Value.ToString()))
                {
                    GridReport[9, i].Style.BackColor = Color.Red; GridReport[10, i].Style.BackColor = Color.Red;
                }
                else
                {
                    GridReport[9, i].Style.BackColor = Color.Green; GridReport[10, i].Style.BackColor = Color.Green;
                }
            }

            using (var con = new Connect())
            {
                //var d = DateTime.Now.AddHours(-(DateTime.Now.Hour - 8)).AddMinutes(-(DateTime.Now.Minute)).AddSeconds(-(DateTime.Now.Second));
                LBName1.Text = (from a in con.Logs join b in con.Users on a.ControllerId equals b.Id  where a.Date >= start && a.Date <= end orderby a.Date descending select b.UserName).FirstOrDefault();
                LBName2.Text = (from a in con.Logs join b in con.Users on a.Mate_ControllerId equals b.Id  where a.Date >= start && a.Date <= end orderby a.Date descending select b.UserName).FirstOrDefault();
            }

            GridReport.ClearSelection();
        }