Пример #1
0
        public ActionResult CourseDetails(int CID, int YID, string course)
        {
            var dataContext = new lb3dataDataContext();

            var data = from c in dataContext.Holes
                       where c.CourseID == CID
                       where c.YearID == YID
                       orderby c.HoleNum ascending
                       select c;

            var data_group = from c in dataContext.Groups
                       where c.CourseID == CID
                       where c.YearID == YID
                       //orderby u.Timestamp descending
                       select c;

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            ViewData["Course"] = course;

            ViewData["Year"] = year;
            ViewData["Holes"] = data;
            ViewData["Groups"] = data_group;
            ViewData["CourseID"] = CID;
            ViewData["YID"] = YID;
                //topqa_ad.Union(topqa.Take(5 - admin_ct)).OrderBy(t => t.Marks.First().Timestamp);
            return View("CourseDetails");
        }
Пример #2
0
        public ActionResult CourseCard(int CID, int YID, string course, int GID)
        {
            var dataContext = new lb3dataDataContext();
            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();
            ViewData["Course"] = course;
            ViewData["Year"] = year;

            var data = from c in dataContext.UserGroups
                       where c.GID == GID

                       //orderby u.Timestamp descending
                       select c;

            var hole_data = from c in dataContext.Courses
                       where c.CID == CID
                       where c.YID == YID

                       //orderby u.Timestamp descending
                       select c;

            ViewData["Card"] = data;
            ViewData["holes"] = hole_data;

            return View("CourseCard");
        }
Пример #3
0
        public ActionResult AddTourn()
        {
            var dataContext = new lb3dataDataContext();
            var data = from c in dataContext.UserGroups
                       where c.UserID == 2
                       orderby c.Group.Year.Name ascending
                       select c;

            return View();
        }
Пример #4
0
        public IEnumerable<Hole> GetHolesForCoursess(int CID, int YID)
        {
            var dataContext = new lb3dataDataContext();

            var comment = from a in dataContext.Holes
                          where a.CourseID == CID
                          where a.YearID == YID
                          select a;

            return (comment);
        }
Пример #5
0
        //view course ua holes +
        public ActionResult AddCourseUAholes(int id, string CourseName)
        {
            var dataContext = new lb3dataDataContext();

               var data = from c in dataContext.HoleUAs
                       where c.CourseUAID == id
                       orderby c.HoleNum ascending
                       select c;

            ViewData["Holes"] = data;
            ViewData["CourseName"] = CourseName;
            ViewData["UAHoles"] = data;

            ViewData["CUAID"] = id;

            return View("AddCourseUAholes");
        }
Пример #6
0
        public int checkScore(int HoleID, int YID, int UserID)
        {
            var dataContext = new lb3dataDataContext();

            var comment = from a in dataContext.Scores
                          where a.HoleID == HoleID
                          where a.YearID == YID
                          where a.UserID == UserID
                          select a;

            var next = from a in dataContext.Scores
                          where a.HoleID == (HoleID - 1)
                          where a.YearID == YID
                          where a.UserID == UserID
                          select a;

            var score = 0;
            try
            {
                //hole has a score
                score = Convert.ToInt32(comment.First().Score1);
            }
            catch
            {

                try
                {
                    score = Convert.ToInt32(next.First().Score1);
                    if (score > 0)
                    {
                        score = 0;
                    }

                }
                catch
                {

                    score = -1;
                }
            }
            return score;
        }
