Exemplo n.º 1
0
        private void Button_Query_Click(object sender, EventArgs e)
        {
            ProgressScreen.Current.ShowSplashScreen();
            ProgressScreen.Current.SetStatus = "正在获取数据...";
            FpSpread_Info.OperationMode      = OperationMode.ReadOnly;

            DateTime  StartDate = DateTime.Parse(string.Format("{0}-{1}-{2} 00:00:00", DateTimePicker_Start.Value.Year, DateTimePicker_Start.Value.Month, DateTimePicker_Start.Value.Day));
            DateTime  EndDate   = DateTime.Parse(string.Format("{0}-{1}-{2} 23:59:59", DateTimePicker_End.Value.Year, DateTimePicker_End.Value.Month, DateTimePicker_End.Value.Day));
            string    BGBH      = txtBGBH.Text.Trim();
            DataTable Data      = PXJZReportDataList.GetPXReportRelation(PXTestRoomCode, ModuleID, StartDate, EndDate, BGBH);

            if (Data != null)
            {
                //BizComponents.TextCellType text = new BizComponents.TextCellType();
                //text.ReadOnly = false;
                FpSpread.ShowRow(FpSpread.GetActiveRowViewportIndex(), 0, VerticalPosition.Top);
                FpSpread_Info.Rows.Count = Data.Rows.Count;
                if (Data.Rows.Count > 0)
                {
                    for (int i = 0; i < Data.Rows.Count; i++)
                    {
                        FpSpread_Info.Rows[i].HorizontalAlignment = CellHorizontalAlignment.Center;
                        for (int j = 0; j < FpSpread_Info.ColumnHeader.Columns.Count; j++)
                        {
                            String v = Data.Rows[i][j].ToString();
                            FpSpread_Info.Cells[i, j].Value  = v;
                            FpSpread_Info.Cells[i, j].Locked = false;
                            //FpSpread_Info.Cells[i, j].CellType = text;
                        }
                    }
                }
                else
                {
                    ProgressScreen.Current.CloseSplashScreen();
                    this.Activate();
                    MessageBox.Show("无数据,请重新选择条件!");
                }
            }
            else
            {
                ProgressScreen.Current.CloseSplashScreen();
                this.Activate();
                MessageBox.Show("无数据,请重新选择条件!");
            }
            ProgressScreen.Current.CloseSplashScreen();
            this.Activate();
            if (Data == null)
            {
                TotalCount.Text = string.Format("共 {0} 条记录", 0);
            }
            else
            {
                TotalCount.Text = string.Format("共 {0} 条记录", Data.Rows.Count);
            }
        }
Exemplo n.º 2
0
        private void tsmiResetPXRelation_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("您是否确定生成对应的平行关系?", "确认操作", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Row Row = spread_stadium_Sheet1.ActiveRow;

                if (Row != null && Row.Tag is String)
                {
                    String[] Tokens   = Row.Tag.ToString().Split(',');
                    Guid     PXDataID = new Guid(Tokens[0]);
                    int      flag     = PXJZReportDataList.GeneratePXRelation(SGDataID, PXDataID);
                    if (flag == 1)
                    {
                        MessageBox.Show("平行对应关系生成成功,请到平行关系对应查询中查看!");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("平行对应关系生成失败,请稍后再试!");
                    }
                }
            }
        }
