Example #1
0
        private void Bind()
        {
            DataTable Data = LoginDataList.GetOperateLogList(segment, company, testroom, StartDate, EndDate, tb_username.Text.Trim(), pagerControl1.PageIndex, pagesize, 0);

            pagerControl1.DrawControl(count, pagesize);
            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++)
                    {
                        DataRow Row = Data.Rows[i];
                        FpSpread_Info.Rows[i].Tag = Row["ID"].ToString();
                    }

                    for (int i = 0; i < Data.Rows.Count; i++)
                    {
                        FpSpread_Info.Rows[i].Tag = Data.Rows[i]["ID"].ToString();

                        FpSpread_Info.Rows[i].HorizontalAlignment = CellHorizontalAlignment.Center;
                        for (int j = 0; j < FpSpread_Info.ColumnHeader.Columns.Count; j++)
                        {
                            FpSpread_Info.Cells[i, j].Value = Data.Rows[i][FpSpread_Info.ColumnHeader.Cells[0, j].Text].ToString();
                        }
                    }
                }
                else
                {
                    pagerControl1.DrawControl(count, pagesize);
                    ProgressScreen.Current.CloseSplashScreen();
                    this.Activate();
                    MessageBox.Show("无数据,请重新选择条件!");
                }
            }
            else
            {
                pagerControl1.DrawControl(count, pagesize);
                ProgressScreen.Current.CloseSplashScreen();
                this.Activate();
                MessageBox.Show("无数据,请重新选择条件!");
            }
            ProgressScreen.Current.CloseSplashScreen();
            this.Activate();
        }
Example #2
0
        private void Button_Query_Click(object sender, EventArgs e)
        {
            pagerControl1.PageIndex = 1;
            ProgressScreen.Current.ShowSplashScreen();
            ProgressScreen.Current.SetStatus = "正在获取数据...";
            if (ComboBox_Segments.SelectedItem is Prjsct)
            {
                segment = (ComboBox_Segments.SelectedItem as Prjsct).PrjsctCode;
            }
            else
            {
                segment = "";
            }
            if (ComboBox_Company.SelectedItem is Orginfo)
            {
                company = (ComboBox_Company.SelectedItem as Orginfo).DepCode;
            }
            else
            {
                company = "";
            }
            if (ComboBox_TestRooms.SelectedItem is PrjFolder)
            {
                testroom = (ComboBox_TestRooms.SelectedItem as PrjFolder).FolderCode;
            }
            else
            {
                testroom = "";
            }
            StartDate = DateTime.Parse(string.Format("{0}-{1}-{2} 00:00:00", DateTimePicker_Start.Value.Year, DateTimePicker_Start.Value.Month, DateTimePicker_Start.Value.Day));
            EndDate   = DateTime.Parse(string.Format("{0}-{1}-{2} 23:59:59", DateTimePicker_End.Value.Year, DateTimePicker_End.Value.Month, DateTimePicker_End.Value.Day));

            DataTable datatotal = LoginDataList.GetOperateLogList(segment, company, testroom, StartDate, EndDate, tb_username.Text.Trim(), 1, 30, 1);

            if (datatotal != null && datatotal.Rows.Count == 1)
            {
                count = int.Parse(datatotal.Rows[0][0].ToString());
            }
            Bind();
        }