private void btnModificarConvenio_Click(object sender, EventArgs e) { convenios oConvenios = new convenios(); ConvenioImplement oConvenioImplement = new ConvenioImplement(); DataGridViewRow row = this.dgvConvenio.CurrentRow; if (btnModificarConvenio.Text == "&Modificar Convenio") { if (row != null) { row.ReadOnly = false; row.Cells[0].ReadOnly = true; row.Cells[1].ReadOnly = true; row.Cells[2].ReadOnly = true; row.Cells[3].ReadOnly = true; row.Cells[4].ReadOnly = true; row.Cells[5].ReadOnly = true; row.Cells[7].ReadOnly = true; _facturadasOriginal = Convert.ToInt32(row.Cells[6].Value); _idConvenio = Convert.ToInt32(row.Cells[1].Value); oConvenios = oConvenioImplement.Get(_idConvenio); btnModificarConvenio.Text="&Terminar Modificacion"; } } else { if (row != null) { int _facturadasNuevas=Convert.ToInt32(row.Cells[6].Value); int _cuotas = Convert.ToInt32(row.Cells[5].Value); if (_facturadasNuevas >= _facturadasOriginal && _facturadasNuevas <= _cuotas) { _idConvenio = Convert.ToInt32(row.Cells[1].Value); oConvenios = oConvenioImplement.Get(_idConvenio); oConvenios.fecha_convenio = Convert.ToDateTime(row.Cells[2].Value); oConvenios.importe_total = Convert.ToDecimal(row.Cells[3].Value); oConvenios.cuotas = Convert.ToInt32(row.Cells[5].Value); oConvenios.valor_cuota = Convert.ToDecimal(row.Cells[4].Value); oConvenios.facturadas = Convert.ToInt32(row.Cells[6].Value); if (oConvenios.cuotas == oConvenios.facturadas) { //if (row.Cells[7].Value == "Si") oConvenios.finalizado = true; } else oConvenios.finalizado = false; oConvenioImplement.Update(oConvenios); btnModificarConvenio.Text = "&Modificar Convenio"; frmConvenios_Load(sender, e); } else { frmVentanaInformativa f = new frmVentanaInformativa("Cantidad facturadas incorrecta."); f.ShowDialog(); } } } }
public Decimal ObtenerImporteConvenioAdeudado(int idSocio) { Decimal Importe = 0; ConvenioImplement oConvenioImplement = new ConvenioImplement(); DataTable dtConveniosBySocio = oConvenioImplement.GetConveniosBySocioDT(idSocio); foreach (DataRow dr in dtConveniosBySocio.Rows) { if (dr["finalizado"].ToString() == "No") { Importe = Importe + (decimal.Parse(dr["importe_total"].ToString()) - (decimal.Parse(dr["valor_cuota"].ToString()) * decimal.Parse(dr["facturadas"].ToString()))); } } return(Importe); }
private void btnEliminarConvenio_Click(object sender, EventArgs e) { convenios oConvenios = new convenios(); ConvenioImplement oConvenioImplement = new ConvenioImplement(); DataGridViewRow row = this.dgvConvenio.CurrentRow; if (row != null) { int _facturadas = Convert.ToInt32(row.Cells[6].Value); if (_facturadas == 0) { _idConvenio = Convert.ToInt32(row.Cells[1].Value); //limpio facturas oConvenioImplement.Delete(_idConvenio); CargarConveniosBySocio(); } else { frmVentanaInformativa f = new frmVentanaInformativa("No se puede eliminar convenio si hay cuotas facturadas."); f.ShowDialog(); } } }
private void CargarBanderas(socios_varios oSocioVarios ) { ConvenioImplement oConvenioImplement = new ConvenioImplement(); ProcesoJudicialImplement oProcesoJudicialImplement=new ProcesoJudicialImplement(); IntimacionImplement oIntimacionImplement=new IntimacionImplement(); this.lblConvenioNoVolcado.Visible = (!oConvenioImplement.ConvenioVolcado(_idSocio)); // Muestra el cartel [CO] = "En CODENE" //this.lblEnCodene.Visible=(bool)oSocioVarios.codene; // Muestra el cartel [PJ] = "En proceso judicial" this.lblEnProcJudicial.Visible = oProcesoJudicialImplement.Estado(_idSocio); // Muestra el cartel [IT] = "Intimado" if (oSocioVarios.intimado == null) this.lblIntimado.Visible = false; else this.lblIntimado.Visible = (bool)oSocioVarios.intimado; if (this.lblIntimado.Visible) { string msjIntimado = "El socio ha sido intimado por deuda el " + oIntimacionImplement.GetByIdSocioUltimo(_idSocio).fecha; this.toolTip.SetToolTip(this.lblIntimado, "lblIntimado"); } string msjFaltante=VerificarInformacionFaltante(_idSocio); this.lblInfoFaltante.Visible = (msjFaltante != ""); }
private void CargarConveniosBySocio() { ConvenioImplement oConvenioImplement = new ConvenioImplement(); DataTable dtConvenios = oConvenioImplement.GetConveniosBySocioDT(_idSocio); this.dgvConvenio.DataSource = dtConvenios; }
private void btnTransferir_Click(object sender, EventArgs e) { convenios oConvenios = new convenios(); ConvenioImplement oConvenioImplement = new ConvenioImplement(); DataGridViewRow row = this.dgvConvenio.CurrentRow; if (row != null) { int _idConvenio = Convert.ToInt32(row.Cells[1].Value); Buscadores.frmBuscarSocio f = new Buscadores.frmBuscarSocio(); f.Text = "Facturas Seleccion"; int _idSocioATransferir = 0; if (f.ShowDialog() == DialogResult.OK) { _idSocioATransferir = f.ValorIdRetorno; if (_idSocioATransferir > 0) { oConvenios = oConvenioImplement.Get(_idConvenio); oConvenios.id_socio = _idSocioATransferir; oConvenioImplement.Update(oConvenios); CargarConveniosBySocio(); } else { frmVentanaInformativa frmInfo = new frmVentanaInformativa("No se selecciono ningun socio."); frmInfo.ShowDialog(); } } } }
private void GuardarNuevoConvenio() { convenios oConvenio = new convenios(); ConvenioImplement oConvenioImplement = new ConvenioImplement(); //Cancelo el adeudado oConvenioImplement.CancelarAdeudado(_idSocio); oConvenio.id_socio = _idSocio; oConvenio.fecha_convenio=dtpFechaConvenio.Value; oConvenio.importe_total = _ImporteDeuda; oConvenio.valor_cuota= _ImporteCuota; oConvenio.cuotas= _CantidadCuotas; oConvenio.facturadas= _CantidadCuotasCanceladas; oConvenio.pendientes= _CantidadCuotas - _CantidadCuotasCanceladas; oConvenio.finalizado= (_CantidadCuotas==_CantidadCuotasCanceladas); oConvenio.iva_facturas=0;//VER oConvenio.cuota_iva=0;//VER oConvenio.convenio_judicial=(chkConvenioAbogado.Checked); oConvenio.porcentaje_descuento_recargo=0;//VER oConvenio.importe_descuento_recargo=0;//VER oConvenio.tipo_descuento_recargo=-1; oConvenio.id_usuario=null; oConvenio.id_terminal=null; oConvenio.fecha_registro = DateTime.Today; oConvenio.moratoria = _convenioMora; int idConvenio=oConvenioImplement.Save(oConvenio); FacturasImplement oFacturasImplement = new FacturasImplement(); facturas oFacturas = new facturas(); foreach(int i in _ListaFacturas) { oFacturas = oFacturasImplement.Get(i); oFacturas.id_convenio = idConvenio; oFacturasImplement.Update(oFacturas); } DialogResult = DialogResult.OK; this.Close(); }