private void DgvLista_CellClick(object sender, DataGridViewCellEventArgs e) { if (this.lSeIncarca || e.RowIndex < 0) { return; } try { incepeIncarcarea(); string numeColoana = this.dgvLista.Columns[e.ColumnIndex].Name; if (numeColoana.Equals(EnumColoaneDGV.colDetaliiClinica.ToString())) { BClientiPlati plata = this.dgvLista.SelectedRow.Tag as BClientiPlati; IHMUtile.DeschideDosarClient(this.GetFormParinte(), plata.IdClient); } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
private void setNrLinii(int pNrLinii) { double totalRON = 0; BClientiPlati plata = null; this.lTotalIncasariInRON = 0; double valTemp = 0; foreach (DataGridViewRow rand in this.dgvLista.Rows) { if (rand.Visible) { plata = rand.Tag as BClientiPlati; valTemp = DataGridViewPersonalizat.GetValoareTagColoanaRand(rand, EnumColoaneDGV.colValoare.ToString()); totalRON += valTemp; } } this.lTotalIncasariInRON = totalRON; this.lblTotal.Text = string.Format("{0}: {1} [{2}: {3}]", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Incasari), this.dgvLista.RowCount, BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Total), CUtil.GetValoareMonetara(totalRON)); }
private void DgvLista_StergereLinie(DataGridViewPersonalizat pDGVSender, int pIndexRand) { if (this.lSeIncarca || pIndexRand < 0) { return; } try { incepeIncarcarea(); if (Mesaj.Confirmare(this.GetFormParinte(), BMultiLingv.getElementById(BMultiLingv.EnumDictionar.ConfirmatiStergerea), BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Stergere))) { BClientiPlati plata = this.dgvLista.Rows[pIndexRand].Tag as BClientiPlati; plata.Close(true, string.Empty, null); ConstruiesteRanduriDGV(); } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
private void incarcaRandIncasare(DataGridViewRow pRand, BClientiPlati pElem) { pRand.Tag = pElem; DataGridViewPersonalizat.InitCelulaEditare(pRand, this.lEcranInModificare); pRand.Cells[EnumColoaneDGVIncasari.colData.ToString()].Value = pElem.DataPlata; pRand.Cells[EnumColoaneDGVIncasari.colModalitate.ToString()].Value = BDefinitiiGenerale.StructModalitatePlata.GetStringByEnum((BDefinitiiGenerale.EnumModalitatePlata)pElem.ModalitatePlata); DataGridViewPersonalizat.InitCelulaValoareMonetara(pRand, EnumColoaneDGVIncasari.colValoare.ToString(), pElem.SumaPlatita, CDefinitiiComune.EnumTipMoneda.Lei); pRand.Cells[EnumColoaneDGVFacturi.colObservatii.ToString()].Value = pElem.Observatii; pRand.Cells[EnumColoaneDGVIncasari.colCursBNR.ToString()].Value = pElem.CursBNR; DataGridViewPersonalizat.InitCelulaStergere(pRand); }
private void ConstruiesteRanduriDGV() { this.dgvLista.IncepeContructieRanduri(); BColectieClienti listaElem = BClienti.GetListaClientiNoiPerioada(this.ctrlPerioada.DataInceput, this.ctrlPerioada.DataSfarsit, null); List <int> listaIdClinici = listaElem.GetListaId(); BColectieClientiComenzi listaUltimelorLucrari = BClientiComenzi.GetUltimeleLucrariPerClinica(listaIdClinici, null); BColectieClientiFacturi listaUltimelorFacturi = BClientiFacturi.GetUltimeleFacturiPerClinica(listaIdClinici, null); Dictionary <int, double> dictIdClinicaTotalFacturi = BClientiFacturi.GetDictIdClinicaTotalFacturi(listaIdClinici, null); Dictionary <int, double> dictIdClinicaTotalIncasari = BClientiPlati.GetDictIdClinicaTotalIncasari(listaIdClinici, null); Dictionary <int, int> dictIdClinicaNrLucrari = BClientiComenzi.GetDictIdClinicaNrLucrari(listaIdClinici, null); int idTemp = 0; double totalFact = 0; double totalInc = 0; foreach (var elem in listaElem) { idTemp = elem.Id; if (dictIdClinicaTotalFacturi.ContainsKey(idTemp)) { totalFact = dictIdClinicaTotalFacturi[idTemp]; } else { totalFact = 0; } if (dictIdClinicaTotalIncasari.ContainsKey(idTemp)) { totalInc = dictIdClinicaTotalIncasari[idTemp]; } else { totalInc = 0; } incarcaRand(this.dgvLista.AdaugaRandNou(), elem, listaUltimelorLucrari.GetUltimaByIdClient(elem.Id), listaUltimelorFacturi.GetUltimaByIdClient(elem.Id), dictIdClinicaNrLucrari.ContainsKey(elem.Id) ? dictIdClinicaNrLucrari[elem.Id] : 0, totalFact, totalInc); } this.dgvLista.FinalizeazaContructieRanduri(); this.lblTotal.Text = string.Format("{0}: {1}", BMultiLingv.getElementById(BMultiLingv.EnumDictionar.ClientiNoi), this.dgvLista.RowCount.ToString()); }
private bool salveaza() { BDefinitiiGenerale.EnumModalitatePlata modalitate = getModalitateDePlata(); bool esteValid = this.txtSuma.ValoareDouble > 0 && modalitate != BDefinitiiGenerale.EnumModalitatePlata.Nedefinit && this.ctrlDataOraIncasare.AreValoare && this.ctrlDataOraIncasare.DataAfisata <= DateTime.Now; if (esteValid) { return(BClientiPlati.Add(this.lClient.Id, this.ctrlDataOraIncasare.DataAfisata, this.txtSuma.ValoareDouble, modalitate, this.txtCursSchimb.ValoareDouble, this.txtObservatii.Text, this.lComenzi, null) > 0); } else { seteazaAlerta(); } return(false); }
private void ConstruiesteRanduriDGVIncasari() { this.dgvIncasari.IncepeContructieRanduri(); BColectieClientiPlati listaPlati = BClientiPlati.GetListByParamIdClient(this.lClient.Id, CDefinitiiComune.EnumStare.Activa, null); foreach (var item in listaPlati) { incarcaRandIncasare(this.dgvIncasari.Rows[this.dgvIncasari.Rows.Add()], item); } this.dgvIncasari.FinalizeazaContructieRanduri(); setTotalIncasari(); setSold(); }
private FormCreeazaIncasareClient(BClienti pClient, BColectieClientiComenzi pComenzi, BColectieClientiFacturi pFacturi, BClientiPlati pPlata) { this.DoubleBuffered = true; InitializeComponent(); this.lClient = pClient; this.lComenzi = pComenzi; this.lFacturi = pFacturi; this.lPlata = pPlata; if (!CCL.UI.IHMUtile.SuntemInDebug()) { adaugaHandlere(); initTextML(); this.CentratCuDeplasare(); } }
public void Initializeaza(BClientiPlati pPlata) { base.InitializeazaVariabileleGenerale(); incepeIncarcarea(); this.ctrlDataOraIncasare.Initializeaza(DateTime.Now, ComboBoxOra.EnumPas.CinciMinute); this.cboModalitateIncasare.DataSource = BDefinitiiGenerale.StructModalitatePlata.GetListaModalitatiAchitare(false); //this.cboModalitateIncasare.ValueMember = "Id"; //this.cboModalitateIncasare.DisplayMember = "Nume"; //this.txtCursSchimb.ValoareDouble = BComportamentAplicatie.GetCursBNR(); //this.txtSuma.Goleste(); if (pPlata != null) { this.ctrlDataOraIncasare.Initializeaza(pPlata.DataPlata, ComboBoxOra.EnumPas.CinciMinute); this.cboModalitateIncasare.SelectedItem = pPlata.ModalitatePlata; this.txtCursSchimb.Text = pPlata.CursBNR.ToString(); this.txtSuma.Text = pPlata.ToStringSumaPlatita(); this.txtObservatii.Text = pPlata.Observatii; this.txtSuma.AllowModification(false); this.lblSold.Visible = false; this.ctrlLeiEuro.AllowModification(false); this.ctrlDataOraIncasare.AllowModification(false); } else { this.ctrlDataOraIncasare.Initializeaza(DateTime.Now, ComboBoxOra.EnumPas.CinciMinute); this.txtCursSchimb.ValoareDouble = BComportamentAplicatie.GetCursBNR(); this.txtSuma.Goleste(); this.txtSuma.Focus(); this.txtObservatii.Goleste(); this.cboModalitateIncasare.SelectedItem = BDefinitiiGenerale.EnumModalitatePlata.Banca; initTotal(); } ConstruiesteColoaneDGV(); ConstruiesteRanduriDGV(); initSoldClient(); finalizeazaIncarcarea(); }
private void ConstruiesteRanduriDGV() { this.dgvLista.IncepeContructieRanduri(); BColectieClientiPlati listaPlati = null; int idClinica = this.ctrlCautareDupaTextClinica.GetIdClinica(); listaPlati = BClientiPlati.GetListaIncasari(idClinica, this.ctrlPerioada.DataInceput, this.ctrlPerioada.DataSfarsit, null); foreach (var item in listaPlati) { incarcaRand(this.dgvLista.Rows[this.dgvLista.Rows.Add()], item); } filtreazaDupaText(); this.dgvLista.FinalizeazaContructieRanduri(); }
private void DgvLista_EditareLinie(DataGridViewPersonalizat pDGVSender, int pIndexRand) { if (this.lSeIncarca) { return; } try { incepeIncarcarea(); BClientiPlati plata = this.dgvLista.Rows[pIndexRand].Tag as BClientiPlati; if (plata != null) { BColectieClientiPlatiComenzi listaPlati = BClientiPlatiComenzi.GetByIdPlata(plata.Id, null); if (!CUtil.EsteListaVida <BClientiPlatiComenzi>(listaPlati)) { BColectieClientiComenzi listaLucrari = BClientiComenzi.getByListaId(listaPlati.GetListaIdComenzi(), null); BColectieClientiFacturi listaFacturi = BClientiFacturi.GetByListId(listaLucrari.GetListaIdFacturi(), null); BClienti client = plata.GetClient(null); if (FormCreeazaIncasareClient.Afiseaza(this.GetFormParinte(), client, listaLucrari, listaFacturi, plata)) { incarcaRand(this.dgvLista.Rows[pIndexRand], plata); } } } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
public static bool Afiseaza(Form pEcranPariente, BClienti pClient, BColectieClientiComenzi pComenzi, BColectieClientiFacturi pFacturi, BClientiPlati pPlata) { using (FormCreeazaIncasareClient ecran = new FormCreeazaIncasareClient(pClient, pComenzi, pFacturi, pPlata)) { ecran.AplicaPreferinteleUtilizatorului(); return(CCL.UI.IHMUtile.DeschideEcran(pEcranPariente, ecran)); } }