Ejemplo n.º 1
0
        public AddUsers(DataSamples data)
        {
            Data = data;
            InitializeComponent();

            SelectedUsers = new List <UserViewModel>();
            AllUsersListBox.DataContext      = Data;
            SelectedUsersListBox.DataContext = this;
            SelectedUsersListBox.Items.Refresh();
        }
Ejemplo n.º 2
0
        public MainWindow(DataSamples data)
        {
            InitializeComponent();
            ((TextBlock)DaysOfWeek.Children[(int)DateTime.Now.DayOfWeek]).FontWeight = FontWeights.Bold;
            Data             = data;
            DataContext      = Data;
            Data.CurrentRoom = (RoomViewModel)ListBox1.SelectedItem;
            if (!Data.CurrentUser.isAdmin)
            {
                UsersMenuItem.Visibility = Visibility.Hidden;
                RoomsMenuItem.Visibility = Visibility.Hidden;
            }

            // Raise the routed event "selected"
            RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
        }
Ejemplo n.º 3
0
        public MeetingInfo(DataSamples data, MeetingViewModel meeting)
        {
            InitializeComponent();

            Meeting                 = meeting;
            Data                    = data;
            DataContext             = data;
            TitleTextBox.Text       = Meeting.MeetingName;
            SubjTextBox.Text        = Meeting.MeetingTheme;
            DescriptionTextBox.Text = Meeting.MeetingDescription;
            DatePicker.Text         = Meeting.StartTime.Date.ToShortDateString();
            int i = 0;

            if (Meeting.RepeatingDays != null)
            {
                foreach (CheckBox cb in CheckBoxContainer.Children)
                {
                    if (Meeting.RepeatingDays[i] == '1')
                    {
                        cb.IsChecked = true;
                    }
                    i++;
                }
            }
            Data.UpdateUsers();
            if (Meeting.UserMeetings != null)
            {
                foreach (UserMeetingViewModel um in Meeting.UserMeetings)
                {
                    var user = Data.Users.Find(u => u.Id == um.UserId);
                    if (user != null)
                    {
                        InvitedUsersListBox.Items.Add(user);
                    }
                }
            }

            TimeStartTextBox.Text = meeting.StartTime.ToString("hh\\:mm") + " - " + meeting.EndTime.ToString("hh\\:mm");
        }
Ejemplo n.º 4
0
 public RoomsWindow(DataSamples data)
 {
     InitializeComponent();
     Data        = data;
     DataContext = Data;
 }
Ejemplo n.º 5
0
        public MeetingWindow(DataSamples data, MeetingViewModel meeting)
        {
            InitializeComponent();
            startTimeMaskedTextBox = new MaskedTextBox("00:00")
            {
                Dock        = System.Windows.Forms.DockStyle.Fill,
                Width       = (int)host1.Width,
                Height      = (int)host1.Height,
                Font        = new System.Drawing.Font("Segoe UI", 12),
                BorderStyle = BorderStyle.FixedSingle
            };
            host1.Child = startTimeMaskedTextBox;

            durationMaskedTextBox = new MaskedTextBox("00:00")
            {
                Dock        = DockStyle.Fill,
                Width       = (int)host2.Width,
                Height      = (int)host2.Height,
                Font        = new System.Drawing.Font("Segoe UI", 12),
                BorderStyle = BorderStyle.FixedSingle
            };
            host2.Child = durationMaskedTextBox;

            Meeting                 = meeting;
            Data                    = data;
            DataContext             = data;
            TitleTextBox.Text       = Meeting.MeetingName;
            SubjTextBox.Text        = Meeting.MeetingTheme;
            DescriptionTextBox.Text = Meeting.MeetingDescription;
            DatePicker.SelectedDate = Meeting.StartTime.Date;
            int i = 0;

            if (Meeting.RepeatingDays != null)
            {
                foreach (CheckBox cb in CheckBoxContainer.Children)
                {
                    if (Meeting.RepeatingDays[i] == '1')
                    {
                        cb.IsChecked = true;
                    }
                    i++;
                }
            }
            Data.UpdateUsers();
            if (Meeting.UserMeetings != null)
            {
                foreach (UserMeetingViewModel um in Meeting.UserMeetings)
                {
                    var user = Data.Users.Find(u => u.Id == um.UserId);
                    if (user != null)
                    {
                        InvitedUsersListBox.Items.Add(user);
                    }
                }
            }

            startTimeMaskedTextBox.Text = meeting.StartTime.ToString("HH\\:mm");

            var t = (meeting.EndTime - meeting.StartTime).ToString("c");

            durationMaskedTextBox.Text = t;
            if (Meeting.Id == 0)
            {
                DelButton.Visibility = Visibility.Hidden;
                Title = "Добавление";
            }
            else
            {
                Title = "Изменение";
            }
        }
Ejemplo n.º 6
0
 public ForgotPasswordWindow(DataSamples data)
 {
     InitializeComponent();
     Data = data;
 }
Ejemplo n.º 7
0
 public UsersWindow(DataSamples data)
 {
     Data        = data;
     DataContext = Data;
     InitializeComponent();
 }
Ejemplo n.º 8
0
        public AuthWindow()
        {
            InitializeComponent();

            Data = new DataSamples();
        }
Ejemplo n.º 9
0
        public ProfileWindow(DataSamples data)
        {
            InitializeComponent();
            Data                   = data;
            FIOTextBox.Text        = Data.CurrentUser.UserFIO;
            CurrentFIO             = Data.CurrentUser.UserFIO;
            FIOTextBox.Focusable   = false;
            FIOTextBox.IsEnabled   = false;
            LoginTextBox.Text      = Data.CurrentUser.UserLogin;
            CurrentLogin           = Data.CurrentUser.UserLogin;
            LoginTextBox.Focusable = false;
            LoginTextBox.IsEnabled = false;
            EmailTextBox.Text      = Data.CurrentUser.UserMail;
            CurrentEmail           = Data.CurrentUser.UserMail;
            Password               = Data.CurrentUser.UserPassword;
            EmailTextBox.Focusable = false;
            EmailTextBox.IsEnabled = false;

            PasswordTextBox.Focusable        = false;
            PasswordTextBox.IsEnabled        = false;
            PasswordConfirmTextBox.IsEnabled = false;
            PasswordConfirmTextBox.Focusable = false;


            try
            {
                var response = APIClient.GetRequest("api/Meeting/GetListUserCreatedMeetings/" + Data.CurrentUser.Id);
                if (response.Result.IsSuccessStatusCode)
                {
                    var list = APIClient.GetElement <List <MeetingViewModel> >(response);
                    if (list != null)
                    {
                        Data.UserMeetings = list;
                    }
                }
                else
                {
                    throw new Exception(APIClient.GetError(response));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            MeetingsListBoxCreated.ItemsSource = Data.UserMeetings;


            try
            {
                var response = APIClient.GetRequest("api/Meeting/GetListUserInvites/" + Data.CurrentUser.Id);
                if (response.Result.IsSuccessStatusCode)
                {
                    var list = APIClient.GetElement <List <MeetingViewModel> >(response);
                    if (list != null)
                    {
                        Data.UserMeetings = list;
                    }
                }
                else
                {
                    throw new Exception(APIClient.GetError(response));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            MeetingsListBoxInvited.ItemsSource = Data.UserMeetings;
        }