Example #1
0
        public static bool Actualizar(Localidad objProxy)
        {
            ValidationException x = new ValidationException();
            if (objProxy.Ilocacion_id <= 0)
                x.AgregarError("Ingrese el código");

            if (string.IsNullOrEmpty(objProxy.Slocacion_nm))
                x.AgregarError("Ingrese el nombre");

            if (string.IsNullOrEmpty(objProxy.Slocacion_desc))
                x.AgregarError("Ingrese el descripcion");

            if (objProxy.Sstado)
                x.AgregarError("Ingrese el estado");

            if (objProxy.Isubarea <= 0)
                x.AgregarError("Ingrese el código Subarea");

            if (x.Cantidad > 0)
                throw x;
            DAOLocalidad daoProxy = new DAOLocalidad();
            return daoProxy.Actualizar(objProxy.Ilocacion_id, objProxy.Slocacion_nm, objProxy.Slocacion_desc, objProxy.Sstado, objProxy.Isubarea);
        }