Esempio n. 1
0
        void doInit(object data)
        {
            try
            {
                Web.getInitCompletedEventArgs e = data as Web.getInitCompletedEventArgs;
                if (e.Error != null)
                {
                    Close();
                    return;
                }
                Init = e.Result;
                Dispatcher.BeginInvoke(new Action(UpdateUser));

                Web.apiSoapClient c = new Web.apiSoapClient();
                c.GetFreeSpacePercentageCompleted += new EventHandler <Web.GetFreeSpacePercentageCompletedEventArgs>(c_GetFreeSpacePercentageCompleted);
                if (Init.UserLevel != UserLevel.Student)
                {
                    c.getControlledOUsCompleted += new EventHandler <getControlledOUsCompletedEventArgs>(c_getControlledOUsCompleted);
                    if (!string.IsNullOrEmpty(Properties.Settings.Default.ControlledOU))
                    {
                        c.getControlledOUsAsync(Properties.Settings.Default.ControlledOU);
                    }
                    c.getMyTicketsCompleted += new EventHandler <Web.getMyTicketsCompletedEventArgs>(c_getMyTicketsCompleted);
                    c.getMyTicketsAsync(Environment.UserName);
                }
                else
                {
                    c.getPhotoCompleted += new EventHandler <Web.getPhotoCompletedEventArgs>(c_getPhotoCompleted);
                    c.getPhotoAsync(Init.EmployeeID);
                }
                if (!string.IsNullOrEmpty(Init.HomeDrive))
                {
                    c.GetFreeSpacePercentageAsync(Environment.UserName, Init.HomeDirectory);
                }
            }
            catch (Exception ex) { MessageBox.Show("Init Error:\n" + ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); Close(); }
        }
Esempio n. 2
0
 void nt_Done()
 {
     Web.apiSoapClient c = new Web.apiSoapClient();
     c.getMyTicketsCompleted += new EventHandler <Web.getMyTicketsCompletedEventArgs>(c_getMyTicketsCompleted);
     c.getMyTicketsAsync(Environment.UserName);
 }