Exemple #1
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);
        }
Exemple #2
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);
        }
Exemple #3
0
        public List <BE.PrestamoCuota> ListarCuotas(int anho, int mes, string codigoEmpleado)
        {
            List <BE.PrestamoCuota> lstPrestamoCuota = new List <BE.PrestamoCuota>();

            try
            {
                string sp = "SpTbPrestamoCuotaListar2";

                using (SqlConnection cnn = new SqlConnection(ConnectionManager.ConexionLocal))
                {
                    cnn.Open();

                    SqlCommand cmd = new SqlCommand(sp, cnn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@ANHO", anho));
                    cmd.Parameters.Add(new SqlParameter("@MES", mes));
                    cmd.Parameters.Add(new SqlParameter("@CODIGOEMPLEADO", codigoEmpleado));

                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        var bePrestamoCuota = new BE.PrestamoCuota();

                        bePrestamoCuota.IdPrestamoCuota = int.Parse(reader["IdPrestamoCuota"].ToString());
                        bePrestamoCuota.Fecha           = DateTime.Parse(reader["Fecha"].ToString());
                        bePrestamoCuota.Importe         = double.Parse(reader["Monto"].ToString());
                        bePrestamoCuota.Pagado          = bool.Parse(reader["Pagado"].ToString());

                        lstPrestamoCuota.Add(bePrestamoCuota);
                    }
                }

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