예제 #1
0
        public void SetTypeErrorParity(CBatch_detail_aa_twofold current_row)
        {
            ///qaqc_error = (
            ///0:sin errores,
            ///1:sin error con texto,
            ///2:sin error con reensayo,
            ///3:con error no aprobado,
            ///4:con error aprobado con observacion,
            ///5:con error aprobado con reensayo
            ///

            // --- current status
            bool Flag_parity = false;
            bool Flag_approve_with_retest = false;
            bool Flag_approve_with_text   = false;

            Flag_parity = false;
            // 1=true, 2=false
            if (Convert.ToInt32(current_row.Qaqc_par) == 1)
            {
                Flag_parity = true;
            }

            Flag_approve_with_text = false;
            if (current_row.Qaqc_approve_text.Trim().Length > 0)
            {
                Flag_approve_with_text = true;
            }

            Flag_approve_with_retest = false;
            // Qaqc_idretest: >0 (idtemplate_method)
            if (Convert.ToBoolean(current_row.Qaqc_tmp_retest))
            {
                Flag_approve_with_retest = true;
            }

            if (Flag_parity)
            {
                current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithoutError);

                if (Flag_approve_with_text)
                {
                    current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithoutErrorWithText);
                }
                if (Flag_approve_with_retest)
                {
                    current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithoutErrorWithRetest);
                }
            }
            else
            {
                current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithErrorNotApproved);

                if (Flag_approve_with_text)
                {
                    current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithErrorApprovedWithText);
                }
                if (Flag_approve_with_retest)
                {
                    current_row.Qaqc_error = Comun.GetStatusErrorParity(Comun.StatusErrorParity.WithErrorApprovedWithRetest);
                }
            }
        }