Пример #1
0
        public MenuAssistant(List <Tour> tours, NavigatorAssistant form) : base(tours, form)
        {
            //InitializeComponent();

            menuPanel = new AsistimeMenuPanel(this)
            {
                Parent = this
            };
            menuPanel.Location = new System.Drawing.Point(0, 0);
            this.Controls.Add(menuPanel);

            MyTours = new AssistantCardContainer(tours, this)
            {
                Parent = this
            };
            contentPanel.Controls.Add(MyTours);

            NewTours = new AssistantCardContainer(null, this)
            {
                Parent = this
            };
            contentPanel.Controls.Add(NewTours);

            ShowMyTours();
        }
        public AsistimeAudioCreation(NavigatorAssistant form)
        {
            this.previousForm = form;
            //this.FormBorderStyle = FormBorderStyle.None;
            this.StartPosition = FormStartPosition.CenterScreen;

            this.TransparencyKey = Color.Green;
            this.BackColor       = Color.Green;

            tour = new Tour();
            InitializeComponent();
        }
        public AsistimeTourCreation(NavigatorAssistant form)
        {
            this.previousForm = form;
            this.Load        += new System.EventHandler(this.AsistimeTourCreation_Load);
            //this.FormBorderStyle = FormBorderStyle.None;
            this.StartPosition = FormStartPosition.CenterScreen;

            this.TransparencyKey = Color.Green;
            this.BackColor       = Color.Green;

            tour = new Tour();
        }
        protected async void RegisterAccount(object sender, EventArgs e)
        {
            //Validaciones de campos
            //Llamado al a api
            //Mensaje de que hay que validar la cuenta
            //Volver al login?
            if (validateForm())
            {
                var user = new User();
                user.name     = nameTextBox.TextName;
                user.email    = mailTextBox.TextName;
                user.password = passwrdTextBox.TextName;
                user.password_confirmation = passwrdConfirmationTextBox.TextName;

                var userController = new UserController();
                if (Constants.token is String)
                {
                    var token = userController.RegisterOldPeopleAsync(user).Result;
                    new PopupNotification("Registro correcto", "Adulto registrado correctamente.");
                }
                else
                {
                    var token = userController.RegisterAsync(user).Result;
                    Constants.token = token.access_token;

                    NavigatorAssistant mod = new NavigatorAssistant();
                    mod.Show();
                }
            }
            else
            {
                if (passwrdTextBox.TextName != passwrdConfirmationTextBox.TextName)
                {
                    new PopupNotification("Registro inválido", "Las contraseñas no coinciden.");
                }
                else
                {
                    new PopupNotification("Registro inválido", "Complete todos los datos.");
                }
            }
        }
Пример #5
0
        protected void Forward(object sender, EventArgs e)
        {
            NavigatorAssistant form = Parent as NavigatorAssistant;

            form.DrawTextForm(textbox.TextName);
        }
Пример #6
0
        protected void Back(object sender, EventArgs e)
        {
            NavigatorAssistant form = Parent as NavigatorAssistant;

            form.CloseTextPopup();
        }
Пример #7
0
        protected void LogUser(object sender, EventArgs e)
        {
            if (userTextBox.TextName != string.Empty)
            {
                if (passwrdTextBox.TextName != string.Empty)
                {
                    var userController = new UserController();
                    var user           = new User();
                    user.email    = userTextBox.TextName;
                    user.password = passwrdTextBox.TextName;

                    loadingForm = new LoadingForm();
                    loadingForm.Show();

                    var token = userController.LoginAsync(user).Result;

                    if (token != null)
                    {
                        Constants.token = token.access_token;
                        Constants.user  = new User();
                        Constants.user  = token.user;

                        // Obtengo los tours

                        var tourController = new TourController();
                        Constants.tours = tourController.GetAllToursAsync().Result;

                        loadingForm.Close();

                        new PopupNotification("App Asistime!", "Bienvenido " + token.user.name);

                        if (token.user.rol == "Adulto")
                        {
                            ////Active notifications of new tours
                            Thread threadNewTour = new Thread(NewTourThread.DoWork);
                            threadNewTour.IsBackground = true;
                            threadNewTour.Start();

                            NavigatorAdult mod = new NavigatorAdult();
                            mod.Show();
                            this.WindowState   = FormWindowState.Minimized;
                            this.ShowInTaskbar = false;
                        }
                        else if (token.user.rol == "Responsable")
                        {
                            ////Active notifications
                            Thread threadNotification = new Thread(NotificationThread.DoWork);
                            threadNotification.IsBackground = true;
                            threadNotification.Start();

                            NavigatorAssistant mod = new NavigatorAssistant();
                            mod.Show();
                            this.WindowState   = FormWindowState.Minimized;
                            this.ShowInTaskbar = false;
                        }
                    }
                    else
                    {
                        loadingForm.Close();
                        new PopupNotification("Error Login", "Usuario o contraseña incorrecta.");
                        userTextBox.TextName    = "";
                        passwrdTextBox.TextName = "";
                    }
                }
            }
            else
            {
                new PopupNotification("Error Login", "Todos los campos deben tenes un valor.");
            }
        }