예제 #1
0
        private BE.UI.Cuota PrestamoCuotaBEtoUI(BE.PrestamoCuota bePrestamoCuota)
        {
            var uiPrestamoCuota = new BE.UI.Cuota();

            uiPrestamoCuota.IdCuota = bePrestamoCuota.IdPrestamoCuota;
            uiPrestamoCuota.Fecha   = bePrestamoCuota.Fecha;
            uiPrestamoCuota.Importe = bePrestamoCuota.Importe;
            uiPrestamoCuota.Pagado  = bePrestamoCuota.Pagado;
            return(uiPrestamoCuota);
        }
예제 #2
0
        private BE.PrestamoCuota PrestamoCuotaUItoBE(BE.UI.Cuota uiPrestamoCuota)
        {
            var bePrestamoCuota = new BE.PrestamoCuota();

            bePrestamoCuota.IdPrestamoCuota = uiPrestamoCuota.IdCuota;
            bePrestamoCuota.Fecha           = uiPrestamoCuota.Fecha;
            bePrestamoCuota.Importe         = uiPrestamoCuota.Importe;
            bePrestamoCuota.Pagado          = uiPrestamoCuota.Pagado;
            return(bePrestamoCuota);
        }
예제 #3
0
        private void btnCuotaAgregar_Click(object sender, EventArgs e)
        {
            try
            {
                #region Validaciones

                if (this.txtMontoCuota.Text.Trim().Length == 0)
                {
                    this.txtMontoCuota.Focus();
                    throw new Exception("Ingrese el monto de la cuota");
                }

                if (double.Parse(this.txtMontoCuota.Text) == 0.0)
                {
                    this.txtMontoCuota.Focus();
                    throw new Exception("Ingrese el monto de la cuota");
                }

                #endregion

                var uiCuota = new BE.UI.Cuota();
                uiCuota.Numero  = this.bePrestamo.Cuotas.Count + 1;
                uiCuota.Fecha   = this.dtpFechaCuota.Value;
                uiCuota.Importe = double.Parse(this.txtMontoCuota.Text);
                uiCuota.Pagado  = this.chkPagadoCuota.Checked;

                if (this.bePrestamo.Cuotas == null)
                {
                    this.bePrestamo.Cuotas = new List <BE.UI.Cuota>();
                }
                this.bePrestamo.Cuotas.Add(uiCuota);

                if (this.bePrestamo.IdPrestamo > 0)
                {
                    if (uiCuota.IdCuota == 0)
                    {
                        this.lstIdCuotasNuevas.Add(uiCuota);
                    }
                }

                double totalImporte = this.bePrestamo.Cuotas.Sum(x => x.Importe);
                this.txtMonto.Text = totalImporte.ToString("###,###.00");

                this.CargarCuotas();
            }
            catch (Exception ex)
            {
                Util.ErrorMessage(ex.Message);
            }
        }
예제 #4
0
        public List <BE.UI.Cuota> ListarCuotas(int anho, int mes, string codigoEmpleado)
        {
            List <BE.UI.Cuota> lstUiCuotas = new List <BE.UI.Cuota>();

            try
            {
                var lstBeCuotas = new DA.Prestamo().ListarCuotas(anho, mes, codigoEmpleado);

                foreach (BE.PrestamoCuota beCuota in lstBeCuotas)
                {
                    BE.UI.Cuota uiCuota = this.PrestamoCuotaBEtoUI(beCuota);
                    lstUiCuotas.Add(uiCuota);
                }

                return(lstUiCuotas);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }