Ejemplo n.º 1
0
        private void PerformLogin(System.Windows.RoutedEventArgs e)
        {
            si.sie("PerformLogin");

            DAL.RDB proxy = new DAL.RDB();

            Busy("test");
            try
            {
                tbLoginFailed.Visibility = Visibility.Collapsed;
                DAL.User _currentUser = new DAL.User();
                _currentUser = proxy.VerifyLogin(tbUsername.Text, tbPassword.Password);
                if (_currentUser.Fullname == "failed")
                {
                    userlevel = "none";
                    animationControl.StartStateTransition();
                    tbLoginFailed.Visibility = Visibility.Visible;
                    tbUsername.Focus();
                    animationControl.AnimateStateTransition();
                }
                else
                {
                    userlevel = _currentUser.Groupid;
                    animationControl.StartStateTransition();
                    SetupUserLevel();
                    tbLoginFailed.Visibility = Visibility.Collapsed;
                    gridLogin.Visibility = Visibility.Collapsed;
                    tbUserLoggedIn.Text = _currentUser.Fullname;
                    tbLogout.Visibility = Visibility.Visible;
                    spNavigation.IsEnabled = true;
                    btnConfiguration_Click(this,e);
                    animationControl.AnimateStateTransition();
                    FetchMediaCollection();
                    InitializeFTPTimer();
                }
            }
            catch (Exception ex)
            {
            }
            NotBusy();
            si.sil("PerformLogin");
            CheckExpiry();
        }
Ejemplo n.º 2
0
        private void PublishDisplaySchedule()
        {
            DAL.RDB proxy = new DAL.RDB();
            si.sii("Publishing Display Schedule");
            //ObservableCollection<DAL.Schedule> scheduleCollection = new ObservableCollection<DAL.Schedule>();
            try
            {
                //Build Schedule
                showWait();

                si.sii("Appointments = " + _Model.Appointments.Count().ToString());

                foreach (var item in _Model.Appointments)
                {
                    DAL.Schedule newSchedule = new DAL.Schedule();
                    newSchedule.Groupid = "0";
                    newSchedule.Groupname = "";
                    newSchedule.Loopname = item.Subject;
                    newSchedule.Screenname = item.OwnerKey;
                    newSchedule.Loopstart = item.StartTime;
                    newSchedule.Loopend = item.EndTime;
                    //scheduleCollection.Add(newSchedule);
                    try //imageSource is not null (imageSource is the schedule ID in RDB), try update first, if that fails then the ID wasn't set, do an insert
                    {
                        si.sii("Update Schedule Now");
                        proxy.UpdateScheduleForScreen(newSchedule, item.ImageSource);
                    }
                    catch (Exception)
                    {
                        si.sii("Inserting New Schedule Now");
                        item.ImageSource = proxy.InsertNewScheduleForScreen(newSchedule);
                    }
                }

            }
            catch (Exception ex)
            {
                si.six(ex);
            }

            showConfirmation();
        }
Ejemplo n.º 3
0
 private void btnDeleteSchedule_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     e.Handled = true;
     DAL.RDB proxy = new DAL.RDB();
     try
     {
         Collection<Appointment> appTD = new Collection<Appointment>();
         Appointment appToDelete = new Appointment();
         foreach (var item in devCal.SelectedAppointments)
         {
             appTD.Add(item.Appointment);
         }
         foreach (var item in appTD)
         {
             _Model.Appointments.Remove(item);
             proxy.DeleteScheduleWithID(item.ImageSource);
         }
         devCal.CalendarModel = null;
         devCal.CalendarModel = _Model;
     }
     catch (Exception ex)
     {
     }
 }