Esempio n. 1
0
        void Show_batch()
        {
            // --- show trace groups
            gbApprove.Visible = false;
            gbReview.Visible = false;
            gv2col_Qaqc_approve.ImageIndex = 0;
            gv2col_Qaqc_review.ImageIndex = 0;

            // --- show template method
            ShowDilution();

            // --- show description method
            CBatchFactory faBatch = new CBatchFactory();
            CBatch oBatch = faBatch.GetByPrimaryKey(new CBatchKeys(Idbatch));
            laTitleModule.Text = String.Format("Bandeja {0} en Espera", Comun.FormatCorrelativeCode("B-", Convert.ToInt64(oBatch.Num_tray), 5));

            if (oBatch.Status_process == 'W')
            {
                ucSignCloseTray.Title = "Cerrar bandeja";
                ucSignCloseTray.Enabled = true;
                bgvBatchCalc2.OptionsBehavior.Editable = false;

            }
            if (oBatch.Status_process == 'P')
            {
                ucSignCloseTray.Title = "Cerrado("+oBatch.User_close_tray+")";
                ucSignCloseTray.Enabled = false;
                bgvBatchCalc2.OptionsBehavior.Editable = true;
            }

            CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory();
            oTemplate_method_current = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(Idtemplate_method));
            tbCodMethod.Text = oTemplate_method_current.Cod_template_method;
            tbTitle.Text = oTemplate_method_current.Title;
            tbAbbreviation.Text = oTemplate_method_current.Abbreviation;

            #region <optimizar>

            CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory();
            oTemplate_method_aa_current = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method));

            deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa_current.Date_allowed_error);

            CMr_detailFactory faMr_detail = new CMr_detailFactory();
            CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(oTemplate_method_aa_current.Idmr_detail)));
            tbLawMri.Text = oMr_detail.Nominal_value.ToString();

            CMrFactory faMr = new CMrFactory();
            CMr oMr = faMr.GetByPrimaryKey(new CMrKeys(
                Convert.ToInt16(oMr_detail.Idmr)
                ));
            tbMri.Text = oMr.Cod_mr;

            CMeasurement_unitFactory faMeasure = new CMeasurement_unitFactory();
            CMeasurement_unit oMeasurement_unit = faMeasure.GetByPrimaryKey(new CMeasurement_unitKeys(Convert.ToInt16(oMr_detail.Idunit1)));
            tbUnitMeasure.Text = oMeasurement_unit.Name_unit;

            #endregion

            // --- clear columns
            gcBachCalc.DataSource = null;

            // --- format the datatable with the number of repetitions
            oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Waiting, Comun.CriteriaSort.BySample);
            gcBachCalc.DataSource = oDataBatch.ListSamples;

            // --- show sd
            tbAbs.Value = oDataBatch.Absorbance;
            tbStd.Value = oDataBatch.StdVerification;
            tbAbs.BackColor = oDataBatch.ColorAbsorbance;
            tbStd.BackColor = oDataBatch.ColorStd;
            tbSdBlk.Text = oDataBatch.LrbMeasured.ToString();
            tbSdBlk.BackColor = oDataBatch.ColorLrbMeasured;
            tbSdMr.Text = oDataBatch.MriMeasured.ToString();
            tbSdMr.BackColor = oDataBatch.ColorMriMeasured;

            // --- show empty sample
            ShowParityEmptySample(false);
        }
Esempio n. 2
0
        void Show_batch_finished()
        {
            gbApprove.Visible = true;
            gbReview.Visible = true;
            gv2col_Qaqc_approve.ImageIndex = 0;
            gv2col_Qaqc_review.ImageIndex = 0;

            // --- show template method
            ShowDilution();

            // --- show description method
            CTemplate_methodFactory faTemplate_method = new CTemplate_methodFactory();
            CTemplate_method oTemplate_method = faTemplate_method.GetByPrimaryKey(new CTemplate_methodKeys(Idtemplate_method));
            tbCodMethod.Text = oTemplate_method.Cod_template_method;
            tbTitle.Text = oTemplate_method.Title;
            tbAbbreviation.Text = oTemplate_method.Abbreviation;

            // --- get batch trace_batch
            CTrace_batchFactory faTrace_batch = new CTrace_batchFactory();
            Dictionary<string, string> dtTrace_batch = new BusinessLayer.Modules.ModProcessBatch().GetCurrentAndBelow(Idbatch, LimsProcess.PROCESS_IN_READING);

            CBatchFactory faBatch = new CBatchFactory();
            CBatch oBatch = faBatch.GetByPrimaryKey(new CBatchKeys(Idbatch));
            laTitleModule.Text = String.Format("Bandeja {0} Aprobada\n ({1})"
                , "B-" + oBatch.Num_tray.ToString().PadLeft(5, '0')
                , dtTrace_batch["User_approved"].ToString());

            laUser_approved.Text = dtTrace_batch["User_approved"].ToString();
            laDate_approved.Text = dtTrace_batch["Date_approved"].ToString();
            laUser_revised.Text = dtTrace_batch["User_revised"].ToString();
            laDate_revised.Text = dtTrace_batch["Date_revised"].ToString();

            #region <optimizar>

            CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory();
            CTemplate_method_aa oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method));

            deDate_allowed_error.DateTime = Convert.ToDateTime(oTemplate_method_aa.Date_allowed_error);

            CMr_detailFactory faMr_detail = new CMr_detailFactory();
            CMr_detail oMr_detail = faMr_detail.GetByPrimaryKey(new CMr_detailKeys(Convert.ToInt16(oTemplate_method_aa.Idmr_detail)));
            tbLawMri.Text = oMr_detail.Nominal_value.ToString();

            CMrFactory faMr = new CMrFactory();
            CMr oMr = faMr.GetByPrimaryKey(new CMrKeys(
                Convert.ToInt16(oMr_detail.Idmr)
                ));
            tbMri.Text = oMr.Cod_mr;

            CMeasurement_unitFactory faMeasure = new CMeasurement_unitFactory();
            CMeasurement_unit oMeasurement_unit = faMeasure.GetByPrimaryKey(new CMeasurement_unitKeys(Convert.ToInt16(oMr_detail.Idunit1)));
            tbUnitMeasure.Text = oMeasurement_unit.Name_unit;

            #endregion

            // --- clear columns
            gcBachCalc.DataSource = null;

            // --- format the datatable with the number of repetitions
            if (cbAuthorizationApproved.EditValue.ToString() == "0000")
                oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Saved, Comun.CriteriaSort.BySample);
            else
                oDataBatch = new CDataBatch(Idbatch, Idtemplate_method, Comun.StatusWork.Management, Comun.CriteriaSort.BySample);

            gcBachCalc.DataSource = oDataBatch.ListSamples;

            // --- show sd
            tbAbs.Value = oDataBatch.Absorbance;
            tbStd.Value = oDataBatch.StdVerification;
            tbAbs.BackColor = oDataBatch.ColorAbsorbance;
            tbStd.BackColor = oDataBatch.ColorStd;
            tbSdBlk.Text = oDataBatch.LrbMeasured.ToString();
            tbSdBlk.BackColor = oDataBatch.ColorLrbMeasured;
            tbSdMr.Text = oDataBatch.MriMeasured.ToString();
            tbSdMr.BackColor = oDataBatch.ColorMriMeasured;

            // --- OPTIMIZAR A USER CONTROL
            paAuthorization.Visible = true;

            // --- show empty sample
            ShowParityEmptySample(true);
        }