Exemplo n.º 1
0
        public void Init(int idsolution_interm, CTemplate_method_aa template_method_aa)
        {
            Idtemplate_method             = template_method_aa.Idtemplate_method;
            rgSelectGraphic.SelectedIndex = 1;

            CReactiveFactory faReactive  = new CReactiveFactory();
            List <CReactive> lstReactive = faReactive.GetAll();

            lstReactive.Add(new CReactive()
            {
                Idreactive = 0, Reactive_name = "---", Chemical_formula = "---"
            });

            cbMedium.Properties.DataSource    = lstReactive;
            cbMedium.Properties.ValueMember   = "Idreactive";
            cbMedium.Properties.DisplayMember = "Reactive_name";

            cbModif.Properties.DataSource    = lstReactive;
            cbModif.Properties.ValueMember   = "Idreactive";
            cbModif.Properties.DisplayMember = "Reactive_name";

            LstAllCalibs = new BindingList <CCustomCalibStd>(oModCalibStd.GetCustomCalibStd(idsolution_interm, template_method_aa));

            CSet_calibs oSet_calibs = new CSet_calibsFactory()
                                      .GetAll()
                                      .Where(x => x.Idsolution_interm == idsolution_interm &&
                                             x.Idtemplate_method == template_method_aa.Idtemplate_method &&
                                             x.Last_calib == true)
                                      .FirstOrDefault();

            if (oSet_calibs != null)
            {
                ucTraceUser1.UserSign = oSet_calibs.Usersign;
                ucTraceUser1.DateSign = Convert.ToDateTime(oSet_calibs.Datesign);
            }

            gcCalibStd.DataSource = LstAllCalibs;

            PlotChart();
        }
Exemplo n.º 2
0
        public void SaveCalibs(CSolution_interm pSolution_interm)
        {
            solution_interm = pSolution_interm;

            Date_init = Convert.ToDateTime(solution_interm.Date_begin);
            Date_end = Convert.ToDateTime(solution_interm.Date_end);

            UserSign = Comun.GetUser();
            DateSign = Comun.GetDate();

            //poner como historico la actual grupo de calibraciones
            CSet_calibs oSet_calib = oModCalibStd.GetSet_CalibBy(solution_interm.Idsolution_interm, idtemplate_method);

            if (oSet_calib != null)
            {
                oSet_calib.Last_calib = false;
                new CSet_calibsFactory().Update(oSet_calib);
            }

            // --- guardar la nueva calibración
            oSet_calib = new CSet_calibs();
            oSet_calib.Idset_calibs = 0;
            oSet_calib.Idtemplate_method = idtemplate_method;
            oSet_calib.Idsolution_interm = solution_interm.Idsolution_interm;
            oSet_calib.Datesign = Comun.GetDate();
            oSet_calib.Usersign = Comun.GetUser();
            oSet_calib.Last_calib = true;

            bool result_set_calib = new CSet_calibsFactory().Insert(oSet_calib);

            // --- guardar estandares de calibración
            if (result_set_calib)
            {
                for (int i = 0; i < gvCalibStd.RowCount; i++)
                {
                    CSet_calibsFactory faSet_calibs = new CSet_calibsFactory();

                    CCustomCalibStd customCalibStd = gvCalibStd.GetRow(i) as CCustomCalibStd;

                    // --- guardar calibración
                    CCalib_stdFactory faCalib_std = new CCalib_stdFactory();
                    CCalib_std oCalib_std = new CCalib_std();

                    oCalib_std = new CCalib_std();
                    oCalib_std.Idcalib = customCalibStd.Idcalib;
                    oCalib_std.Absorbance = customCalibStd.Absorbance;
                    oCalib_std.Concentration = customCalibStd.Concentration;
                    oCalib_std.Idset_calibs = oSet_calib.Idset_calibs;
                    oCalib_std.Idsolution_interm = solution_interm.Idsolution_interm;
                    oCalib_std.Idtemplate_method = idtemplate_method;

                    bool result_std = false;
                    if (!(result_std = faCalib_std.Update(oCalib_std)))
                        result_std = faCalib_std.Insert(oCalib_std);

                    if (result_std)
                        gvCalibStd.SetRowCellValue(i, gcCal_Idcalib_std, oCalib_std.Idcalib_std);
                }
            }
        }
