コード例 #1
0
 public static void Eliminar(Framework.Models.Rol rol)
 {
     try
     {
         var br = new Rules.Rol();
         br.Eliminar(rol.IdRol);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
コード例 #2
0
 public static void Insertar(Framework.Models.Rol rol)
 {
     try
     {
         var br = new Rules.Rol();
         br.Insertar(rol);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
コード例 #3
0
        private void Validar(Framework.Models.Rol rol)
        {
            var mensaje = "";

            if (rol.Descripcion == "")
            {
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblDescripcion") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (mensaje != "")
            {
                throw new Exception(mensaje);
            }
        }
コード例 #4
0
        public void Modificar(Framework.Models.Rol rol)
        {
            try
            {
                //Valido la entidad antes.
                this.Validar(rol);

                //Actualizo el rol
                mapper.Update(rol);

                //Logueo la acción ejecutada.
                Logger.Log(Logger.LogAction.Modificar, _seccion, rol.IdRol, Logger.LogType.Info, "");
            }
            catch (Exception ex)
            {
                //Logueo la acción ejecutada.
                Logger.Log(Logger.LogAction.Modificar, _seccion, rol.IdRol, Logger.LogType.Exception, ex.Message);

                //Throw the exception to the controller.
                throw (ex);
            }
        }