Ejemplo n.º 1
0
        public ActionResult UserLogin(LoginDetails loginDetails)
        {
            ReleaseManagementContext context = new ReleaseManagementContext();
            LoginDetails             user    = context.loginDetails
                                               .FirstOrDefault(ud => ud.UserName == loginDetails.UserName && ud.Password == loginDetails.Password);

            if (user != null)
            {
                TempData["username"] = loginDetails.UserName;
                TempData["role"]     = user.Role;
                return(RedirectToAction("Index", "Student"));
            }
            return(View());
        }
Ejemplo n.º 2
0
        public IHttpActionResult Get()
        {
            using (var db = new ReleaseManagementContext()) {
                var releaseCutoffDay = DateTime.Now.AddDays(-5);

                var releases = db.Releases.Include(p => p.Client).Include(p => p.ReleasePlatforms)
                               .Include(p => p.Features)
                               .Include(p => p.WorkItems)
                               .Where(p => p.StatusCode != "completed")
                               //.Where(p => p.ReleaseDate > releaseCutoffDay)
                               .OrderBy(p => p.ReleaseDate).ToList();
                return(Ok(releases));
            }
        }
        // GET: api/Reports
        public IHttpActionResult Get()
        {
            using (var context = new ReleaseManagementContext())
            {
                var releases = context.Releases
                               .Include(p => p.Client)
                               .Where(p => p.StatusCode == "completed")
                               .GroupBy(p => p.ClientId)
                               .Select(grp => new
                {
                    grp.Key,
                    release = grp.OrderByDescending(p => p.ReleaseDate)
                              .Select(p => new { p.ApplicationVersion, p.Client.ClientName, p.StatusCode, p.ReleaseDate, p.ReleaseId })
                              .FirstOrDefault()
                }).ToList();

                return(Ok(releases));
            }
        }