Exemplo n.º 3
0
        public void Init(int idsolution_interm, CTemplate_method_aa template_method_aa)
        {
            Idtemplate_method = template_method_aa.Idtemplate_method;
            rgSelectGraphic.SelectedIndex = 1;

            CReactiveFactory faReactive = new CReactiveFactory();
            List<CReactive> lstReactive = faReactive.GetAll();

            lstReactive.Add(new CReactive() { Idreactive = 0, Reactive_name = "---", Chemical_formula = "---" });

            cbMedium.Properties.DataSource = lstReactive;
            cbMedium.Properties.ValueMember = "Idreactive";
            cbMedium.Properties.DisplayMember = "Reactive_name";

            cbModif.Properties.DataSource = lstReactive;
            cbModif.Properties.ValueMember = "Idreactive";
            cbModif.Properties.DisplayMember = "Reactive_name";

            LstAllCalibs = new BindingList<CCustomCalibStd>(oModCalibStd.GetCustomCalibStd(idsolution_interm, template_method_aa));

            CSet_calibs oSet_calibs = new CSet_calibsFactory()
                .GetAll()
                .Where(x => x.Idsolution_interm == idsolution_interm
                    && x.Idtemplate_method == template_method_aa.Idtemplate_method
                    && x.Last_calib == true)
                .FirstOrDefault();

            if (oSet_calibs != null)
            {
                ucTraceUser1.UserSign = oSet_calibs.Usersign;
                ucTraceUser1.DateSign = Convert.ToDateTime(oSet_calibs.Datesign);
            }

            gcCalibStd.DataSource = LstAllCalibs;

            PlotChart();
        }
