Ejemplo n.º 1
0
        private void CreatePayment()
        {
            if (ValidateNewPayment())
            {
                string message = string.Format("Nuevo abono por valor de {0:c} al cliente {1}", AmountPayment, CustomerSelected.CustomerName);

                string observation = null;
                if (CashPayment)
                {
                    observation = "Pago en efectivo";
                }
                else
                {
                    observation = "Pago con tarjeta";
                }

                if (PreguntarUsuario(message, "NUEVO ABONO"))
                {
                    if (BDComun.AddPayment(UserSelected.ID, CustomerSelected.CustomerID, DateOfNewPayment.Value, observation, AmountPayment, CashPayment, CardPayment))
                    {
                        CashPayment   = false;
                        CardPayment   = false;
                        AmountPayment = 0m;

                        BDComun.UpdateCustmerState(CustomerSelected);
                        ConsultTransactions();
                        DateCustomerUpdateConsult = DateTime.Now;
                        ActivatState();
                    }
                    else
                    {
                        MostrarMensaje(BDComun.Error);
                    }
                }
            }
        }//Fin del metodo