Пример #7
0
        public ActionResult Hole(int YID, int CID, int GID, string course)
        {
            var dataContext = new lb3dataDataContext();

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            var group = from c in dataContext.Groups
                       where c.GID == GID
                       select c;

            var data = from c in dataContext.Holes
                       where c.CourseID == CID
                       where c.YearID == YID
                       select c;

            var holedataJ = from c in dataContext.Holes
                            where c.CourseID == CID
                            where c.YearID == YID
                            select new
                            {
                                HoleID = c.HoleID,
                                HoleNum = c.HoleNum,
                                HolePin = c.N_pin,
                                HoleLD = c.L_drive,
                                Par = c.Par
                                //Scre = (from s in dataContext.Scores where s.HoleID == c.HoleID && s.UserID == user
                            };

            var scoredataJ = from c in dataContext.Scores
                            where c.YearID == YID
                            select new
                            {
                                UserID = c.UserID,
                                Score = c.Score1,
                                HID = c.HoleID,
                                ScoreID = c.ScID
                            };

            var grouplistJ = from y in db.UserGroups
                            where y.GID == GID
                            select new
                            {
                                Nickname = y.User.Nickname,
                                UserID = y.UserID

                            };

            var grouplist = from y in db.UserGroups
                            where y.GID == GID
                            select new
                            {
                                name = y.User.Nickname

                            };

            var gplist = "";
            int gpint = 0;

            System.Collections.Generic.List<string> UserArray = new System.Collections.Generic.List<string>();

            foreach (var sc in grouplist)
            {
                //UserArray.Add(sc.name);
                //UserArray.Add(Convert.ToString(sc.userid));

                if (gpint == (grouplist.Count() -1))
                {
                    gplist = gplist + " and " + sc.name;
                }
                else if (gpint == 0)
                {
                    gplist = sc.name;
                }

                else
                {
                    gplist = gplist + ", " + sc.name;
                }

                gpint++;
            }

                var nexthole = from h in dataContext.Holes
                               where h.HoleNum == 1
                               where h.YearID == YID
                               where h.CourseID == CID
                               select h;
                var NextHoleID = nexthole.First().HoleID;

            string jsonUsers = JsonConvert.SerializeObject(grouplistJ.ToArray());
            string jsonHoleData = JsonConvert.SerializeObject(holedataJ.ToArray());
            string jsonScoreData = JsonConvert.SerializeObject(scoredataJ.ToArray());

            ViewData["YearID"] = YID;
            ViewData["Year"] = year;
            ViewData["GID"] = GID;
            ViewData["CID"] = CID;
            ViewData["course"] = course;
            ViewData["Group"] = group.First().GroupName;
            ViewData["GroupCount"] = grouplist.Count();
            ViewData["names"] = gplist;
            ViewData["NextHoleID"] = NextHoleID;
            ViewData["HoleCount"] = data.Count();
            ViewData["JSONnames"] = jsonUsers;
            ViewData["JSONHoleData"] = jsonHoleData;
            ViewData["JSONScoreData"] = jsonScoreData;

            return View("Hole", data);
        }
Пример #8
0
        public ActionResult CourseDetails(FormCollection formCollection)
        {
            var dataContext = new lb3dataDataContext();

            int UACourseID = Convert.ToInt32(formCollection["UACourseID"]);
            var TournName = formCollection["tname"];
            var CourseName = formCollection["CourseName"];
            int OwnerID = Convert.ToInt32(formCollection["OwnerID"]);
            int ST = 5;
            DateTime Date = DateTime.Today;//Convert.ToDateTime(formCollection["Date"]);
            int Yr = Date.Year;
            int YID = dataRepository.SaveNewYear(TournName, Date, Yr, OwnerID);
            int CID = dataRepository.SaveNewTournCourse(CourseName, YID, ST);

            var holeList = (from u in dataContext.HoleUAs
                            where u.CourseUAID == UACourseID
                            orderby u.HoleNum ascending
                            select new
                            {
                                holenum = u.HoleNum,
                                par = u.Par,
                                SIndx = u.SI,

                            }).ToArray();

            foreach (var item in holeList)
            {
                var Pin = formCollection["pin"];
                var LD = formCollection["drive"];
                //Pin = pin_1

                var PinID = "pin_" + item.holenum;
                var LDID = "drive_" + item.holenum;
                //var LD = formCollection[LDID];
                //var Pin = formCollection[PinID];
                int LDval = 0;
                int Pinval = 0;
                if (LD == LDID)
                {
                    LDval = 1;
                }

                if (Pin == PinID)
                {
                    Pinval = 1;
                }

                dataRepository.SaveNewHole(CID, YID, item.holenum, item.par, Pinval, LDval, item.SIndx);
            }
            var data = from c in dataContext.Holes
                       where c.CourseID == CID
                       where c.YearID == YID
                       orderby c.HoleNum ascending
                       select c;

            var data_group = from c in dataContext.Groups
                       where c.CourseID == CID
                       where c.YearID == YID
                       //orderby u.Timestamp descending
                       select c;

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            ViewData["Course"] = CourseName;

            ViewData["Year"] = year;
            ViewData["Holes"] = data;
            ViewData["Groups"] = data_group;
            ViewData["CourseID"] = CID;
            ViewData["CID"] = CID;
            ViewData["YID"] = YID;
            ViewData["Tname"] = TournName;
            ViewData["Date"] = Date;

            var userList = (from u in dataContext.Users
                            orderby u.Name ascending

                            select new
                            {
                                name = u.Name,
                                id = u.UserID,

                            }).ToArray();

            var dd_items = "";

            dd_items = "<option>Select User</option>";

            foreach (var item in userList)
            {
                dd_items = dd_items + "<option value=" + item.id + ">" + item.name + "</option>";
            }

            ViewData["dd_vals"] = dd_items;

            return RedirectToAction("MyTourn", new { UserID = OwnerID });
            //return View("CourseDetails");
        }
