コード例 #1
0
 private void EditClient_Click(object sender, RoutedEventArgs e)
 {
     if (_clientId != null)
     {
         ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsEdit, typeof(ClientsEdit), _clientId);
     }
 }
コード例 #2
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            var parameter = ((Button)sender).CommandParameter;

            if (parameter != null)
            {
                ProcesarAbrirVentana.AbrirVentana(ConstantsServiceGymContracts.NameWindowServiceGymContractsDelete, typeof(ServiceGymContractsDelete), int.Parse(parameter.ToString()));
            }
        }
コード例 #3
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            var parameter = ((Button)sender).CommandParameter;

            if (parameter != null)
            {
                ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsDelete, typeof(ClientsDelete), parameter);
            }
        }
コード例 #4
0
        private void DeleteClient_Click(object sender, RoutedEventArgs e)
        {
            var salir = MessageBox.Show("Deseas eliminar el registro.", "KallpaBox", MessageBoxButton.YesNoCancel);

            if (salir == MessageBoxResult.Yes)
            {
                var clientViewModel = _clientRepository.GetClientViewModelById(_clientId);
                var sessions        = _sessionRepository.GetAllSessionGymViewByClientIdView(_clientId);

                try
                {
                    if (clientViewModel != null)
                    {
                        _clientRepository.DeleteClient(clientViewModel.Id, clientViewModel);
                    }
                    if (sessions.Any())
                    {
                        foreach (var i in sessions)
                        {
                            _sessionRepository.DeleteSessionGymView(i.ClientId);
                        }
                    }

                    PresentationMessage.ShowMessegeQueue(this.SnackBarDeleteClients.MessageQueue, "Cliente Eliminado con exito");


                    this.EliminarButton.IsEnabled = false;

                    Thread.Sleep(5000);

                    ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsList, typeof(ClientsList), null);
                }
                catch (Exception ex)
                {
                    throw new Exception(string.Format(CultureInfo.CurrentCulture, "Error: {0})", ex.Message));
                }
            }
        }
コード例 #5
0
        private void CreateServiceGymContract_Click(object sender, RoutedEventArgs e)
        {
            if (!InValidContext())
            {
                return;
            }
            var serviceGymContractViewModel = new ServiceGymContractViewModel()
            {
                ServiceGymId = int.Parse(ServiceGymId.SelectedValue.ToString()),
                ClientId     = int.Parse(ClientId.SelectedValue.ToString()),
                Price        = decimal.Parse(Price.Text),
                Quantity     = int.Parse(Quantity.Text),
                TypeQuantity = int.Parse(TypeQuantity.SelectedValue.ToString()),
                State        = true
            };

            try
            {
                if (serviceGymContractViewModel.TypeQuantity == (int)EnumsApp.TypeQuantitiesGym.Month)
                {
                    serviceGymContractViewModel.DateExpiration = serviceGymContractViewModel.DateCelebrate.AddMonths(serviceGymContractViewModel.Quantity);
                }

                if (serviceGymContractViewModel.TypeQuantity == (int)EnumsApp.TypeQuantitiesGym.Days)
                {
                    serviceGymContractViewModel.DateExpiration = serviceGymContractViewModel.DateCelebrate.AddDays(serviceGymContractViewModel.Quantity);
                }
                _serviceGymContractRepository.CreateServiceGymContract(serviceGymContractViewModel);
                ProcesarAbrirVentana.AbrirVentana(ConstantsServiceGymContracts.NameWindowServiceGymContractsList, typeof(ServiceGymContractsList), null);

                CleanControls();
            }
            catch (System.Exception)
            {
                throw;
            }
        }
コード例 #6
0
 private void CerrarVentana()
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsServiceGym.NameWindowServiceGymsList, typeof(ServiceGymsList), null);
 }
コード例 #7
0
 private void CerrarVentana()
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsCreate, typeof(ClientsList), null);
 }
コード例 #8
0
 private void BackToListClients_Click(object sender, RoutedEventArgs e)
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsList, typeof(ClientsList), null);
 }
コード例 #9
0
 private void CreateServiceGymContract_Click(object sender, RoutedEventArgs e)
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsServiceGymContracts.NameWindowServiceGymContractsCreate, typeof(ServiceGymContractsCreate), null);
 }
コード例 #10
0
 private void CreateClient_Click(object sender, RoutedEventArgs e)
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsClients.NameWindowClientsCreate, typeof(Clients), null);
 }
コード例 #11
0
 private void BackToListServiceGymType_Click(object sender, RoutedEventArgs e)
 {
     ProcesarAbrirVentana.AbrirVentana(ConstantsServiceGymType.NameWindowServiceGymTypeList, typeof(ServiceGymTypesList), null);
 }