Exemplo n.º 4
0
        public void SaveCalibs(CSolution_interm pSolution_interm)
        {
            solution_interm = pSolution_interm;

            Date_init = Convert.ToDateTime(solution_interm.Date_begin);
            Date_end  = Convert.ToDateTime(solution_interm.Date_end);

            UserSign = Comun.GetUser();
            DateSign = Comun.GetDate();

            //poner como historico la actual grupo de calibraciones
            CSet_calibs oSet_calib = oModCalibStd.GetSet_CalibBy(solution_interm.Idsolution_interm, idtemplate_method);

            if (oSet_calib != null)
            {
                oSet_calib.Last_calib = false;
                new CSet_calibsFactory().Update(oSet_calib);
            }

            // --- guardar la nueva calibración
            oSet_calib = new CSet_calibs();
            oSet_calib.Idset_calibs      = 0;
            oSet_calib.Idtemplate_method = idtemplate_method;
            oSet_calib.Idsolution_interm = solution_interm.Idsolution_interm;
            oSet_calib.Datesign          = Comun.GetDate();
            oSet_calib.Usersign          = Comun.GetUser();
            oSet_calib.Last_calib        = true;

            bool result_set_calib = new CSet_calibsFactory().Insert(oSet_calib);

            // --- guardar estandares de calibración
            if (result_set_calib)
            {
                for (int i = 0; i < gvCalibStd.RowCount; i++)
                {
                    CSet_calibsFactory faSet_calibs = new CSet_calibsFactory();

                    CCustomCalibStd customCalibStd = gvCalibStd.GetRow(i) as CCustomCalibStd;

                    // --- guardar calibración
                    CCalib_stdFactory faCalib_std = new CCalib_stdFactory();
                    CCalib_std        oCalib_std  = new CCalib_std();

                    oCalib_std                   = new CCalib_std();
                    oCalib_std.Idcalib           = customCalibStd.Idcalib;
                    oCalib_std.Absorbance        = customCalibStd.Absorbance;
                    oCalib_std.Concentration     = customCalibStd.Concentration;
                    oCalib_std.Idset_calibs      = oSet_calib.Idset_calibs;
                    oCalib_std.Idsolution_interm = solution_interm.Idsolution_interm;
                    oCalib_std.Idtemplate_method = idtemplate_method;

                    bool result_std = false;
                    if (!(result_std = faCalib_std.Update(oCalib_std)))
                    {
                        result_std = faCalib_std.Insert(oCalib_std);
                    }

                    if (result_std)
                    {
                        gvCalibStd.SetRowCellValue(i, gcCal_Idcalib_std, oCalib_std.Idcalib_std);
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void ucSignCalibStd_OnSign(bool login)
        {
            if (login)
            {
                if (oGroup_solution != null)
                {
                    // --- guardar calibraciones, grupo1, grupo2
                    CSet_methods_calibFactory faSet_methods_calib = new CSet_methods_calibFactory();
                    CSet_calibsFactory        faSet_calib         = new CSet_calibsFactory();
                    CCalib_stdFactory         faCalib_std         = new CCalib_stdFactory();

                    foreach (CCustomCalibStd item in LstAllCalibs)
                    {
                        CSet_calibsFactory faSet_calibs = new CSet_calibsFactory();

                        // --- recuperar fila modificada
                        CSet_calibs oSet_calib = faSet_calibs.GetByPrimaryKey(new CSet_calibsKeys(item.Idset_calibs));
                        if (oSet_calib == null)
                        {
                            oSet_calib = new CSet_calibs();
                            oSet_calib.Idset_calibs      = 0;
                            oSet_calib.Idtemplate_method = item.Idtemplate_method;
                            oSet_calib.Idset_calibs      = item.Idset_calibs;
                        }
                        oSet_calib.Idgroup_solution = oGroup_solution.Idgroup_solution;

                        bool result_set_calib = false;

                        // --- grupo de calibración
                        if (!(result_set_calib = faSet_calibs.Update(oSet_calib)))
                        {
                            result_set_calib = faSet_calibs.Insert(oSet_calib);
                        }

                        if (result_set_calib)
                        {
                            // --- guardar calibración
                            CCalib_std oCalib_std = new CCalib_std();

                            oCalib_std = faCalib_std.GetByPrimaryKey(new CCalib_stdKeys(item.Idcalib_std));

                            if (oCalib_std == null)
                            {
                                oCalib_std = new CCalib_std();
                            }

                            oCalib_std.Idcalib_std        = 0;
                            oCalib_std.Absorbance_previus = item.Absorbance;
                            oCalib_std.Concentration      = item.Concentration;
                            oCalib_std.Idcalib            = item.Idcalib;
                            oCalib_std.Idcalib_std        = item.Idcalib_std;
                            oCalib_std.Idset_calibs       = oSet_calib.Idset_calibs;

                            if (!faCalib_std.Update(oCalib_std))
                            {
                                faCalib_std.Insert(oCalib_std);
                            }
                        }
                    }

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                }
            }
            else
            {
            }
        }
Exemplo n.º 6
0
        private void ucSignCalibStd_OnSign(bool login)
        {
            if (login)
            {
                if (oGroup_solution != null)
                {
                    // --- guardar calibraciones, grupo1, grupo2
                    CSet_methods_calibFactory faSet_methods_calib = new CSet_methods_calibFactory();
                    CSet_calibsFactory faSet_calib = new CSet_calibsFactory();
                    CCalib_stdFactory faCalib_std = new CCalib_stdFactory();

                    foreach (CCustomCalibStd item in LstAllCalibs)
                    {
                        CSet_calibsFactory faSet_calibs = new CSet_calibsFactory();

                        // --- recuperar fila modificada
                        CSet_calibs oSet_calib = faSet_calibs.GetByPrimaryKey(new CSet_calibsKeys(item.Idset_calibs));
                        if (oSet_calib == null)
                        {
                            oSet_calib = new CSet_calibs();
                            oSet_calib.Idset_calibs = 0;
                            oSet_calib.Idtemplate_method = item.Idtemplate_method;
                            oSet_calib.Idset_calibs = item.Idset_calibs;
                        }
                        oSet_calib.Idgroup_solution = oGroup_solution.Idgroup_solution;

                        bool result_set_calib = false;

                        // --- grupo de calibración
                        if (!(result_set_calib = faSet_calibs.Update(oSet_calib)))
                            result_set_calib = faSet_calibs.Insert(oSet_calib);

                        if (result_set_calib)
                        {
                            // --- guardar calibración
                            CCalib_std oCalib_std = new CCalib_std();

                            oCalib_std = faCalib_std.GetByPrimaryKey(new CCalib_stdKeys(item.Idcalib_std));

                            if (oCalib_std == null)
                                oCalib_std = new CCalib_std();

                            oCalib_std.Idcalib_std = 0;
                            oCalib_std.Absorbance_previus = item.Absorbance;
                            oCalib_std.Concentration = item.Concentration;
                            oCalib_std.Idcalib = item.Idcalib;
                            oCalib_std.Idcalib_std = item.Idcalib_std;
                            oCalib_std.Idset_calibs = oSet_calib.Idset_calibs;

                            if (!faCalib_std.Update(oCalib_std))
                                faCalib_std.Insert(oCalib_std);
                        }
                    }

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                }
            }
            else
            {
            }
        }