Example #1
0
        public TimeTableSelectWindow()
        {
            InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            AreaName.Clear();
            if (Cr.CoreMims.Services.UserInfo.UserLoginInfo.D)
            {
                foreach (var t in Wlst.Sr.EquipmentInfoHolding.Services.AreaInfoHold.MySlef.AreaInfo)
                {
                    string area = t.Value.AreaName;
                    AreaName.Add(new AreaInt()
                    {
                        Value = area, Key = t.Value.AreaId
                    });
                }
            }
            else
            {
                foreach (var t in Cr.CoreMims.Services.UserInfo.UserLoginInfo.AreaR)
                {
                    if (Sr.EquipmentInfoHolding.Services.AreaInfoHold.MySlef.AreaInfo.ContainsKey(t))
                    {
                        string area = Sr.EquipmentInfoHolding.Services.AreaInfoHold.MySlef.AreaInfo[t].AreaName;
                        AreaName.Add(new AreaInt()
                        {
                            Value = area, Key = t
                        });
                    }
                }
            }

            var av = false;

            if (AreaName.Count > 1)
            {
                av = true;
            }

            TimeTables.Clear();
            foreach (var t in AreaName)
            {
                foreach (var itemTable in WeekTimeTableInfoService.GeteekTimeTableInfoList(t.Key))
                {
                    TimeTables.Add(new TimeTable()
                    {
                        IsChecked = false,
                        Area      = t.Key + "-" + t.Value,
                        Id        = itemTable.TimeId,
                        Name      = itemTable.TimeName,
                        NameDesc  = itemTable.TimeDesc,
                        AreaId    = t.Key,
                        AreaView  = av
                    });
                }
            }

            time.ItemsSource = TimeTables;
        }
Example #2
0
 public ObservableCollection <TimeTable> GetByWeek(string week, int id)
 {
     TimeTables.Clear();
     foreach (TimeTable tt in getTimeTable())
     {
         if (tt.idGroup == id && tt.Week == week)
         {
             TimeTables.Add(tt);
         }
     }
     return(TimeTables);
 }
Example #3
0
 public ObservableCollection <TimeTable> GetByWeekAdmin(string week, int course, int group, int subgroup)
 {
     TimeTables.Clear();
     foreach (TimeTable tt in getTimeTable())
     {
         gr = eFGroup.GetGroupById((int)tt.idGroup);
         if (gr.Course == course && tt.Week == week && gr.GroupNumber == group && gr.Subgroup == subgroup)
         {
             TimeTables.Add(tt);
         }
     }
     return(TimeTables);
 }