Пример #9
0
        public ActionResult MyTourn(int UserID)
        {
            var dataContext = new lb3dataDataContext();
            var data = from c in dataContext.Years
                       where c.OwnerID == UserID
                       //orderby c.Group.Year.Name ascending
                       select c;

            return View("MyTourn", data);
        }
Пример #10
0
        //public ActionResult HolePartialEdit(int HoleID)
        // {
        //     var dataContext = new lb3dataDataContext();
        //     Hole hole = dataRepository.GetHole(HoleID);
        //     return PartialView("HolePartialEdit", hole);
        // }
        public PartialViewResult HoleUAPartialNew(int CUAID)
        {
            var dataContext = new lb3dataDataContext();
            int next = 1;
            try
            {

                var data = from c in dataContext.HoleUAs
                           orderby c.HoleNum descending
                           where c.CourseUAID == CUAID
                           select c;

                next = Convert.ToInt32(data.First().HoleNum) + 1;
            }
            catch
            {

            }
            //Hole hole = dataRepository.GetHole(HoleID);
            ViewData["CUAID"] = CUAID;
            ViewData["NextNum"] = next;
            return PartialView("HoleUAPartialNew");
        }
Пример #11
0
        public ActionResult Login()
        {
            var dataContext = new lb3dataDataContext();

            var userList = from u in dataContext.Users
                           orderby u.Name ascending
                           select u;

            return View("Login", userList);
        }
Пример #12
0
        public ActionResult getAllEvents()
        {
            var dataContext = new lb3dataDataContext();

            var allevents = from e in dataContext.Events
                               orderby e.Timestamp descending
                               select new
                               {
                                   UserID = e.UserID,
                                   Comment = e.Comment,
                                   Name = e.Name,
                                   Timest = Convert.ToDateTime(e.Timestamp).ToShortTimeString(),
                                   EID = e.EID,
                                   type = e.Type
                               };

            return Json(new { events = allevents });
        }
Пример #13
0
        public ActionResult getLatestEvents(int EID)
        {
            var dataContext = new lb3dataDataContext();

              //  if (EID > 0) //not first load
               //     {

                var allevents = from e in dataContext.Events
                                orderby e.Timestamp ascending
                                where e.EID > EID
                                select new
                                {
                                    UserID = e.UserID,
                                    Comment = e.Comment,
                                    Name = e.Name,
                                    Timest = Convert.ToDateTime(e.Timestamp).ToShortTimeString(),
                                    EID = e.EID,
                                    type = e.Type
                                };

                var speech_item = from e in dataContext.Events
                                orderby e.Timestamp descending
                                where e.EID > EID && e.Speech != null
                                select new
                                {
                                    speech = e.Speech
                                };

              //  if (allevents.Count() > 0)
              //  {

                return Json(new { events = allevents, speech = speech_item.Take(2) }, JsonRequestBehavior.AllowGet);

             //   }
             //   else
            //    {
            //        return Json(new { events = "none", speech = "none" }, JsonRequestBehavior.AllowGet);
            //    }

             //   }
             //   else
             ///   {

               //     return Json(new { events = "none" }, JsonRequestBehavior.AllowGet);
              //  }
        }
Пример #14
0
        //used
        public ActionResult EventsFeed()
        {
            var dataContext = new lb3dataDataContext();

            var allevents = from e in dataContext.Events
                            orderby e.Timestamp descending
                            select e;

            return PartialView("EventsPartial", allevents.Take(1));
        }
Пример #15
0
        public PartialViewResult EventsPartial2()
        {
            var dataContext = new lb3dataDataContext();

            var data = from c in dataContext.Events
                       //where c.CourseID == CID
                       orderby c.Timestamp descending
                       select c;

            return PartialView("EventsPartial2", data.Take(1));
        }
