Example #1
0
        public HomeViewModel()
        {
            _logic      = new EmpresaLogic();
            _loginLogic = new LoginLogic();

            IsWaiting = true;
            var login = _loginLogic.Get();

            IsWaiting = false;

            if (login == null)
            {
                List();
            }
            else
            {
                Init(login);
            }
        }
Example #2
0
        public ActionResult RenderLogoEmpresa()
        {
            // -- Obtengo usuario
            var usuario = SessionManager.Get <Usuario>(Global.SessionsKeys.USER_SESSION);
            // -- Obtengo empresa
            EmpresaLogic empresaLogic = new EmpresaLogic();
            var          empresa      = empresaLogic.GetByID(usuario.Empresa.EntityID);

            string appPath = HttpContext.Server.MapPath("~/Imagenes/LogosEmpresas/" + empresa.Imagen);

            // -- Valido que exista imagen de la empresa
            if (System.IO.File.Exists(appPath))
            {
                // -- Si existe la devuelvo
                return(PartialView("_RenderLogoEmpresa", "/Imagenes/LogosEmpresas/" + empresa.Imagen));
            }
            else
            {
                // -- Si no existe muestro la de fortius
                return(PartialView("_RenderLogoEmpresa", "/Imagenes/header-logo-fortius.png"));
            }
        }
Example #3
0
        public EmpresaLogic Obtener(float codigo)
        {
            EmpresaLogic entidadLogic = new EmpresaLogic();

            try
            {
                SQLServer.OpenConection();
                SQLServer.CreateCommand("SEG.USP_SEL_EMPRESA_OBTENER", CommandType.StoredProcedure,
                                        SQLServer.CreateParameter("CODIGO_EMPRESA", SqlDbType.BigInt, codigo));
                using (IDataReader oReader = SQLServer.GetDataReader(CommandBehavior.CloseConnection))
                {
                    entidadLogic = new GenericInstance <EmpresaLogic>().readDataReader(oReader);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                SQLServer.CloseConection();
            }
            return(entidadLogic);
        }
Example #4
0
 public EmpresaController(IConfiguration configuration)
 {
     _empresaLogic = new EmpresaLogic(configuration);
 }
Example #5
0
 public Int32 RegistrarEmpresa(EmpresaDC objDC)
 {
     EmpresaLogic objBC = new EmpresaLogic();
     return objBC.Empresa_Registrar(objDC);
 }
Example #6
0
 public EmpresaCollectionDC ListarEmpresaXRazonSocialXRUC(EmpresaDC objDC)
 {
     EmpresaLogic objBC = new EmpresaLogic();
     return EmpresaTL.TranslateEmpresaXRazonSocialXRUCToEmpresaCollectionDC(objBC.Empresa_ListarXRazonSocialXRUC(objDC.RazonSocial, objDC.RUC));
 }
Example #7
0
 public EmpresasController()
 {
     _logic = new EmpresaLogic();
 }
Example #8
0
        public ParceirosViewModel()
        {
            _logic = new EmpresaLogic();

            List();
        }