示例#1
0
        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);
        }
示例#2
0
 private void BtnMaximize_Click(object sender, RoutedEventArgs e)
 {
     if (!XamlFunctionality.IsWindowOpen <Configuration>(nameof(Configuration)))
     {
         var config = new Configuration()
         {
             Visibility = Visibility.Visible
         };
     }
 }
示例#3
0
        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)
                                           );
        }
示例#4
0
 public LogIn()
 {
     InitializeComponent();
     try
     {
         XamlFunctionality.ReadSavedUsernamePassword(this);
     }
     catch (Exception)
     {
         Notification.CreateNotification("Lo sentimos, no se ha recuperado la sesión anterior");
     }
 }
示例#5
0
        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());
        }
示例#6
0
        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();
        }
示例#7
0
        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();
        }
示例#8
0
        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);
            }
        }
示例#9
0
 private void TwitterItem_Click(object sender, RoutedEventArgs e)
 {
     XamlFunctionality.QueryInfoOnWebsite("https://twitter.com/institutabastos?lang=es");
 }
示例#10
0
 private void QueryInfoItem_Click(object sender, RoutedEventArgs e)
 {
     XamlFunctionality.QueryInfoOnWebsite();
 }
示例#11
0
        internal void Reload()
        {
            var collection = ProfesorFunctionality.GetHorariosGuardia(DateTime.Now);

            XamlFunctionality.FillDataGrid(DataGridResult, collection);
        }