Exemplo n.º 3
0
        //柱状原始
        private void PXChart_Load(object sender, EventArgs e)
        {
            tChart1.Text = modelName;
            this.Text    = modelName;

            bar1.Title = "自检";

            line1.Title = "平行";

            tChart1.Chart.Aspect.View3D    = false;
            tChart1.Axes.Bottom.Title.Text = "时间";
            tChart1.Axes.Left.Title.Text   = "数量(个)";
            Data = PXJZReportDataList.GetPXJZReportChart(testRoomID, start, end, modelID);
            if (Data != null)
            {
                bar1.CustomBarWidth                       = 5;
                tChart1.Axes.Left.Minimum                 = 0;
                tChart1.Axes.Left.Increment               = 1;
                line1.LinePen.Width                       = 3;
                line1.Marks.Visible                       = true;
                tChart1.Axes.Bottom.Increment             = 1;
                tChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy-MM-dd";
                tChart1.Axes.Bottom.Automatic             = true;
                foreach (DataRow item in Data.Rows)
                {
                    bar1.Add(DateTime.Parse(item["chartDate"].ToString()), Int32.Parse(item["zjCount"].ToString()), Color.Green);
                    line1.Add(DateTime.Parse(item["chartDate"].ToString()), Int32.Parse(item["pxjzCount"].ToString()), Color.Red);
                }
            }
            tChart1.Axes.Bottom.Labels.Angle = 270;  //设置时间横向和竖向
            bar1.Color  = Color.Green;
            line1.Color = Color.Red;
            Double result = GetQulify(Data, start, end, count);

            label1.Text = "平行频率质量系数:" + ((Int32)result).ToString();
            label3.Text = "平行频率(%):" + frequency;
        }
Exemplo n.º 4
0
        private void Button_Query_Click(object sender, EventArgs e)
        {
            ProgressScreen.Current.ShowSplashScreen();
            ProgressScreen.Current.SetStatus = "正在获取数据...";
            FpSpread_Info.OperationMode      = OperationMode.ReadOnly;
            String segment  = "";
            String company  = "";
            String testroom = "";

            if (ComboBox_Segments.SelectedItem is Prjsct)
            {
                segment = (ComboBox_Segments.SelectedItem as Prjsct).PrjsctCode;
            }
            if (ComboBox_Company.SelectedItem is Orginfo)
            {
                company = (ComboBox_Company.SelectedItem as Orginfo).DepCode;
            }
            if (ComboBox_TestRooms.SelectedItem is PrjFolder)
            {
                testroom = (ComboBox_TestRooms.SelectedItem as PrjFolder).FolderCode;
            }

            DateTime StartDate = DateTime.Parse(string.Format("{0}-{1}-{2} 00:00:00", DateTimePicker_Start.Value.Year, DateTimePicker_Start.Value.Month, DateTimePicker_Start.Value.Day));
            DateTime EndDate   = DateTime.Parse(string.Format("{0}-{1}-{2} 23:59:59", DateTimePicker_End.Value.Year, DateTimePicker_End.Value.Month, DateTimePicker_End.Value.Day));

            DataTable Data = PXJZReportDataList.GetJZReportInfos(segment, company, testroom, StartDate, EndDate);

            if (Data != null)
            {
                FpSpread.ShowRow(FpSpread.GetActiveRowViewportIndex(), 0, VerticalPosition.Top);
                FpSpread_Info.Rows.Count = Data.Rows.Count;
                if (Data.Rows.Count > 0)
                {
                    for (int i = 0; i < Data.Rows.Count; i++)
                    {
                        FpSpread_Info.Rows[i].HorizontalAlignment = CellHorizontalAlignment.Center;
                        for (int j = 0; j < FpSpread_Info.ColumnHeader.Columns.Count; j++)
                        {
                            String v = Data.Rows[i][FpSpread_Info.ColumnHeader.Cells[0, j].Tag.ToString()].ToString();
                            FpSpread_Info.Cells[i, j].Value = v;
                            if (v == "不满足")
                            {
                                FpSpread_Info.Rows[i].BackColor = Color.FromArgb(255, 192, 192);
                            }
                            else
                            {
                                FpSpread_Info.Rows[i].BackColor = Color.FromName(System.Drawing.KnownColor.Control.ToString());
                            }
                        }
                    }
                }
                else
                {
                    ProgressScreen.Current.CloseSplashScreen();
                    this.Activate();
                    MessageBox.Show("无数据,请重新选择条件!");
                }
            }
            else
            {
                ProgressScreen.Current.CloseSplashScreen();
                this.Activate();
                MessageBox.Show("无数据,请重新选择条件!");
            }
            ProgressScreen.Current.CloseSplashScreen();
            this.Activate();
            if (Data == null)
            {
                TotalCount.Text = string.Format("共 {0} 条记录", 0);
            }
            else
            {
                TotalCount.Text = string.Format("共 {0} 条记录", Data.Rows.Count);
            }
        }
