Exemple #1
0
        private void findButton_Click(object sender, EventArgs e)
        {
            ProfJobDataSet set = profJobSet;

            bookmark.Get();
            AppHelper.ResetGridDataSource(reportGrid);

            if (dateCheck.Checked == true)
            {
                set.From = fromDateEdit.Value.ToString(AppRes.csDateFormat);
                set.To   = toDateEdit.Value.ToString(AppRes.csDateFormat);
            }
            else
            {
                set.From = "";
                set.To   = "";
            }

            set.JobNo      = "";
            set.AreaNo     = (EReportArea)areaCombo.SelectedValue;
            set.ItemNo     = itemNoEdit.Text.Trim();
            set.JobNo      = string.Empty;
            set.ExtendASTM = false;
            set.Select();

            AppHelper.SetGridDataSource(reportGrid, set);

            bookmark.Goto();
            reportGrid.Focus();
        }
Exemple #2
0
        private void Insert(EReportArea areaNo, string itemNo)
        {
            string jobNo       = "";
            string extendJobNo = "";

            profJobSet.Type       = EReportType.Chemical;
            profJobSet.JobNo      = "";
            profJobSet.AreaNo     = areaNo;
            profJobSet.ItemNo     = itemNo;
            profJobSet.ExtendASTM = true;
            profJobSet.Select();

            int rowCount = profJobSet.RowCount;

            if (rowCount > 0)
            {
                profJobSet.Fetch(0);
                jobNo = profJobSet.JobNo;

                if (string.IsNullOrWhiteSpace(jobNo) == false)
                {
                    cheCheckSet.Select(jobNo);

                    if (cheCheckSet.Empty == false)
                    {
                        MessageBox.Show("Can't import chemical report because this report already exist in DB!",
                                        "SGS", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        if (rowCount > 1)
                        {
                            // Find jobno for additional test results
                            for (int i = 1; i < profJobSet.RowCount; i++)
                            {
                                profJobSet.Fetch(i);

                                if (profJobSet.Image == null)
                                {
                                    extendJobNo = profJobSet.JobNo;
                                    break;
                                }
                            }

                            profJobSet.Fetch(0);
                        }

                        cheQuery.Insert(extendJobNo);
                    }
                }
            }

            findButton.PerformClick();
        }
        public void Import()
        {
            DialogProfJobListView dialog = new DialogProfJobListView();

            try
            {
                dialog.Type = EReportType.Physical;
                dialog.ShowDialog();
            }
            finally
            {
                if (dialog.DialogResult == DialogResult.OK)
                {
                    profJobSet.Type       = EReportType.Physical;
                    profJobSet.JobNo      = dialog.JobNo;
                    profJobSet.ExtendASTM = false;
                    profJobSet.Select();
                    profJobSet.Fetch();
                    Insert();
                }
            }
        }