コード例 #1
0
        private void HandleGamesResponse(ObservableCollection<GameData> gamesCollection, Exception exception)
        {
            if (exception != null)
            {

            }
            else
            {
                ObservableCollection<GameData> temp = new ObservableCollection<GameData>(gamesCollection.OrderBy(g => g.UK_Name.Trim()));

                //var games = from game in temp
                //               group game by game.UK_Name.Trim().ToLower().Substring(0, 1) into c
                //               orderby c.Key
                //               select new Group<GameData>(c.Key, c);



                this.GamesList = temp;
                this.HaveGames = temp.Count() > 0;
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: keyanmca/_Signage
        private void TestService()
        {
            Gurock.SmartInspect.SiAuto.Main.LogMessage("Start TEST Service");
            Gurock.SmartInspect.SiAuto.Main.LogMessage("FTPCORE MODE = "+FTPONLY.ToString());
            Boolean allok = true;
            try
            {
                //DAL.UserCollection _users = new DAL.UserCollection();
                ObservableCollection<User> _users = new ObservableCollection<User>();
                _users = proxy.CollectUsers();
                Gurock.SmartInspect.SiAuto.Main.LogMessage("USERS COLLECTED");
                try
                {
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("USER COUNT = " + _users.Count());
                }
                catch (System.Exception x)
                {
                    si.six(x);
                }
                
                if (_users.Count <= 0 && FTPONLY == false)
                {
                    allok = false;
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("FALSE");
                }
            }
            catch (Exception ex)
            {
                allok = false;
            }

            if (File.Exists(@"c:\tmp\schedule.xml") || (Boolean)Properties.Settings.Default.FTPCoreMode == true ) allok = true;

            if (allok == false)
            {
                tbClientID.Text = Properties.Settings.Default.ClientID;
                tbServiceAddress.Text = Properties.Settings.Default.ServiceAddress;
                tbPort.Text = Properties.Settings.Default.Port;
                tbWeatherLocation.Text = Properties.Settings.Default.WeatherLocation;
                cbFTPCore.IsChecked = (Boolean)Properties.Settings.Default.FTPCoreMode;
                tbGroupID.Text = Properties.Settings.Default.FTPCoreModeGroupID;
                if (cbFTPCore.IsChecked == true)
                {
                    spGroupID.Visibility = Visibility.Visible;
                } else
                {
                    spGroupID.Visibility = Visibility.Hidden;
                }
                borderConfiguration.Visibility = Visibility.Visible;
            }
            else
            {
                Gurock.SmartInspect.SiAuto.Main.LogMessage("Register Display Client with Core");
                try
                {
                    if (FTPONLY)
                    {
                        //_GROUPID = DeSerializeGroupID(@"c:\tmp\group.xml");
                        _GROUPID = Properties.Settings.Default.FTPCoreModeGroupID;
                        Gurock.SmartInspect.SiAuto.Main.LogMessage("FTPONLY MODE - collecting gid from xml:" + _GROUPID);
                    } else
                    {
                        si.sii("Attempting Registration");
                        _GROUPID = RegisterDisplayClientWithCore();
                        SerializeGroupID(@"c:\tmp\group.xml", _GROUPID);    
                    }
                }
                catch (Exception)
                {
                    _GROUPID = DeSerializeGroupID(@"c:\tmp\group.xml");
                    Gurock.SmartInspect.SiAuto.Main.LogMessage("Exception Register Display Client with Core - collecting gid="+_GROUPID);
                }
                Gurock.SmartInspect.SiAuto.Main.LogMessage("Done Register Display Client with Core");
                if (Properties.Settings.Default.Diagnostic == true)
                {
                    si.sii("Starting Service Check Timer");
                    StartServiceCheckTimer();
                }
                else
                {
                    si.sii("All OK - Starting Minute Timer");
                    minuteTimer.Start();
                    KeepAliveTicker++;
                }
            }
        }
コード例 #3
0
ファイル: BorrowApply.cs プロジェクト: JuRogn/OA
 public bool DelMasterDataById(ObservableCollection<string> masterList)
 {
     bool flag = false;
     if ((masterList != null) && (masterList.Count() > 0))
     {
         BorrowApplyMasterBLL bll = new BorrowApplyMasterBLL();
         flag = bll.DelMasterDataById(masterList);
     }
     else
     {
         flag = false;
     }
     return flag;
 }