Beispiel #1
0
        public ActionResult Index()
        {
            HomeModels data = new HomeModels();

            data = HomeLogic.getInstance().GetDashboard();
            return(View(data));
        }
Beispiel #2
0
 public HttpResponseMessage sendEmail()
 {
     return(new HttpResponseMessage(HttpStatusCode.OK)
     {
         Content = new ObjectContent <List <Email> >(HomeLogic.GetEmailDetailsQuery(), new JsonMediaTypeFormatter())
     });
 }
Beispiel #3
0
        public HomeController()
        {
            DbContextOptionsBuilder <DbContext> optionsBuilder = new DbContextOptionsBuilder <DbContext>();

            optionsBuilder.UseSqlServer(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=TorrentCheckLocalDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
            torrentRepository = new TorrentRepository(new TorrentContext(optionsBuilder.Options));
            logic             = new HomeLogic(torrentRepository);
        }
 /// <summary>Invoca al Procedimiento almacenado que lista Usuarios.</summary>
 /// <param name="objFiltro">Parámetros para el filtro de Listar las Usuarios</param>
 ///<remarks>
 ///<list type = "bullet">
 ///<item><CreadoPor>Bryan Luna Vasquez.</CreadoPor></item>
 ///<item><FecCrea>19/02/2018</FecCrea></item></list>
 ///<list type="bullet">
 /// <item><FecActu>XX/XX/XXXX.</FecActu></item>
 /// <item><Resp>Responsable.</Resp></item>
 /// <item><Mot>Motivo.</Mot></item></list></remarks>
 public HomeResponseDto ListaDatosHome(int depaId)
 {
     try
     {
         return(HomeLogic.ListaDatosHome(depaId));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #5
0
        public HttpResponseMessage UpdatePassword([FromBody] JObject data)
        {
            string userName    = (string)data["userName"];
            string oldpassword = (string)data["oldpassword"];
            string newPassord  = (string)data["newPassord"];

            return(HomeLogic.UpdatePassword(userName, oldpassword, newPassord) ?
                   new HttpResponseMessage(HttpStatusCode.OK) :
                   new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new ObjectContent <String>("The password dont currect", new JsonMediaTypeFormatter())
            });
        }
 public HomeController(
     ILogger <HomeController> logger,
     IGroupDescription groupDescription,
     IParticipation participation,
     IUserDescription userDescription,
     IRequestList requestList)
 {
     _logger           = logger;
     _groupDescription = groupDescription;
     _participation    = participation;
     _userDescription  = userDescription;
     _requestList      = requestList;
     _homeLogic        = new HomeLogic(_groupDescription, _participation, _userDescription, _requestList);
 }
Beispiel #7
0
        public static void Register(HttpConfiguration config)
        {
            var cors = new EnableCorsAttribute("*", "*", "*");

            config.EnableCors(cors);

            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { controller = "Default", id = RouteParameter.Optional }
                );
            HomeLogic.Notifications();
        }
Beispiel #8
0
        public HttpResponseMessage Login([FromBody] Worker worker)
        {
            Worker w = HomeLogic.Login(worker.UserName, worker.Password);

            if (w != null)
            {
                return new HttpResponseMessage(HttpStatusCode.OK)
                       {
                           Content = new ObjectContent <Worker>(w, new JsonMediaTypeFormatter())
                       }
            }
            ;
            else
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest)
                       {
                           Content = new ObjectContent <String>("Can not log in", new JsonMediaTypeFormatter())
                       }
            };
        }
 public HomeController(HomeLogic homeLogic)
 {
     this.homeLogic = homeLogic;
 }