//public async Task<ConceptoPago> GetConceptoPagosById(int id) //{ // var conceptoPagos = await _unitOfWork.ConceptoPagoRepository.GetById(id); // var clasePagos = _unitOfWork.ClasePagoRepository.GetAll().ToList(); // conceptoPagos.IdClasePagoNavigation = clasePagos.Where(x => x.IdClasePago == conceptoPagos.IdClasePago).FirstOrDefault(); // return conceptoPagos; //} public async Task <bool> UpdateConceptoPago(ConceptoPago conceptoPago) { _unitOfWork.ConceptoPagoRepository.Update(conceptoPago); await _unitOfWork.SaveChangesAsync(); return(true); }
public List <ConceptoPago> ObtenerConceptosPago() { try { MySqlCommand cmd = new MySqlCommand("SELECT id_Pago, Abono, No_Pago, Total, id_Alumno FROM concepto_pago", connection); MySqlDataAdapter adapter = new MySqlDataAdapter(cmd); DataTable table = new DataTable(); adapter.Fill(table); List <ConceptoPago> result_ = new List <ConceptoPago>(); foreach (DataRow row in table.Rows) { ConceptoPago ConceptoPago_ = new ConceptoPago(); ConceptoPago_.idConcepto = int.Parse(row[0].ToString()); ConceptoPago_.Abono = double.Parse(row[1].ToString()); ConceptoPago_.No_Pago = int.Parse(row[2].ToString()); ConceptoPago_.Total = double.Parse(row[3].ToString()); ConceptoPago_.idAlumno = int.Parse(row[4].ToString()); result_.Add(ConceptoPago_); } return(result_); } catch (Exception e) { MessageBox.Show(e.ToString()); return(null); } }
public static ConceptoPago ConvertAPago(this CarroPago carropago) { ConceptoPago colpago = new ConceptoPago(); colpago.Fecha = DateTime.Now; colpago.detalle = carropago.Lista; return(colpago); }
public async Task <bool> SoftDelete(ConceptoPago conceptoPago) { conceptoPago.SnActivo = 0; _unitOfWork.ConceptoPagoRepository.Update(conceptoPago); await _unitOfWork.SaveChangesAsync(); return(true); }
public void ConfigurarConceptoPago(ref ConceptoPago ObjConceptoPago, ref string Verificador) { CD_Datos CDDatos = new CD_Datos(); OracleCommand Cmd = null; try { OracleDataReader dr = null; string[] ParametrosIn = { "p_id_concepto", "p_id_escuela", "p_id_carrera", "p_imp_patrocinador", "p_evento", "p_matricula" }; object[] Valores = { ObjConceptoPago.IdConcepto, ObjConceptoPago.Dependencia, ObjConceptoPago.TipoPersonaStr, ObjConceptoPago.Donativo, ObjConceptoPago.Evento, ObjConceptoPago.NoControl }; Cmd = CDDatos.GenerarOracleCommandCursor("pkg_pagos.Obt_Importe_Concepto", ref dr, ParametrosIn, Valores); Verificador = "1"; while (dr.Read()) { ObjConceptoPago.IdConcepto = Convert.ToInt32(dr["id"]); ObjConceptoPago.Descripcion = Convert.ToString(dr["concepto"]); ObjConceptoPago.ClaveConcepto = Convert.ToString(dr["clave"]); ObjConceptoPago.ImporteConcepto = Convert.ToDouble(dr["importe"]); ObjConceptoPago.CobroXMateria = Convert.ToChar(dr["cobro_x_materia"]); ObjConceptoPago.MaxMateria = Convert.ToString(dr["maximo_materias"]); ObjConceptoPago.DiasVigencia = Convert.ToInt32(dr["dias_vigencia"]); ObjConceptoPago.CicloEscolar = Convert.ToInt32(dr["ciclo_escolar_actual"]); ObjConceptoPago.Anexo = Convert.ToString(dr["observaciones"]); ObjConceptoPago.FechaVigencia = Convert.ToString(dr["Fecha_Vigencia"]); Verificador = "0"; } dr.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } finally { CDDatos.LimpiarOracleCommand(ref Cmd); } }
public MontoCustomDTO() { reclamante = new Reclamante(); clase_pago = new ClasePago(); concepto = new ConceptoPago(); tipo_monto = new TipoMonto(); usuario = new Usuario(); instancia = new Instancia(); situacion = new Situacion(); }
//[HttpPut("{id}")] public async Task <IActionResult> Put([FromBody] ConceptoPago conceptoPago) { if (conceptoPago == null) { return(BadRequest()); } var result = await _service.Update(conceptoPago); return(result ? (IActionResult)Ok() : BadRequest()); }
public void ConsultarConceptoPago(ref ConceptoPago ObjConceptoPago, ref List <ConceptoPago> List) { try { CD_ConceptoPago CDConceptoPago = new CD_ConceptoPago(); CDConceptoPago.ConsultarConceptoPago(ref ObjConceptoPago, ref List); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void EliminarConceptoPago(ref string Verificador, ref ConceptoPago ObjConcepto) { try { CD_ConceptoPago CDConceptoPago = new CD_ConceptoPago(); CDConceptoPago.EliminarConceptoPago(ref Verificador, ref ObjConcepto); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void ConfigurarConceptoPago(ref ConceptoPago ConceptoPago, ref string Verificador) { try { CD_ConceptoPago CDConceptoPago = new CD_ConceptoPago(); CDConceptoPago.ConfigurarConceptoPago(ref ConceptoPago, ref Verificador); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void ValidarConcepto(ref ConceptoPago ConceptoPago, ref string Verificador, ref string Mensaje) { try { CD_ConceptoPago CDConceptoPago = new CD_ConceptoPago(); CDConceptoPago.ValidarConcepto(ref ConceptoPago, ref Verificador, ref Mensaje); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult AddOrEdit(ConceptoPago concepto) { if (concepto.IdConceptoPago == 0) { concepto.FechaCreacion = DateTime.Today; bool flag = this.conceptopago.GuardarConceptoPago(concepto); return(Json(new { success = true, message = "Saved Successfully" }, JsonRequestBehavior.AllowGet)); } else { concepto.FechaCreacion = DateTime.Today; bool flag = this.conceptopago.GuardarConceptoPago(concepto); return(Json(new { success = true, message = "Updated Successfully" }, JsonRequestBehavior.AllowGet)); } }
public void ConsultarConceptoPago(ref ConceptoPago ObjConceptoPago, ref List <ConceptoPago> List) { CD_Datos CDDatos = new CD_Datos(); OracleCommand cmm = null; try { OracleDataReader dr = null; string[] ParametrosIn = { "p_id_ficha_bancaria" }; Object[] Valores = { ObjConceptoPago.IdFichaBancaria }; cmm = CDDatos.GenerarOracleCommandCursor("pkg_pagos.Obt_Grid_Conceptos_Selecionado", ref dr, ParametrosIn, Valores);//text while (dr.Read()) { ObjConceptoPago = new ConceptoPago(); ObjConceptoPago.Id = Convert.ToInt32(dr["id"]); ObjConceptoPago.IdConcepto = Convert.ToInt32(dr["id_concepto"]); ObjConceptoPago.Descripcion = Convert.ToString(dr["concepto"]); ObjConceptoPago.ClaveConcepto = Convert.ToString(dr["clave"]); ObjConceptoPago.ImporteConcepto = Convert.ToDouble(dr["importe"]); ObjConceptoPago.Observaciones = Convert.ToString(dr["label_materias"]); ObjConceptoPago.Anexo = Convert.ToString(dr["anexo"]); List.Add(ObjConceptoPago); } dr.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } finally { CDDatos.LimpiarOracleCommand(ref cmm); } }
private void dtConceptoPago_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { _selectedConcepto = new ConceptoPago { Id = (int)dtConceptoPago.Rows[e.RowIndex].Cells["Id"].Value, Descripcion = dtConceptoPago.Rows[e.RowIndex].Cells["Descripcion"].Value?.ToString(), Activo = true }; } else { _selectedConcepto = null; } btnDelete.Enabled = _selectedConcepto != null; btnLimpiar.Enabled = _selectedConcepto != null; SetSelectedInfo(); }
public async Task <bool> Save(ConceptoPago entity) { if (entity == null) { return(false); } entity.FechaCreacion = entity.FechaModificacion = DateTime.Now; entity.Activo = true; _context.ConceptoPago.Add(entity); try { var result = await _context.SaveChangesAsync(); return(result > 0); } catch (Exception e) { return(false); } }
public ConceptoPago ObtenerConceptoPagoPorCodigo(string codigoConceptoPago) { string spName = "[ConceptoPago_GetById]"; List <ConceptoPago> ConceptoPagos = new List <ConceptoPago>(); ConceptoPago item = null; using (SqlConnection con = new SqlConnection(ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = spName; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@IdConceptoPago", codigoConceptoPago); cmd.Connection = con; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var ConceptoPago = new ConceptoPago { IdConceptoPago = Convert.ToInt32(reader["IdConceptoPago"]), NroConcepto = reader["NroConcepto"].ToString(), Descripcion = reader["Descripcion"].ToString(), FechaCreacion = Convert.ToDateTime(reader["FechaCreacion"] is DBNull ? null : reader["FechaCreacion"]), Estado = Convert.ToInt32(reader["Estado"] is DBNull ? 0 : reader["Estado"]), }; ConceptoPagos.Add(ConceptoPago); item = ConceptoPago; } } } return(item); }
public ConceptoPago Create(ConceptoPago Model) { try { using (var dbContextTransaction = _context.Database.BeginTransaction()) { _context.ConceptoPagos.Add(Model); _context.SaveChanges(); dbContextTransaction.Commit(); Model.Estado = _context .Estados .Find(Model.IdEstado); return(Model); } } catch (Exception) { throw; } }
public ConceptoPago Update(ConceptoPago Model) { try { using (var dbContextTransaction = _context.Database.BeginTransaction()) { _context.Entry(Model).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); dbContextTransaction.Commit(); Model.Estado = _context .Estados .Find(Model.IdEstado); return(Model); } } catch (Exception) { throw; } }
public void ValidarConcepto(ref ConceptoPago ObjConceptoPago, ref string Verificador, ref string Mensaje) { CD_Datos CDDatos = new CD_Datos(); OracleCommand Cmd = null; try { string[] ParametrosIn = { "p_id_ficha_bancaria", "p_id_concepto" }; object[] Valores = { ObjConceptoPago.IdFichaBancaria, ObjConceptoPago.IdConcepto }; string[] ParametrosOut = { "p_Resultado", "p_id_registro", "p_mensaje" }; Cmd = CDDatos.GenerarOracleCommand("VAL_CONFLICTOS_ARBOL", ParametrosIn, Valores, ParametrosOut); Verificador = Convert.ToString(Cmd.Parameters["p_Resultado"].Value); ObjConceptoPago.Id = Convert.ToInt32(Cmd.Parameters["p_id_registro"].Value); Mensaje = Convert.ToString(Cmd.Parameters["p_mensaje"].Value); } catch (Exception ex) { throw new Exception(ex.Message); } finally { CDDatos.LimpiarOracleCommand(ref Cmd); } }
public IActionResult Update([FromBody] ConceptoPago ConceptoPago) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { if (ConceptoPago.Id == 0) { return(BadRequest( new Response { IsSuccess = false, Message = "El Id del concepto de pago es requerido" })); } _IConceptoPagoService.Update(ConceptoPago); return(Ok( new Response { IsSuccess = true, Data = ConceptoPago })); } catch (Exception ex) { return(BadRequest( new Response { IsSuccess = false, Message = $"No se pudo actualizar el concepto de pago >> {ex.Message}" })); } }
public ConceptoPago ObtenerConceptoPagoPorNroConcepto(string codigoConceptoPago) { string spName = "[ConceptoPago_GetBy_like]"; List <ConceptoPago> ConceptoPagos = new List <ConceptoPago>(); ConceptoPago item = null; using (SqlConnection con = new SqlConnection(ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = spName; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@start", codigoConceptoPago); cmd.Connection = con; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var ConceptoPago = new ConceptoPago { IdConceptoPago = Convert.ToInt32(reader["IdConceptoPago"]), NroConcepto = reader["NroConcepto"].ToString(), }; ConceptoPagos.Add(ConceptoPago); item = ConceptoPago; } } } return(item); }
private void FrmVisorReporteDocumentos_Load(object sender, EventArgs e) { SqlConnection ocon = new SqlConnection("Data Source=ana-alex-brian.database.windows.net;Initial Catalog=Cuentas_por_pagar;Persist Security Info=True;User ID=propietaria;Password=#Seguridad1"); ocon.Open(); string sSQL = "select * from Reporte_Documentos where 1 = 1"; if (NombreProveedor.Trim().Length > 0) { sSQL += " and Nombre_Proveedor LIKE '%" + NombreProveedor + "%'"; } if (ConceptoPago.Trim().Length > 0) { sSQL += " and Concepto_Pago = '" + ConceptoPago + "'"; } if (Estado.Trim().Length > 0) { sSQL += " and Estado = '" + Estado + "'"; } if (NumFacturaDesde.Trim().Length > 0 && NumFacturaHasta.Trim().Length > 0) { sSQL += " and Numero_Factura between '" + NumFacturaDesde + "' and '" + NumFacturaHasta + "'"; } else if (NumFacturaDesde.Trim().Length > 0) { sSQL += " and Numero_Factura > '" + NumFacturaDesde + "'"; } else if (NumFacturaHasta.Trim().Length > 0) { sSQL += " and Numero_Factura < '" + NumFacturaHasta + "'"; } if (FechaDocumentoDesde.Trim().Length > 0 && FechaDocumentoHasta.Trim().Length > 0) { sSQL += " and Fecha_Documento between '" + FechaDocumentoDesde + "' and '" + FechaDocumentoHasta + "'"; } else if (FechaDocumentoDesde.Trim().Length > 0) { sSQL += " and Fecha_Documento > '" + FechaDocumentoDesde + "'"; } else if (FechaDocumentoHasta.Trim().Length > 0) { sSQL += " and Fecha_Documento < '" + FechaDocumentoHasta + "'"; } if (FechaRegistroDesde.Trim().Length > 0 && FechaRegistroHasta.Trim().Length > 0) { sSQL += " and Fecha_Registro between '" + FechaRegistroDesde + "' and '" + FechaRegistroHasta + "'"; } else if (FechaRegistroDesde.Trim().Length > 0) { sSQL += " and Fecha_Registro > '" + FechaRegistroDesde + "'"; } else if (FechaRegistroHasta.Trim().Length > 0) { sSQL += " and Fecha_Registro < '" + FechaRegistroHasta + "'"; } if (MontoDesde > 0 && MontoHasta > 0) { sSQL += " and Monto between " + MontoDesde + " and " + MontoHasta; } else if (MontoDesde > 0) { sSQL += " and Monto > " + MontoDesde; } else if (MontoHasta > 0) { sSQL += " and Monto < " + MontoHasta; } DataTable odt = new DataTable(); SqlDataAdapter oda = new SqlDataAdapter(sSQL, ocon); oda.Fill(odt); ReportDataSource rds = new ReportDataSource(); rds.Value = odt; rds.Name = "DataSetDocumentos"; rpvDocumentos.LocalReport.DataSources.Clear(); rpvDocumentos.LocalReport.DataSources.Add(rds); rpvDocumentos.LocalReport.ReportEmbeddedResource = "ReporteDocumentos.rdlc"; rpvDocumentos.LocalReport.ReportPath = @"../../ReporteDocumentos.rdlc"; rpvDocumentos.RefreshReport(); // TODO: This line of code loads data into the 'DataSetDocumentos.Reporte_Documentos' table. You can move, or remove it, as needed. //this.Reporte_DocumentosTableAdapter.Fill(this.DataSetDocumentos.Reporte_Documentos); //this.rpvDocumentos.RefreshReport(); }
public bool GuardarConceptoPago(ConceptoPago ConceptoPago) { return(conceptoPagoDAL.SaveConceptoPago(ConceptoPago)); }