private void BtnSave(object sender, RoutedEventArgs e)
        {
            var result = MessagesBox.ShowDialog("¿Esta seguro de agregar proyeccion?", MessagesBox.Buttons.Yes_No);


            if (result == "1")
            {
                proj.Date    = (DateTime)dtpDate.Value;
                proj.MovieId = Convert.ToInt32(cmbMovie.SelectedValue);
                proj.HallId  = Convert.ToInt32(cmbHall.SelectedValue);
                if (!isEdit)
                {
                    int projectionId = wk.AddProjection(proj);
                    GiveProjection(proj.HallId, projectionId);
                    Projections.viewProjections.Add(proj);
                    ShortNotifications.ShowDialog("Se añadio exitosamente!!!");
                }
                else
                {
                    MessageBox.Show("Se actualizó con éxito");
                    wk.Update(proj);
                }
                Reset();
                //  dataGridUpdate.ItemsSource = wk.GetAll();
                // CollectionViewSource.GetDefaultView(dataGridUpdate.ItemsSource).Refresh();
                this.Close();
            }
        }
예제 #2
0
        private void addCustomer(object sender, RoutedEventArgs e)
        {
            c          = new Customer();   //Se carga los campos de un nuevo cliente
            c.Dni      = txtDni.Text;
            c.Lastname = txtLastname.Text;
            c.Name     = txtName.Text;
            c.Email    = txtEmail.Text;
            c.Phone    = txtPhone.Text;

            var result = MessagesBox.ShowDialog("¿Esta seguro de agregar cliente?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                try
                {
                    if (workCustomer.AddCustom(c))
                    {
                        ShortNotifications.ShowDialog("Se agrego exitosamente!!!");
                        this.Close();
                        //clear();
                    }
                    else
                    {
                        DataContext = c;
                    }
                }
                catch (Exception)
                {
                    ShortNotifications.ShowDialog("Datos incorrectos!!!");
                }
            }
        }
예제 #3
0
        private void BtnPreview_Click(object sender, RoutedEventArgs e)
        {
            var result = MessagesBox.ShowDialog("¿Desea generar Documento?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                DocumentFilterUser documentFilterUser = new DocumentFilterUser(List);
                ShortNotifications.ShowDialog("Se genero documento con exito!!!");
                documentFilterUser.Show();
            }
        }
예제 #4
0
        private void BtnEliminar_Click(object sender, RoutedEventArgs e)
        {
            var result = MessagesBox.ShowDialog("¿Esta seguro de eliminar usuario: " + currentUser.Username + "?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                EnableButtons();
                wu.Delete(users.ElementAt(Vista.CurrentPosition).Id);
                users.RemoveAt(Vista.CurrentPosition);
                ShortNotifications.ShowDialog("Se elimino exitosamente!!!");
            }
        }
예제 #5
0
        private void BtnSave_Group(object sender, RoutedEventArgs e)
        {
            Group group  = SetGroup();
            var   result = MessagesBox.ShowDialog("¿Desea agregar grupo de butacas?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                SaveSeats(group);
                hallFactory.CreateHall();
                ShortNotifications.ShowDialog("Se agrego exitosamente!!!");
                this.Close();
            }
        }
예제 #6
0
        private void ListBoxItemDeleteC_Selected(object sender, RoutedEventArgs e) //opcion eliminar un cliente
        {
            var      baseobj  = sender as FrameworkElement;
            Customer customer = baseobj.DataContext as Customer;
            var      result   = MessagesBox.ShowDialog("¿Estás seguro de eliminar?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                wc.Delete(customer.Id);
                CollectionViewSource.GetDefaultView(List.ItemsSource).Refresh();
                SetDefaultCustomers();
                ShortNotifications.ShowDialog("Se elimino exitosamente!!!");
            }
        }
예제 #7
0
        private void BtnSave_Group(object sender, RoutedEventArgs e)
        {
            Hall hall = new Hall();

            hall.Capacity   = Convert.ToInt32(txtCapacity.Text);
            hall.HallNumber = Convert.ToInt32(txtHallNumber.Text);
            var result = MessagesBox.ShowDialog("¿Esta seguro de agregar sala?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                wh.Add(hall);
                hallFactory.RefreshCombobox();
                hallFactory.CreateHall();
                ShortNotifications.ShowDialog("Se añadio exitosamente!!!");
                this.Close();
            }
        }
