private BE.Prestamo PrestamoUItoBE(BE.UI.Prestamo UiPrestamo) { var bePrestamo = new BE.Prestamo(); bePrestamo.IdPrestamo = UiPrestamo.IdPrestamo; bePrestamo.Fecha = UiPrestamo.Fecha; bePrestamo.CodigoEmpleado = UiPrestamo.CodigoEmpleado; bePrestamo.Motivo = UiPrestamo.Motivo; bePrestamo.Monto = UiPrestamo.Monto; bePrestamo.Pagado = UiPrestamo.Pagado; bePrestamo.NumeroCuotas = UiPrestamo.NumeroCuotas; return(bePrestamo); }
private BE.UI.Prestamo PrestamoBEtoUI(BE.Prestamo bePrestamo) { var UiPrestamo = new BE.UI.Prestamo(); UiPrestamo.IdPrestamo = bePrestamo.IdPrestamo; UiPrestamo.Fecha = bePrestamo.Fecha; UiPrestamo.CodigoEmpleado = bePrestamo.CodigoEmpleado; UiPrestamo.Motivo = bePrestamo.Motivo; UiPrestamo.Monto = bePrestamo.Monto; UiPrestamo.Pagado = bePrestamo.Pagado; UiPrestamo.NumeroCuotas = bePrestamo.NumeroCuotas; return(UiPrestamo); }
private void Editar(BE.UI.Prestamo uiPrestamo) { try { var frmPrestamoMant = new FrmPrestamoMant(this); frmPrestamoMant.MdiParent = this.MdiParent; frmPrestamoMant.Show(); frmPrestamoMant.Cargar(uiPrestamo); } catch (Exception ex) { throw ex; } }
public bool Insertar(ref BE.UI.Prestamo uiPrestamo) { try { var bePrestamo = this.PrestamoUItoBE(uiPrestamo); bePrestamo.Cuotas = this.ListPrestamoCuotaUItoBE(uiPrestamo.Cuotas); return(new DA.Prestamo().Insertar(ref bePrestamo)); } catch (Exception ex) { throw ex; } }
public bool Actualizar(BE.UI.Prestamo uiPrestamo, List <BE.UI.Cuota> lstUiCuotasNuevas, List <BE.UI.Cuota> lstUiCuotasEliminadas) { try { var bePrestamo = this.PrestamoUItoBE(uiPrestamo); List <BE.PrestamoCuota> lstBeCuotasNuevas = this.ListPrestamoCuotaUItoBE(lstUiCuotasNuevas); List <BE.PrestamoCuota> lstBeCuotasEliminadas = this.ListPrestamoCuotaUItoBE(lstUiCuotasEliminadas); return(new DA.Prestamo().Actualizar(bePrestamo, lstBeCuotasNuevas, lstBeCuotasEliminadas)); } catch (Exception ex) { throw ex; } }
public BE.UI.Prestamo ObtenerSinCuotas(int idPrestamo) { try { BE.UI.Prestamo uiPrestamo = null; BE.Prestamo bePrestamo = new DA.Prestamo().Obtener(idPrestamo, false); if (bePrestamo != null) { uiPrestamo = this.PrestamoBEtoUI(bePrestamo); uiPrestamo.NombreCompletoEmpleado = new DA.Trabajador().ObtenerNombreCompleto(bePrestamo.CodigoEmpleado); } return(uiPrestamo); } catch (Exception ex) { throw ex; } }
public List <BE.UI.Prestamo> ListarSinCuotas(int anho, int mes) { try { List <BE.Prestamo> lstbePrestamo = new DA.Prestamo().Listar(anho, mes, false); var lstUiPrestamo = new List <BE.UI.Prestamo>(); foreach (var bePrestamo in lstbePrestamo) { BE.UI.Prestamo uiPrestamo = this.PrestamoBEtoUI(bePrestamo); uiPrestamo.NombreCompletoEmpleado = new DA.Trabajador().ObtenerNombreCompleto(bePrestamo.CodigoEmpleado); lstUiPrestamo.Add(uiPrestamo); } return(lstUiPrestamo); } catch (Exception ex) { throw ex; } }
public void Cargar(BE.UI.Prestamo bePrestamo = null) { try { if (bePrestamo != null) { this.bePrestamo = bePrestamo; this.dtpFecha.Value = this.bePrestamo.Fecha; this.cboEmpleado.SelectedValue = this.bePrestamo.CodigoEmpleado; this.txtMotivo.Text = this.bePrestamo.Motivo; this.txtMonto.Text = this.bePrestamo.Monto.ToString("###,###.00"); this.chkPagado.Checked = this.bePrestamo.Pagado; this.CargarCuotas(bePrestamo.IdPrestamo); } } catch (Exception ex) { Util.ErrorMessage(ex.Message); } }
private void Limpiar() { try { //Limpiar objeto this.bePrestamo = new BE.UI.Prestamo(); //Limpiar controles de edicion this.bePrestamo.IdPrestamo = 0; this.dtpFecha.Value = DateTime.Now; this.txtMonto.Text = "0.00"; this.txtMotivo.Clear(); this.chkPagado.Checked = false; this.CargarEmpleados(); this.CargarCuotas(this.bePrestamo.IdPrestamo); } catch (Exception ex) { throw ex; } }