示例#1
0
        public ActionResult saveGroup(int CID, int YID, string groupname)
        {
            var dataContext = new lb3dataDataContext();

            //gp
            LB3.Models.Group group = new LB3.Models.Group();
            group.GroupName = groupname;
            group.CourseID  = CID;
            group.YearID    = YID;

            dataRepository.Add(group);
            dataRepository.Save();

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

            return(PartialView("GroupPartial", data));
        }
示例#2
0
        public ActionResult saveGroup(int CID, int YID, string groupname)
        {
            var dataContext = new lb3dataDataContext();
            //gp
            LB3.Models.Group group = new LB3.Models.Group();
            group.GroupName = groupname;
            group.CourseID = CID;
            group.YearID = YID;

            dataRepository.Add(group);
            dataRepository.Save();

            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;

            ViewData["YID"] = YID;
            ViewData["courseID"] = CID;

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

            return PartialView("GroupPartial", data);
        }
示例#3
0
 partial void DeleteGroup(Group instance);
示例#4
0
		private void detach_Groups(Group entity)
		{
			this.SendPropertyChanging();
			entity.Year = null;
		}
示例#5
0
		private void attach_Groups(Group entity)
		{
			this.SendPropertyChanging();
			entity.Year = this;
		}
示例#6
0
 partial void UpdateGroup(Group instance);
示例#7
0
 partial void InsertGroup(Group instance);
示例#8
0
 public void Add(LB3.Models.Group group)
 {
     db.Groups.InsertOnSubmit(group);
 }
示例#9
0
        public ActionResult saveGroup(int CID, int YID, string groupname)
        {
            var dataContext = new lb3dataDataContext();
            //gp
            LB3.Models.Group group = new LB3.Models.Group();
            group.GroupName = groupname;
            group.CourseID = CID;
            group.YearID = YID;

            dataRepository.Add(group);
            dataRepository.Save();

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

            return PartialView("GroupPartial", data);
        }