Пример #16
0
        public ActionResult CourseUA()
        {
            var dataContext = new lb3dataDataContext();
             var courseUA = from c in dataContext.CourseUAs
                            orderby c.CourseName
                            select c;

            return View("CourseUA", courseUA);
        }
Пример #17
0
        public ActionResult CourseHolesView(int YID)
        {
            var dataContext = new lb3dataDataContext();

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            var data = from c in dataContext.Courses
                       where c.YID == YID
                       //orderby u.Timestamp descending
                       select c;

            ViewData["YearID"] = YID;
            ViewData["Year"] = year;

            return View("CourseHolesView", data);
        }
Пример #18
0
        public ActionResult CourseDetails_o(int CID, int YID, string CourseName)
        {
            var dataContext = new lb3dataDataContext();

            int ST = 5;
            DateTime Date = DateTime.Today;//Convert.ToDateTime(formCollection["Date"]);
            int Yr = Date.Year;
            var data = from c in dataContext.Holes
                       where c.CourseID == CID
                       where c.YearID == YID
                       orderby c.HoleNum ascending
                       select c;

            var data_group = from c in dataContext.Groups
                             where c.CourseID == CID
                             where c.YearID == YID
                             //orderby u.Timestamp descending
                             select c;

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            ViewData["Course"] = CourseName;

            ViewData["Year"] = year;
            ViewData["Holes"] = data;
            ViewData["Groups"] = data_group;
            ViewData["CourseID"] = CID;
            ViewData["YID"] = YID;
            ViewData["Tname"] = "t name";
            ViewData["Date"] = Date;

            var userList = (from u in dataContext.Users
                            orderby u.Name ascending

                            select new
                            {
                                name = u.Name,
                                id = u.UserID,

                            }).ToArray();

            var dd_items = "";

            dd_items = "<option>Select User</option>";

            foreach (var item in userList)
            {
                dd_items = dd_items + "<option value=" + item.id + ">" + item.name + "</option>";
            }

            ViewData["dd_vals"] = dd_items;

            return View("CourseDetails");
        }
Пример #19
0
        public ActionResult HoleCard(int CID, int YID, string course, int GID, int HoleID)
        {
            var dataContext = new lb3dataDataContext();
            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            var hole = from h in dataContext.Holes
                       where h.HoleID == HoleID
                       select h;

            var par = hole.First().Par;

            var HoleNum = hole.First().HoleNum;

            try
            {
                var nexthole = from h in dataContext.Holes
                               where h.HoleNum == HoleNum + 1
                               where h.YearID == YID
                               where h.CourseID == CID
                               select h;
                var NextHoleID = nexthole.First().HoleID;
                ViewData["NextHoleID"] = NextHoleID;

                ViewData["NextHole"] = HoleNum + 1;
            }
            catch
            {
                ViewData["NextHoleID"] = null;
            }
            ViewData["Course"] = course;
            ViewData["Year"] = year;
            ViewData["HID"] = HoleID;
            ViewData["GID"] = GID;
            ViewData["CID"] = CID;
            ViewData["YID"] = YID;
            ViewData["HoleNum"] = HoleNum;
            ViewData["Par"] = par;

            var pin = (from p in dataContext.Holes
                               where p.HoleID == HoleID
                               select p.N_pin).First();

            ViewData["Pin"] = pin;

            var ld = (from p in dataContext.Holes
                                  where p.HoleID == HoleID
                                  select p.L_drive).First();

            ViewData["LD"] = ld;

            if (pin == 1)
            {

                try
                {
                    var pinuser = (from p in dataContext.Scores
                                   where p.HoleID == HoleID
                                   where p.PinUserID != null
                                   select p.PinUserID).First();
                    if (pinuser == null)
                        {
                            ViewData["PinUser"] = 0;
                        }
                        else
                        {
                            ViewData["PinUser"] = pinuser;
                    }
                }
                catch
                {

                }

            }

            if (ld == 1)
            {

                try
                {
                    var lduser = (from p in dataContext.Scores
                                   where p.HoleID == HoleID
                                   where p.DriveUserID != null
                                  select p.DriveUserID).First();
                    if (lduser == null)
                    {
                        ViewData["LDUser"] = 0;
                    }
                    else
                    {
                        ViewData["LDUser"] = lduser;
                    }
                }
                catch
                {

                }

            }

            var data = from c in dataContext.UserGroups
                       where c.GID == GID
                       select c;

            return View("HoleCard", data);
        }
