public Boolean Validar()
        {
            try
            {
                Boolean _isCorrect = true;
                m_mensajeError      = "";
                CTAR_CodigoOK       = true;
                CTAR_CodigoMSGERROR = "";
                //if( CTAR_Codigo == null)
                //{
                //    _isCorrect = false;
                //    CTAR_CodigoOK  = false;
                //    CTAR_CodigoMSGERROR  = String.Format("Debe ingresar el {0} de la {1}.", "CTAR_Codigo", "Det_Tarifa_Servicio");
                //    m_mensajeError += "* Debe ingresar el campo CTAR_Codigo" + Environment.NewLine;
                //}
                CTAR_TipoOK         = true;
                CTAR_TipoMSGERROR   = "";
                TIPO_CodMndMSGERROR = "";
                DTAS_CostoMSGERROR  = "";
                if (String.IsNullOrEmpty(CTAR_Tipo))
                {
                    _isCorrect        = false;
                    CTAR_TipoOK       = false;
                    CTAR_TipoMSGERROR = String.Format("Debe ingresar el {0} del {1}.", "Tipo", "Detalle Tarifa Servicio");
                    m_mensajeError   += "* Debe ingresar el campo Tipo" + Environment.NewLine;
                }
                else
                {
                    if (CTAR_Tipo.Equals("A")) // Aduanero
                    {
                        if (TIPO_CodMnd == null)
                        {
                            _isCorrect          = false;
                            TIPO_CodMndMSGERROR = String.Format("Debe seleccionar el {0} del {1}.", "Tipo Moneda", "Detalle Tarifa Servicio");
                            m_mensajeError     += "* Debe seleccionar el campo Tipo Moneda" + Environment.NewLine;
                        }

                        if (DTAS_Costo == 0)
                        {
                            _isCorrect         = false;
                            DTAS_CostoMSGERROR = String.Format("Debe ingresar el {0} del {1}.", "Valor", "Detalle Tarifa Servicio");
                            m_mensajeError    += "* Debe ingresar el campo Valor" + Environment.NewLine;
                        }
                    }
                }

                SERV_CodigoMSGERROR = "";
                if (SERV_Codigo == null)
                {
                    _isCorrect          = false;
                    SERV_CodigoMSGERROR = String.Format("Debe seleccionar el {0} del {1}.", "Servicio", "Detalle Tarifa Servicio");
                    m_mensajeError     += "* Debe seleccionar  el campo Servicio" + Environment.NewLine;
                }
                OnPropertyChanged("MensajeError");
                return(_isCorrect);
            }
            catch (Exception ex)
            { throw ex; }
        }