예제 #8
0
        private void BtnImage_Click(object sender, RoutedEventArgs e)
        {
            Ticket ticket = new Ticket();

            ticket.ProjectionId = projection.Id;
            ticket.Ticketnumber = generateNumberTicket();
            ticket.CustomerId   = Convert.ToInt32(cmbCustomer.SelectedValue);
            ticket.Dateofsale   = DateTime.Now;
            ticket.Total        = totalPrice;
            var result = MessagesBox.ShowDialog("¿Desea generar Ticket?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                UpdateSeats(seats);
                wticket.Add(ticket);
                ShortNotifications.ShowDialog("Se genero ticket!!!");
                this.Close();
                PrintTicket(ticket, seats);
            }
        }
예제 #9
0
        //delete
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            var   baseobj = sender as FrameworkElement;
            Movie movie   = baseobj.DataContext as Movie;
            var   result  = MessagesBox.ShowDialog("¿Estás seguro de eliminar?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                try
                {
                    workMovie.Delete(movie.Id);
                    ShortNotifications.ShowDialog("Se elimino exitosamente!!!");
                    ListCardMovies.listMovie.Remove(movie);
                    CollectionViewSource.GetDefaultView(ListCardMovies.listMovie).Refresh();//refresca la lista
                }
                catch
                {
                    ShortNotifications.ShowDialog("No se puede eliminar pelicula, esta en proyeccion");
                }
            }
        }
예제 #10
0
        private void BtnGuardar_Click(object sender, RoutedEventArgs e)
        {
            if (agregando)
            {
                var result = MessagesBox.ShowDialog("¿Esta seguro de agregar usuario: " + currentUser.Username + "?", MessagesBox.Buttons.Yes_No);

                if (result == "1")
                {
                    user.Fullname = txtFullname.Text;
                    user.Username = txtUsername.Text;
                    user.Password = txtPassword.Text;
                    Rol rol = cmbRol.SelectedItem as Rol;
                    user.RolId = rol.Id;
                    wu.Add(user);
                    EnableButtons();
                    ShortNotifications.ShowDialog("Se agrego exitosamente!!!");
                    agregando = false;
                }
            }
            else
            {
                var result = MessagesBox.ShowDialog("¿Esta seguro de modificar el usuario: " + currentUser.Username + "?", MessagesBox.Buttons.Yes_No);

                if (result == "1")
                {
                    User userModified = new User();
                    userModified.Id       = users.ElementAt(Vista.CurrentPosition).Id;
                    userModified.Fullname = txtFullname.Text;
                    userModified.Username = txtUsername.Text;
                    userModified.Password = txtPassword.Text;
                    Rol rol = cmbRol.SelectedItem as Rol;
                    userModified.Rol   = rol;
                    userModified.RolId = userModified.Rol.Id;
                    wu.Update(userModified);
                    EnableButtons();
                    ShortNotifications.ShowDialog("Se modifico exitosamente!!!");
                    copyCurrentUser();
                }
            }
        }
예제 #11
0
        //add
        private void BtnAceptMovie_Click(object sender, RoutedEventArgs e)
        {
            var result = MessagesBox.ShowDialog("¿Estas seguro de agregar pelicula?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                movie.Title        = txtTitulo.Text;
                movie.Duration     = txtDuracion.Text;
                movie.Description  = txtDescripcion.Text;
                movie.UrlYoutube   = txtUrlYoutube.Text;
                movie.Classofmovie = cmbClassMovie.SelectedValue.ToString();
                Category asd = cmbCategory.SelectedItem as Category;
                movie.CategoryId = asd.Id;
                wm.Add(movie);
                ListCardMovies.listMovie.Insert(0, movie);
                ListCardMovies.listMovieFirstPage.Insert(0, movie);
                ShortNotifications.ShowDialog("Se agrego exitosamente!!!");
                movie      = new Movie();
                descending = true;
            }
            Reset();
        }
예제 #12
0
        private void UpdateCustomer(object sender, RoutedEventArgs e)
        {
            c.Lastname = txtLastname.Text;
            c.Name     = txtName.Text;
            c.Email    = txtEmail.Text;
            c.Phone    = txtPhone.Text;

            var result = MessagesBox.ShowDialog("¿Esta seguro de modificar cliente?", MessagesBox.Buttons.Yes_No);

            if (result == "1")
            {
                if (workCustomer.UpdateCustom(c))
                {
                    ShortNotifications.ShowDialog("Se modifico exitosamente!!!");
                    this.Close();
                }
                else
                {
                    DataContext = c;
                }
            }
        }