Пример #20
0
        public ActionResult GetLocalTourn(int CID, int YID)
        {
            var dataContext = new lb3dataDataContext();

            var data = from c in dataContext.Years
                       where c.YID == YID
                       orderby c.Name ascending
                       select c;
            ViewData["CID"] = CID;
            ViewData["YID"] = YID;
            return PartialView("PasscodeResults", data);
        }
Пример #21
0
        public ActionResult Users()
        {
            var dataContext = new lb3dataDataContext();

            var userList = from u in dataContext.Users
                           orderby u.Name ascending
                           select u;
            ViewData["Users"] = userList;
            return View("Users");
        }
Пример #22
0
        public JsonResult getMiniLB(int CID, int YID, int HoleNum)
        {
            var dataContext = new lb3dataDataContext();
            //gp
            var miniLBdata = from r in dataContext.Scores
                            where r.Hole.CourseID == CID
                            where r.YearID == YID
                       orderby r.Score1 descending
                       group r by new {
                           r.User.Nickname,
                           //r.Hole.CourseID,
                          // r.Hole.Par
                          // r.Description
                       } into g
                       orderby g.Sum(s => s.Score1)

                       select new {
                              //g.Key..Category,
                              g.Key.Nickname,
                              TotalScore = g.Sum(x => x.Score1),
                              //CID = g.Key.CourseID,
                              Pars = g.Sum(x => x.Hole.Par),

                              //get sum of all completed holes for pars

                        };

             //take sum of scores

            return Json(new { miniLBdata });
        }
Пример #23
0
        public ActionResult Index()
        {
            var dataContext = new lb3dataDataContext();

            var data = from c in dataContext.Events
                       //where c.CourseID == CID
                       orderby c.Timestamp descending
                        select c;

            ViewData["Holes"] = data.Take(1);

            return View("Front");
        }
Пример #24
0
        public ActionResult YearGroups(int YID)
        {
            var dataContext = new lb3dataDataContext();

            var data = from y in dataContext.Groups
                       where y.YearID == YID
                       //orderby u.Timestamp descending
                       select y;

            //var message = Convert.ToString(data.First().Timestamp) + ": " + data.First().Comment;

            return View();
        }
Пример #25
0
        public ActionResult MyCourseDetails()
        {
            var dataContext = new lb3dataDataContext();

            var data = from c in dataContext.Years
                       where c.OwnerID == 2
                       orderby c.Name ascending
                       select c;

            return View("MyCourseDetails", data);
        }
Пример #26
0
        public PartialViewResult GroupPartialNew(int CID, int YID)
        {
            var dataContext = new lb3dataDataContext();

            //Hole hole = dataRepository.GetHole(HoleID);
            ViewData["CID"] = CID;
            ViewData["YID"] = YID;
            return PartialView("GroupPartialNew");
        }