Exemplo n.º 5
0
        private void BindPXBGData()
        {
            DataTable Data = PXJZReportDataList.GetEnPXedReport(ModuleID, txtBGBH.Text.Trim());

            if (Data != null && Data.Rows.Count > 0)
            {
                spread_stadium.ShowRow(spread_stadium.GetActiveRowViewportIndex(), 0, VerticalPosition.Top);
                spread_stadium_Sheet1.Rows.Count = Data.Rows.Count;

                int HiddenColumnCount = 2;
                spread_stadium_Sheet1.Columns.Count = Data.Columns.Count - HiddenColumnCount;
                if (spread_stadium_Sheet1.Columns.Count > 0)
                {
                    spread_stadium_Sheet1.Columns[0].Width = 60;
                    spread_stadium_Sheet1.Columns[1].Width = 100;
                    spread_stadium_Sheet1.Columns[2].Width = 80;
                    spread_stadium_Sheet1.Columns[3].Width = 80;
                    spread_stadium_Sheet1.Columns[4].Width = 60;
                    spread_stadium_Sheet1.Columns[5].Width = 60;
                    spread_stadium_Sheet1.Columns[6].Width = 80;
                    spread_stadium_Sheet1.Columns[7].Width = 80;
                    //spread_stadium_Sheet1.Columns[8].Width = 80;
                    //spread_stadium_Sheet1.Columns[9].Width = 80;
                }

                DateTimeCellType datetime = new DateTimeCellType();
                datetime.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDate;
                FarPoint.Win.Spread.CellType.TextCellType text = new FarPoint.Win.Spread.CellType.TextCellType();
                text.Multiline = true;
                text.WordWrap  = true;

                spread_stadium_Sheet1.Columns[7].CellType = datetime;
                //spread_stadium_Sheet1.Columns[0].Visible = false;
                //spread_stadium_Sheet1.Columns[1].Visible = false;

                spread_stadium_Sheet1.Rows.Count = Data.Rows.Count;

                int i, j;
                foreach (System.Data.DataColumn Column in Data.Columns)
                {
                    if (Column.ColumnName == "ID" || Column.ColumnName == "ModuleID")
                    {
                        continue;
                    }

                    i = Data.Columns.IndexOf(Column);
                    spread_stadium_Sheet1.Columns[i - HiddenColumnCount].VerticalAlignment = CellVerticalAlignment.Center;
                    spread_stadium_Sheet1.Columns[i - HiddenColumnCount].Label             = Column.ColumnName;

                    foreach (DataRow Row in Data.Rows)
                    {
                        j = Data.Rows.IndexOf(Row);
                        spread_stadium_Sheet1.Rows[j].HorizontalAlignment           = CellHorizontalAlignment.Center;
                        spread_stadium_Sheet1.Cells[j, i - HiddenColumnCount].Value = Row[Column.ColumnName].ToString();
                    }
                }

                foreach (DataRow Row in Data.Rows)
                {
                    j = Data.Rows.IndexOf(Row);
                    spread_stadium_Sheet1.Rows[j].Tag = Row["ID"].ToString() + "," + Row["ModuleID"].ToString();
                }

                spread_stadium.CellDoubleClick -= new CellClickEventHandler(spread_stadium_CellDoubleClick);
                spread_stadium.CellDoubleClick += new CellClickEventHandler(spread_stadium_CellDoubleClick);
            }
            else
            {
                MessageBox.Show("未找到数据,请检查委托/报告编号是否正确;或打开重新保存资料!");
            }
        }