예제 #1
0
		void GetCurrentStudents(University_Group obj)
		{
			if (obj!=null)
			{
				using (_ujc = new UniversityEntities())
				{
					var _studs = _ujc.University_Group.Where(gr => gr.Group_ID == obj.Group_ID).FirstOrDefault();
					Students = new ObservableCollection<University_Student>(_studs.University_Student.ToList());
				}
			}
		}
예제 #2
0
		void GetCurrentSubjects(University_Group obj)
		{
			if (obj != null)
			{
				using (_ujc = new UniversityEntities())
				{
					var _teach = _ujc.University_Group.Where(s => s.Group_ID == obj.Group_ID).FirstOrDefault();
					CurrentSubjects = new ObservableCollection<University_Subject>(_teach.University_Subject.ToList());
				}
			}
		}
예제 #3
0
		private void EditGroupFromDB(University_Group obj)
		{
			try
			{
				using (_ujc = new UniversityEntities())
				{
					var _group = _ujc.University_Group.Where(s => s.Group_ID == obj.Group_ID).FirstOrDefault();
					_group.Group_Name = GroupNameEdit;
					_ujc.SaveChanges();
			
				}
			}
			catch { }
			finally
			{
				RefreshIt();
			}
		}
예제 #4
0
		private void AddNewGroupToDB(string obj)
		{
			try
			{
				using (_ujc = new UniversityEntities())
				{
					University_Group _group = new University_Group();
					_group.Group_Name = obj;
					_ujc.University_Group.Add(_group);
					_ujc.SaveChanges();
				}
			}
			catch { }
			finally
			{
				RefreshIt();
			}
		
		}
예제 #5
0
//Command Methods
		private void DeleteGroupFromDB(University_Group obj)
		{
			try
			{
				using (_ujc = new UniversityEntities())
					{
						var _group = _ujc.University_Group.Where(s => s.Group_ID == obj.Group_ID).FirstOrDefault();
						_ujc.University_Group.Remove(_group);
						_ujc.SaveChanges();
					}
			}
		
			finally
			{
				RefreshIt();
			}
		}