Пример #27
0
        public JsonResult newScore(int GID, int YID, int HID, int UserID, int score, int Pin, int LD)
        {
            var dataContext = new lb3dataDataContext();

            var otherplayers = from users in dataContext.UserGroups
                               where users.GID == GID
                               where users.UserID != UserID
                               select new
                               {
                                   UserID = users.UserID
                               };

            var HoleData = from h in dataContext.Holes
                           where h.HoleID == HID
                           select h;

            var HoleNum = HoleData.First().HoleNum;

            var CID = HoleData.First().CourseID;

            var winner = from users in dataContext.Users
                               where users.UserID == UserID
                               select users;

            var ck_score = from s in dataContext.Scores
                     where s.YearID == YID
                     where s.UserID == UserID
                     where s.HoleID == HID
                     select s;

            var ck_pin = from s in dataContext.Scores
                           where s.YearID == YID
                           where s.PinUserID == UserID
                           where s.HoleID == HID
                           select s;

            var ck_LD = from s in dataContext.Scores
                         where s.YearID == YID
                         where s.DriveUserID == UserID
                         where s.HoleID == HID
                         select s;
            var type = "";
            if (ck_score.Count() == 1 || ck_pin.Count() == 1 || ck_LD.Count() == 1)
            {
                //update stuff
                type = "Updated";
                if (score > 0)
                {
                    dataRepository.UpdateScore(ck_score.First().ScID, score);
                }
                else
                {
                    if (Pin == 1)
                    {
                        dataRepository.ResetPin(YID, HID);
                        dataRepository.UpdatePin(ck_score.First().ScID, UserID);
                        dataRepository.CheckScorePLD(HID, UserID, "Pin");
                    }

                    if (LD == 1)
                    {
                        dataRepository.ResetLD(YID, HID);
                        dataRepository.UpdateLD(ck_score.First().ScID, UserID);
                        dataRepository.CheckScorePLD(HID, UserID, "LD");
                    }

                }
            }
            else
            {
                //insert stuff
                type = "Saved";
                if (Pin == 1)
                {
                    dataRepository.ResetPin(YID, HID);
                    Score sc = new Score();
                    sc.PinUserID = UserID;
                    sc.UserID = UserID;
                    sc.YearID = YID;
                    sc.HoleID = HID;
                    sc.GID = GID;
                    dataRepository.Add(sc);
                    dataRepository.Save();
                    dataRepository.CheckScore(0, GID, YID, HID, UserID);
                    dataRepository.CheckScorePLD(HID, UserID, "Pin");
                }
                else if (LD == 1)
                {
                    dataRepository.ResetLD(YID, HID);
                    Score sc = new Score();
                    sc.DriveUserID = UserID;
                    sc.UserID = UserID;
                    sc.YearID = YID;
                    sc.HoleID = HID;
                    sc.GID = GID;
                    dataRepository.Add(sc);
                    dataRepository.Save();
                    dataRepository.CheckScore(0, GID, YID, HID, UserID);
                    dataRepository.CheckScorePLD(HID, UserID, "LD");
                }
                else
                {
                    Score sc = new Score();
                    sc.HoleID = HID;
                    sc.YearID = YID;
                    sc.GID = GID;
                    sc.UserID = UserID;
                    sc.Score1 = score;

                    dataRepository.Add(sc);
                    dataRepository.Save();
                    dataRepository.CheckScore(0, GID, YID, HID, UserID);

                }
            }
            if (type == "Saved")
            {
                return Json(new { members = otherplayers, winner = winner.First().Nickname, type = "Saved to server", HoleNum = HoleNum, CID = CID, YID = YID });
            }
            else
            {
                return Json(new { members = otherplayers, winner = winner.First().Nickname, type = "Updated to server", HoleNum = HoleNum, CID = CID, YID = YID });
            }
        }
Пример #28
0
        public ActionResult Groups(string target, int YID, int CID)
        {
            var dataContext = new lb3dataDataContext();

            var data = from y in dataContext.Groups
                       where y.YearID == YID
                       where y.CourseID == CID
                       orderby y.GroupName ascending
                       select y;

            var course = data.First().Course.CourseName;

            var year = (from y in dataContext.Years
                        where y.YID == YID
                        select y).First().Year1.ToString();

            ViewData["YID"] = YID;
            ViewData["CID"] = CID;
            ViewData["course"] = course;
            ViewData["year"] = year;
            ViewData["tname"] = data.First().Year.Name;
            ViewData["GroupTarget"] = target;

            //string cookie = Request.Cookies["last"].Value;

            //var cookietxt = cookie + ", " + year + ", " + course;

            //var histCookie = new HttpCookie("last", cookietxt);
            //histCookie.Expires = DateTime.Now.AddDays(1);
            //Response.AppendCookie(histCookie);

            return View("Groups", data);
        }
Пример #29
0
        public ActionResult getScore(int HID, int UserID, int GID)
        {
            var dataContext = new lb3dataDataContext();
            //gp

            var data = from c in dataContext.Scores
                       where c.HoleID == HID
                       where c.UserID == UserID
                       //orderby u.Timestamp descending
                       select c;
            ViewData["HID"] = HID;
            ViewData["GID"] = GID;
            ViewData["UserID"] = UserID;
            return PartialView("ScorePartial", data);
        }
Пример #30
0
        public ActionResult Years(string target)
        {
            var dataContext = new lb3dataDataContext();

            //if has userid and

            var data = from y in dataContext.Years
                      orderby y.YID descending
                       select y;

            ViewData["YearTarget"] = target;

            //ViewData["CourseName"] = data.First().Courses.First().CourseName;
            return View("Index", data);
        }