public Horario() { InitializeComponent(); var currentUser = XamlBridge.CurrentUser; var selectedView = XamlBridge.ViewEnum; IEnumerable <object> collection; switch (selectedView) { case ViewsEnum.Alumno: collection = AlumnoFunctionality.GetHorarios(currentUser); break; case ViewsEnum.Profesor: collection = ProfesorFunctionality.GetHorarios(currentUser.Persona1.Trabajador.Profesor); break; case ViewsEnum.Administrativo: case ViewsEnum.Administrador: default: collection = null; break; } XamlFunctionality.FillDataGrid(DataGridResult, collection); }
private void BtnMaximize_Click(object sender, RoutedEventArgs e) { if (!XamlFunctionality.IsWindowOpen <Configuration>(nameof(Configuration))) { var config = new Configuration() { Visibility = Visibility.Visible }; } }
private void BtnSearch_Click(object sender, RoutedEventArgs e) { var currentUserPerson = XamlBridge.CurrentUser.Persona1; XamlFunctionality.FillDataGrid(DataGridResult, currentUserPerson.Alumno != null ? AlumnoFunctionality.GetProfesores(TxtSearch.Text, IgnoreMayus.IsChecked, ExactMatch.IsChecked) : ProfesorFunctionality.GetAlumnos(TxtSearch.Text, currentUserPerson.Trabajador.Profesor, IgnoreMayus.IsChecked, ExactMatch.IsChecked) ); }
public LogIn() { InitializeComponent(); try { XamlFunctionality.ReadSavedUsernamePassword(this); } catch (Exception) { Notification.CreateNotification("Lo sentimos, no se ha recuperado la sesión anterior"); } }
private void LoadPageData() { var startIndex = SelectedIndex * Step; LabelStartIndex.Content = startIndex; var endIndex = startIndex + Step; LabelEndIndex.Content = endIndex; XamlFunctionality.FillDataGrid(DataGridResult, UserRoleList .Where((elemn, index) => index >= startIndex && index < endIndex) .ToList()); }
public void FinalizeLogIn() { var instance = XamlBridge.MainWindowInstance; var backUpMainPanel = XamlBridge.BackUpMainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; if (CheckSaveInformation.IsChecked.Value) { XamlFunctionality.WriteSaveUsernamePassword(this); } instance.AddButtonPanel(); instance.FillMainData(); Close(); }
public static void CreateNotification(string msg, string title = "Notificacion", bool dissappear = true, long dissappearAfter = 3000) { if (XamlFunctionality.IsWindowOpen <Notification>()) { XamlFunctionality.CloseWindowInstancesOf <Notification>(); } var notification = new Notification() { NotificationTitle = title, NotificationContent = msg, DissappearAfter = dissappearAfter, Visibility = Visibility.Visible, }; if (dissappear) { notification.StartTimer(); } notification.InitializeComponent(); }
public void FillMainData() { var user = XamlBridge.CurrentUser; if (user != null) { var persona = user.Persona1; XamlFunctionality.FillDataOfReadOnlyText(TxtDni, persona.Dni); XamlFunctionality.FillDataOfReadOnlyText(TxtNif, persona.Nif); XamlFunctionality.FillDataOfReadOnlyText(TxtNombre, persona.Nombre); XamlFunctionality.FillDataOfReadOnlyText(TxtApellidos, persona.Apellidos); XamlFunctionality.FillDataOfReadOnlyText(TxtEmail, persona.Email); var telefonos = from telefono in persona.Telefono.ToList() select new { Telefono = telefono.Telefono1, telefono.Comentario, }; XamlFunctionality.FillDataGrid(DataGridTelefono, telefonos); } }
private void TwitterItem_Click(object sender, RoutedEventArgs e) { XamlFunctionality.QueryInfoOnWebsite("https://twitter.com/institutabastos?lang=es"); }
private void QueryInfoItem_Click(object sender, RoutedEventArgs e) { XamlFunctionality.QueryInfoOnWebsite(); }
internal void Reload() { var collection = ProfesorFunctionality.GetHorariosGuardia(DateTime.Now); XamlFunctionality.FillDataGrid(DataGridResult, collection); }