Exemple #2
0
        public Boolean Validar()
        {
            try
            {
                Boolean _isCorrect = true;
                m_mensajeError      = "";
                CTAR_CodigoOK       = true;
                CTAR_CodigoMSGERROR = "";
                //if( CTAR_Codigo == null)
                //{
                //    _isCorrect = false;
                //    CTAR_CodigoOK  = false;
                //    CTAR_CodigoMSGERROR  = String.Format("Debe ingresar el {0} de la {1}.", "CTAR_Codigo", "Cab_Tarifa");
                //    m_mensajeError += "* Debe ingresar el campo CTAR_Codigo" + Environment.NewLine;
                //}
                CTAR_NumeroOK       = true;
                CTAR_NumeroMSGERROR = "";
                //if( String.IsNullOrEmpty(CTAR_Numero) )
                //{
                //    _isCorrect = false;
                //    CTAR_NumeroOK  = false;
                //    CTAR_NumeroMSGERROR  = String.Format("Debe ingresar el {0} de la {1}.", "CTAR_Numero", "Cab_Tarifa");
                //    m_mensajeError += "* Debe ingresar el campo CTAR_Numero" + Environment.NewLine;
                //}
                CTAR_ProfitMSGERROR = "";
                if (CTAR_Profit == null && CTAR_Tipo != "L")
                {
                    _isCorrect          = false;
                    CTAR_ProfitMSGERROR = String.Format("Debe ingresar el {0} de la {1}.", "Profit", "Tarifa");
                    m_mensajeError     += "* Debe ingresar el campo Profit" + Environment.NewLine;
                }
                CTAR_DescripOK       = true;
                CTAR_DescripMSGERROR = "";
                if (String.IsNullOrEmpty(CTAR_Descrip))
                {
                    _isCorrect           = false;
                    CTAR_DescripOK       = false;
                    CTAR_DescripMSGERROR = String.Format("Debe ingresar la {0} de la {1}.", "Descripción", "Tarifa");
                    m_mensajeError      += "* Debe ingresar una descripción" + Environment.NewLine;
                }
                CTAR_FecEmiOK       = true;
                CTAR_FecEmiMSGERROR = "";
                if (CTAR_FecEmi == null)
                {
                    _isCorrect          = false;
                    CTAR_FecEmiOK       = false;
                    CTAR_FecEmiMSGERROR = String.Format("Debe seleccionar la {0} de la {1}.", "Fecha de Emisión", "Tarifa");
                    m_mensajeError     += "* Debe seleccionar la fecha de emisión" + Environment.NewLine;
                }
                else
                {
                    if (CTAR_FecIni < CTAR_FecEmi)
                    {
                        _isCorrect          = false;
                        CTAR_FecEmiMSGERROR = String.Format("La fecha de inicio de vigencia no puede ser menor a la fecha de emisión.");
                        m_mensajeError     += "* La fecha de inicio de vigencia no puede ser menor a la fecha de emisión." + Environment.NewLine;
                    }
                }

                CTAR_FecIniOK       = true;
                CTAR_FecIniMSGERROR = "";
                if (CTAR_FecIni == null)
                {
                    _isCorrect          = false;
                    CTAR_FecIniOK       = false;
                    CTAR_FecIniMSGERROR = String.Format("Debe seleccionar la {0} de la {1}.", "Fecha de Inicio", "Tarifa");
                    m_mensajeError     += "* Debe seleccionar la fecha de inicio" + Environment.NewLine;
                }
                CTAR_FecFinOK       = true;
                CTAR_FecFinMSGERROR = "";
                if (CTAR_FecFin == null)
                {
                    _isCorrect          = false;
                    CTAR_FecFinOK       = false;
                    CTAR_FecFinMSGERROR = String.Format("Debe seleccionar la {0} de la {1}.", "Fecha de Fin", "Tarifa");
                    m_mensajeError     += "* Debe seleccionar la fecha fin" + Environment.NewLine;
                }
                if (CTAR_FecFin < CTAR_FecIni)
                {
                    _isCorrect          = false;
                    CTAR_FecFinMSGERROR = String.Format("La fecha de fin de vigencia no puede ser menor al inicial.");
                    m_mensajeError     += "* La fecha de fin de vigencia no puede ser menor al inicial." + Environment.NewLine;
                }
                CTAR_TipoOK       = true;
                CTAR_TipoMSGERROR = "";
                if (String.IsNullOrEmpty(CTAR_Tipo))
                {
                    _isCorrect        = false;
                    CTAR_TipoOK       = false;
                    CTAR_TipoMSGERROR = String.Format("Debe ingresar el {0} de la {1}.", "Tipo de Tarifario", "Tarifa");
                    m_mensajeError   += "* Debe ingresar el campo Tipo de Tarifario" + Environment.NewLine;
                }
                CTAR_MontoLNavieraOK       = true;
                CTAR_MontoLNavieraMSGERROR = "";
                if (CTAR_MontoLNaviera == null)
                {
                    _isCorrect                 = false;
                    CTAR_MontoLNavieraOK       = false;
                    CTAR_MontoLNavieraMSGERROR = String.Format("Debe ingresar el {0} de la {1}.", "Monto de la Linea Naviera", "Tarifa");
                    m_mensajeError            += "* Debe ingresar el campo Monto de la Linea Naviera" + Environment.NewLine;
                }
                CTAR_MontoDTemporalOK       = true;
                CTAR_MontoDTemporalMSGERROR = "";
                if (CTAR_MontoDTemporal == null)
                {
                    _isCorrect                  = false;
                    CTAR_MontoDTemporalOK       = false;
                    CTAR_MontoDTemporalMSGERROR = String.Format("Debe ingresar el {0} de la {1}.", "Monto del Depósito Temporal", "Tarifa");
                    m_mensajeError             += "* Debe ingresar el campo Monto del Depósito Temporal" + Environment.NewLine;
                }
                TIPO_CodMndMSGERROR = "";
                if (string.IsNullOrEmpty(TIPO_CodMnd))
                {
                    _isCorrect          = false;
                    TIPO_CodMndMSGERROR = String.Format("Debe seleccionar un {0} para la {1}.", "Tipo de Moneda", "Tarifa");
                    m_mensajeError     += "* Debe seleccionar un Tipo de Moneda" + Environment.NewLine;
                }
                CONS_CodRegMSGERROR = "";
                if (CTAR_Tipo.Equals("L"))
                {
                    if (string.IsNullOrEmpty(CONS_CodReg))
                    {
                        _isCorrect          = false;
                        CONS_CodRegMSGERROR = String.Format("Debe seleccionar un {0} para la {1}.", "Tipo de Regimen", "Tarifa");
                        m_mensajeError     += "* Debe seleccionar un Tipo de Regimen" + Environment.NewLine;
                    }
                }
                ENTC_CodigoMSGERROR = "";
                if (ENTC_Codigo == null)
                {
                    _isCorrect          = false;
                    ENTC_CodigoMSGERROR = String.Format("Debe ingresar el {0} de la {1}.", "Tipo de Entidad", "Tarifa");
                    m_mensajeError     += "* Debe ingresar el campo Tipo de Entidad" + Environment.NewLine;
                }
                OnPropertyChanged("MensajeError");
                return(_isCorrect);
            }
            catch (Exception ex)
            { throw ex; }
        }