Beispiel #1
0
        private void spdData_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            DataTable RetDT     = null;
            string    QueryCond = null;

            if (e.Row < 0)
            {
                return;
            }

            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvFactory.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, Convert.ToString(spdData.Sheets[0].GetValue(e.Row, 2)));
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, Convert.ToString(spdData.Sheets[0].GetValue(e.Row, 0)));
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, Convert.ToDateTime(spdData.Sheets[0].GetValue(e.Row, 5)).ToString("yyyyMMddHHmmss"));
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, Convert.ToDateTime(spdData.Sheets[0].GetValue(e.Row, 4)).ToString("yyyyMMddHHmmss"));

            spdDetail_Sheet1.RowCount = 0;
            this.Refresh();

            RetDT = CmnFunction.oComm.GetFuncDataTable("STD1608_1", QueryCond);

            if (RetDT.Rows.Count == 0)
            {
                spdDetail.Visible = false;
            }
            else
            {
                spdDetail.Visible           = true;
                spdDetail_Sheet1.DataSource = RetDT;
            }

            spdDetail_Sheet1.SetColumnAllowAutoSort(0, spdDetail_Sheet1.ColumnCount, true);
            CmnFunction.FitColumnHeader(spdDetail);
            CmnInitFunction.InitLockSpread(spdDetail);

            RetDT.Dispose();
        }
Beispiel #2
0
        private void btnView_Click(object sender, EventArgs e)
        {
            DataTable RetDT     = null;
            DataTable ReRetDT   = new DataTable();
            string    QueryCond = null;

            if (CheckField() == false)
            {
                return;
            }

            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvFactory.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvOper.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, txtLotID.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, dtpFromDate.Value.ToString("yyyyMMdd"));
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, dtpToDate.Value.ToString("yyyyMMdd"));
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, chkIncludeZeroLot.Checked == true ? "Y" : "");

            spdData_Sheet1.RowCount = 0;
            this.Refresh();
            RetDT = CmnFunction.oComm.GetFuncDataTable("STD1609", QueryCond);
            if (RetDT.Rows.Count == 0)
            {
                spdData.Visible = false;
            }
            else
            {
                spdData.Visible = true;

                for (int i = 0; i < RetDT.Columns.Count; i++)
                {
                    DataColumn DetailCol = new DataColumn();

                    DetailCol.ReadOnly = false;
                    DetailCol.Unique   = false;

                    DetailCol.ColumnName = RetDT.Columns[i].ColumnName;
                    DetailCol.DataType   = System.Type.GetType("System.String");

                    ReRetDT.Columns.Add(DetailCol);
                }

                //New DataTable Value Á¤ÀÇ
                for (int i = 0; i < RetDT.Rows.Count; i++)
                {
                    DataRow OperRow = null;
                    OperRow    = ReRetDT.NewRow();
                    OperRow[0] = RetDT.Rows[i].ItemArray[0];
                    ReRetDT.Rows.Add(OperRow);
                    for (int j = 1; j < RetDT.Columns.Count; j++)
                    {
                        if (j == 6 || j == 7 || j == 8)
                        {
                            ReRetDT.Rows[i][j] = CmnFunction.ToDate(RetDT.Rows[i].ItemArray[j].ToString().Trim());
                        }
                        else
                        {
                            if (j == 5 || j == 9 || j == 10)
                            {
                                ReRetDT.Rows[i][j] = CmnFunction.ToDbl(RetDT.Rows[i].ItemArray[j]).ToString("#########0.####");
                            }
                            else
                            {
                                ReRetDT.Rows[i][j] = RetDT.Rows[i].ItemArray[j];
                            }
                        }
                    }
                }
            }
            spdData_Sheet1.DataSource = ReRetDT;
            spdData_Sheet1.SetColumnAllowAutoSort(0, spdData_Sheet1.ColumnCount, true);
            CmnFunction.FitColumnHeader(spdData);
            CmnInitFunction.InitLockSpread(spdData);
            RetDT.Dispose();
        }
Beispiel #3
0
        private void btnView_Click(object sender, EventArgs e)
        {
            DataTable dt        = null;
            DataTable RetDT     = new DataTable();
            string    QueryCond = null;

            CheckField();
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvFactory.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvMat.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvMatVer.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvOper.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, cdvMatGrpList.Text);
            QueryCond = FwxCmnFunction.PackCondition(QueryCond, txtMatGrp.Text);

            spdData_Sheet1.RowCount = 0;
            this.Refresh();
            dt = CmnFunction.oComm.GetFuncDataTable("STD1607", QueryCond);
            if (dt.Rows.Count == 0)
            {
                spdData.Visible = false;
            }
            else
            {
                spdData.Visible = true;
            }


            for (int i = 0; i < dt.Columns.Count; i++)
            {
                DataColumn DetailCol = new DataColumn();

                DetailCol.ReadOnly = false;
                DetailCol.Unique   = false;

                DetailCol.ColumnName = dt.Columns[i].ColumnName;
                DetailCol.DataType   = System.Type.GetType("System.String");

                RetDT.Columns.Add(DetailCol);
            }

            //New DataTable Value Á¤ÀÇ
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow OperRow = null;
                OperRow    = RetDT.NewRow();
                OperRow[0] = dt.Rows[i].ItemArray[0];
                RetDT.Rows.Add(OperRow);
                for (int j = 1; j < dt.Columns.Count; j++)
                {
                    if (j == 5 || j == 6 || j == 11)
                    {
                        RetDT.Rows[i][j] = CmnFunction.ToDate(dt.Rows[i].ItemArray[j].ToString().Trim());
                    }
                    else
                    {
                        if (j > 6 && j < 11)
                        {
                            RetDT.Rows[i][j] = CmnFunction.ToDbl(dt.Rows[i].ItemArray[j]).ToString("#########0.####");
                        }
                        else
                        {
                            RetDT.Rows[i][j] = dt.Rows[i].ItemArray[j];
                        }
                    }
                }
            }

            spdData_Sheet1.DataSource = RetDT;
            spdData_Sheet1.SetColumnAllowAutoSort(0, spdData_Sheet1.ColumnCount, true);
            CmnFunction.FitColumnHeader(spdData);
            CmnInitFunction.InitLockSpread(spdData);
            dt.Dispose();
        }