private void GetCreditosCompra(int ClienteID) { //traer créditos DataTable DtCreditos = new DataTable(); DtCreditos = ObjCL_Credito.GetCreditosClienteConDeuda(ClienteID);//creditos que presentan deuda LstCreditos.HoldFields(); LstCreditos.DataSource = DtCreditos; //listar las deudas totales DataTable DtCreditosTotal = new DataTable(); DtCreditosTotal = ObjCL_Pago.GetCreditosTotal(ClienteID); decimal TotalCredito = 0, TotalPagado = 0, DeudaTotal = 0; TotalCredito = Convert.ToDecimal(DtCreditosTotal.Rows[0]["TotalCredito"]); TotalPagado = Convert.ToDecimal(DtCreditosTotal.Rows[0]["TotalPagado"]); DeudaTotal = TotalCredito - TotalPagado; TxtDeudaTotal.ReadOnly = false; TxtTotalPagado.ReadOnly = false; TxtPorPagar.ReadOnly = false; TxtDeudaTotal.Text = TotalCredito.ToString("C"); TxtTotalPagado.Text = TotalPagado.ToString("C"); TxtPorPagar.Text = DeudaTotal.ToString("C"); TxtDeudaTotal.ReadOnly = true; TxtTotalPagado.ReadOnly = true; TxtPorPagar.ReadOnly = true; }
private void GetCreditosCompra(int ClienteID) { //traer créditos DataTable DtCreditos = new DataTable(); DtCreditos = ObjCL_Credito.GetCreditosCliente(ClienteID, "T"); LstCreditos.HoldFields(); LstCreditos.DataSource = DtCreditos; }