Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (reportGridView.FocusedRowHandle < 0)
            {
                return;
            }

            DataRow row = reportGridView.GetDataRow(reportGridView.FocusedRowHandle);

            profJobSet.Fetch(row);

            AreaNo = profJobSet.AreaNo;
            JobNo  = profJobSet.JobNo;
            ItemNo = profJobSet.ItemNo;

            Close();
        }
        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();
                }
            }
        }