private void ConstruiesteRanduriDGV() { this.dgvLista.IncepeContructieRanduri(); BColectieClientiFacturi listaFacturi = BClientiFacturi.GetListByClientSiPerioada(this.ctrlCautareDupaTextClinica.IdObiectAfisajCorespunzator, this.ctrlPerioada.DataInceput, this.ctrlPerioada.DataSfarsit, CDefinitiiComune.EnumStare.Activa, null); BColectieClientiComenzi listaLucrari = BClientiComenzi.GetByListaIdFacturi(listaFacturi.GetListaId(), null); BColectieClientiPlatiComenzi listaPlatiComenzi = BClientiPlatiComenzi.GetByListIdComenzi(listaLucrari.GetListaId(), null); BColectieClientiComenzi listaLucrariPeFact = new BColectieClientiComenzi(); BColectieClientiPlatiComenzi listaPlatiComenziPeFact = new BColectieClientiPlatiComenzi(); foreach (var fact in listaFacturi) { if (fact.EsteActiv) { listaLucrariPeFact = listaLucrari.GetByIdFactura(fact.Id); listaPlatiComenziPeFact = listaPlatiComenzi.GetByIdComenzi(listaLucrariPeFact.GetListaId()); incarcaRand(this.dgvLista.Rows[this.dgvLista.Rows.Add()], fact, listaLucrariPeFact, listaPlatiComenziPeFact); } } filtreazaDupaText(); this.dgvLista.FinalizeazaContructieRanduri(); }
private void incarcaRand(DataGridViewRow pRand, BClientiFacturi pElem, BColectieClientiComenzi pListaComenzi, BColectieClientiPlatiComenzi pListaPlatiCurente) { pRand.Tag = pElem; double valoare = pElem.GetValoare(pListaComenzi, this.ctrlLeiEuro.Moneda, this.txtCursSchimb.ValoareDouble); double platit = pListaPlatiCurente.GetByIdComenzi(pListaComenzi.GetListaId()).GetValoarePlatita(); double restDePlata = valoare - platit; if (pElem.DataFactura != CConstante.DataNula) { pRand.Cells[EnumColoaneDGV.colData.ToString()].Value = pElem.DataFactura; } else { pRand.Cells[EnumColoaneDGV.colData.ToString()].Value = string.Empty; } pRand.Cells[EnumColoaneDGV.colFactura.ToString()].Value = pElem.ToStringImprimare(); pRand.Cells[EnumColoaneDGV.colValoare.ToString()].Value = CUtil.GetValoareMonetara(valoare); pRand.Cells[EnumColoaneDGV.colPlatit.ToString()].Value = CUtil.GetValoareMonetara(platit); pRand.Cells[EnumColoaneDGV.colRestDePlata.ToString()].Value = CUtil.GetValoareMonetara(restDePlata); pRand.Cells[EnumColoaneDGV.colObservatii.ToString()].Value = pElem.Observatii; DataGridViewPersonalizat.InitCelulaDeschideClasic(pRand, EnumColoaneDGV.colDetaliiFactura.ToString()); this.lSold += restDePlata; this.lTotal += valoare; }
private void ConstruiesteRanduriDGV() { this.dgvFacturi.IncepeContructieRanduri(); BColectieClientiFacturi listaFacturi = BClientiFacturi.GetListByClient(this.lClient.Id, CDL.iStomaLab.CDefinitiiComune.EnumStare.Toate, null); BColectieClientiComenzi listaLucrari = BClientiComenzi.GetByListaIdFacturi(listaFacturi.GetListaId(), null); BColectieClientiPlatiComenzi listaPlatiComenzi = BClientiPlatiComenzi.GetByListIdComenzi(listaLucrari.GetListaId(), null); BColectieClientiComenzi listaLucrariPeFact = new BColectieClientiComenzi(); BColectieClientiPlatiComenzi listaPlatiComenziPeFact = new BColectieClientiPlatiComenzi(); //Incarcam lista foreach (var fact in listaFacturi) { if (fact.EsteActiv) { listaLucrariPeFact = listaLucrari.GetByIdFactura(fact.Id); listaPlatiComenziPeFact = listaPlatiComenzi.GetByIdComenzi(listaLucrariPeFact.GetListaId()); incarcaRand(this.dgvFacturi.Rows[this.dgvFacturi.Rows.Add()], fact, listaLucrariPeFact, listaPlatiComenziPeFact); } } this.dgvFacturi.FinalizeazaContructieRanduri(); setTotalFacturi(); //this.lblTotalFacturi.Text = string.Format("{0}: {1}", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Facturi), this.dgvFacturi.RowCount.ToString()); }
private void initTotal() { BColectieClientiComenzi listaDinFacturiAfisate = this.lComenzi.GetByListaIdFacturi(this.lFacturi.GetListaId()); BColectieClientiPlatiComenzi listaPlatiCurente = BClientiPlatiComenzi.GetByListIdComenzi(listaDinFacturiAfisate.GetListaId(), null); double platit = listaPlatiCurente.GetByIdComenzi(listaDinFacturiAfisate.GetListaId()).GetValoarePlatita(); double totalFacturi = listaDinFacturiAfisate.GetTotal(this.ctrlLeiEuro.Moneda, this.txtCursSchimb.GetValoareMonetara()); this.txtSuma.ValoareDouble = totalFacturi - platit; initColoanaValoareFacturata(); }