private void DgvListaComenzi_EditareLinie(DataGridViewPersonalizat pDGVSende, int pIndexRand) { this.modedit = true; if (this.lSeIncarca) { return; } try { incepeIncarcarea(); /// lore 02.09.2019 // Tuple<BClientiComenzi, BListaPreturiClienti> comandaDeModificat = this.dgvListaComenzi.Rows[pIndexRand].Tag as Tuple<BClientiComenzi, BListaPreturiClienti>; // BListaPreturiStandard pretstandard = BListaPreturiStandard.getById(comandaDeModificat.Item1.IdLucrare, null); /////////////////////// BClientiComenzi comandaDeModificat = this.dgvListaComenzi.Rows[pIndexRand].Tag as BClientiComenzi; if (comandaDeModificat != null) //&& !this.btnActivDezactivat.Selectat { BListaPreturiStandard lucrare = BListaPreturiStandard.getById(comandaDeModificat.IdLucrare, null); if (TablouDeBord.Clienti.FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comandaDeModificat, BClienti.getClient(comandaDeModificat.IdClient, null), lucrare)) { incarcaRand(this.dgvListaComenzi.Rows[pIndexRand], comandaDeModificat); //, pretstandard, comandaDeModificat.Item2); /// lore 02.09.2019 } } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
private void BtnDeschide_Click(object sender, EventArgs e) { if (this.lSeIncarca) { return; } try { incepeIncarcarea(); BListaPreturiStandard lucrare = FormListaLucrari.Afiseaza(this.GetFormParinte(), null); if (lucrare != null) { this.Initializeaza(new StructIdDenumire(lucrare.Id, BListaPreturiStandard.getById(lucrare.Id, null).Denumire), this.lTipDeschidere); ascundeEcranCautare(); anuntaSelectia(); } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
private void DgvComenzi_EditareLinie(DataGridViewPersonalizat pDGVSender, int pIndexRand) { if (this.lSeIncarca) { return; } try { incepeIncarcarea(); BClientiComenzi comandaDeModificat = pDGVSender.Rows[pIndexRand].Tag as BClientiComenzi; if (comandaDeModificat != null) { BListaPreturiStandard lucrare = BListaPreturiStandard.getById(comandaDeModificat.IdLucrare, null); if (FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comandaDeModificat, this.lClient, lucrare)) { incarcaRand(pDGVSender.Rows[pIndexRand], comandaDeModificat); } } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
///lore 30.08.3019 private void DgvListaDePreturiClienti_CellEndEdit(object sender, DataGridViewCellEventArgs e) { this.modedit = true; if (this.lSeIncarca || e.RowIndex < 0) { return; } try { incepeIncarcarea(); Tuple <BClientiComenzi, BListaPreturiClienti> valori = this.dgvListaComenzi.Rows[e.RowIndex].Tag as Tuple <BClientiComenzi, BListaPreturiClienti>; if (valori == null) { return; } BClientiComenzi pelement = valori.Item1; BListaPreturiClienti pretClient = valori.Item2; // BListaPreturiClienti pretClient = BListaPreturiClienti.GetPretClient(pelement.IdLucrare, pelement.IdClient, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null); BListaPreturiStandard pretStandard = BListaPreturiStandard.getById(pelement.IdLucrare, null); bool refresh = false; if (pretClient != null) { refresh = pretClient.UpdatePret(CUtil.GetAsDouble(this.dgvListaComenzi.Rows[e.RowIndex].Cells[e.ColumnIndex].Value)); //numar = this.dgvListaComenzi.Rows[e.RowIndex].Cells[e.ColumnIndex].Value } else { //Adaugare double pretNou = CUtil.GetAsDouble(this.dgvListaComenzi.Rows[e.RowIndex].Cells[e.ColumnIndex].Value); if (pretNou != pretStandard.GetValoare()) { int id = BListaPreturiClienti.Add(pretStandard.Id, this.lClient.Id, pretNou, pretStandard.GetMoneda(), pretStandard.TermenMediuZile, null); if (id > 0) { refresh = true; pretClient = new BListaPreturiClienti(id); } } } /* if (refresh) * { * incarcaRand(this.dgvListaComenzi.Rows[e.RowIndex], pelement);//, pretStandard, pretClient); * }*/ incarcaRand(this.dgvListaComenzi.Rows[e.RowIndex], pelement); } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
public void SelectieInteligenta(int pIdLucrare) { if (this.GetIdLucrare() == pIdLucrare) { this.Goleste(); } else { this.lgfLucrare.ObiectAfisajCorespunzator = BListaPreturiStandard.getById(pIdLucrare, null); } cereUpdate(); }
private bool Salveaza() { bool esteValid = BListaPreturiStandard.SuntInformatiileNecesareCoerente(this.txtDenumireLucrare.Text); if (this.lLucrare == null) { if (esteValid) { int id = BListaPreturiStandard.Add(this.txtDenumireLucrare.Text, this.txtPrescurtareLucrare.Text, this.txtCodLucrare.Text, CUtil.GetTextInt32(this.txtTermenMediuLucrare.Text), getIdCategorie(), getValoareRon(), getValoareEuro(), null); this.lLucrare = BListaPreturiStandard.getById(id, null); salveazaEtape(this.lLucrare.Id); } else { seteazaAlerta(); } } else { this.lLucrare.Denumire = this.txtDenumireLucrare.Text; this.lLucrare.DenumirePrescurtata = this.txtPrescurtareLucrare.Text; this.lLucrare.CodIntern = this.txtCodLucrare.Text; this.lLucrare.IdCategorie = getIdCategorie(); Tuple <double, EnumTipMoneda> tupleValoare = this.ctrlValoareMonetara.ValoareTuple; if (tupleValoare.Item2 == EnumTipMoneda.Lei) { this.lLucrare.ValoareRON = tupleValoare.Item1; this.lLucrare.ValoareEUR = 0; } else { this.lLucrare.ValoareRON = 0; this.lLucrare.ValoareEUR = tupleValoare.Item1; } this.lLucrare.TermenMediuZile = CUtil.GetTextInt32(this.txtTermenMediuLucrare.Text); if (esteValid) { this.lLucrare.UpdateAll(); salveazaEtape(this.lLucrare.Id); } else { seteazaAlerta(); } } return(esteValid); }
private void ConstruiesteRanduriDGV(BColectieClientiComenzi pListaComenzi) { this.dgvListaComenzi.IncepeContructieRanduri(); foreach (var elem in pListaComenzi) { ///lore 02.09.2019 BListaPreturiStandard pElem2 = BListaPreturiStandard.getById(elem.IdLucrare, null); BListaPreturiClienti pElemClient = BListaPreturiClienti.GetPretClient(elem.IdLucrare, elem.IdClient, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null); incarcaRand(this.dgvListaComenzi.Rows[this.dgvListaComenzi.Rows.Add()], elem);//, pElem2, pElemClient); } this.dgvListaComenzi.FinalizeazaContructieRanduri(); filtreazaDupaText(); }
private void incarcaRand(DataGridViewRow pRand, BListaPreturiStandard pElem) { pRand.Tag = pElem; DataGridViewPersonalizat.InitCelulaEditare(pRand, this.lEcranInModificare); pRand.Cells[EnumColoaneDGV.colDenumire.ToString()].Value = pElem.Denumire; pRand.Cells[EnumColoaneDGV.colPrescurtare.ToString()].Value = pElem.DenumirePrescurtata; pRand.Cells[EnumColoaneDGV.colCod.ToString()].Value = pElem.CodIntern; pRand.Cells[EnumColoaneDGV.colCategorie.ToString()].Value = BListaPreturiStandard.getById(BListaPreturiStandard.getByIdCategorie(pElem.IdCategorie, null), null); pRand.Cells[EnumColoaneDGV.colTermenMediu.ToString()].Value = pElem.TermenMediuZile; pRand.Cells[EnumColoaneDGV.colValoareRon.ToString()].Value = pElem.ValoareRON; pRand.Cells[EnumColoaneDGV.colValoareEuro.ToString()].Value = pElem.ValoareEUR; DataGridViewPersonalizat.InitCelulaStergere(pRand); }
public void Initializeaza(BListaPreturiStandard pPretLucrare) { base.InitializeazaVariabileleGenerale(); this.lPretLucrare = pPretLucrare; incepeIncarcarea(); if (this.lPretLucrare == null) { this.txtDenumireLucrare.Goleste(); this.txtPrescurtareLucrare.Goleste(); this.txtCodLucrare.Goleste(); this.lblCautaCategorieLucrare.Goleste(); this.txtValoareLucrare.Goleste(); this.chkLucrareEuro.Checked = false; this.chkLucrareRon.Checked = false; this.txtTermenMediuLucrare.Goleste(); this.lblCautaSubcategorieLucrare.Goleste(); } else { this.lColectieLucrariEtape = BLucrariEtape.GetListByParamIdLucrare(this.lPretLucrare.Id, CDL.iStomaLab.CDefinitiiComune.EnumStare.Activa, null); FormListaCategorii._SCategorie = BCategorii.getCategorieById(this.lPretLucrare.IdCategorie, null); this.txtDenumireLucrare.Text = this.lPretLucrare.Denumire; this.txtPrescurtareLucrare.Text = this.lPretLucrare.DenumirePrescurtata; this.txtCodLucrare.Text = this.lPretLucrare.CodIntern; this.lblCautaCategorieLucrare.Text = BListaPreturiStandard.getById(BListaPreturiStandard.getByIdCategorie(this.lPretLucrare.IdCategorie, null), null); this.lblCautaSubcategorieLucrare.Text = BListaPreturiStandard.getById(this.lPretLucrare.IdCategorie, null); if (this.lPretLucrare.ValoareEUR != 0) { this.chkLucrareEuro.Checked = true; this.txtValoareLucrare.Text = lPretLucrare.ValoareEUR.ToString(); } else { this.chkLucrareRon.Checked = true; this.txtValoareLucrare.Text = lPretLucrare.ValoareRON.ToString(); } this.txtTermenMediuLucrare.Text = this.lPretLucrare.TermenMediuZile.ToString(); } ConstruiesteColoaneDGV(); ConstruiesteRanduriDGV(); finalizeazaIncarcarea(); }
private void DgvLista_CellClick(object sender, DataGridViewCellEventArgs e) { if (this.lSeIncarca || e.RowIndex < 0) { return; } try { incepeIncarcarea(); string denumireColoanaSelectata = this.dgvLista.Columns[e.ColumnIndex].Name; BClientiComenziEtape etapaSelectata = this.dgvLista.SelectedRow.Tag as BClientiComenziEtape; if (etapaSelectata != null) { if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colDeschideClinica.ToString()) && etapaSelectata.IdClient != 0) { if (TablouDeBord.Clienti.FormDosarClient.Afiseaza(this.GetFormParinte(), BClienti.getClient(etapaSelectata.IdClient, null))) { incarcaRand(this.dgvLista.SelectedRow, etapaSelectata); } } else if (denumireColoanaSelectata.Equals(EnumColoaneDGV.colDeschideLucrare.ToString()) && etapaSelectata.IdLucrare != 0) { BClientiComenzi comanda = BClientiComenzi.getComanda(etapaSelectata.IdComandaClient, null); BClienti client = BClienti.getClient(etapaSelectata.IdClient, null); BListaPreturiStandard lucrare = BListaPreturiStandard.getById(etapaSelectata.IdLucrare, null); if (TablouDeBord.Clienti.FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comanda, client, lucrare)) { incarcaRand(this.dgvLista.SelectedRow, etapaSelectata); } } } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
public void Initializeaza(BClientiComenzi pComanda, BClienti pClient, BListaPreturiStandard pLucrare) { base.InitializeazaVariabileleGenerale(); incepeIncarcarea(); this.cboComandaReprezentant.Focus(); this.txtComandaPacientNume.CapitalizeazaPrimaLitera = true; this.txtComandaPacientPrenume.CapitalizeazaPrimaLitera = true; this.btnVeziToateEtapele.Visible = this.lComanda != null; this.lgfTehnician.FolosesteToString = true; this.lgfLucrare.FolosesteToString = true; this.lgfClinica.AfiseazaButonGuma = false; this.lgfClinica.AfiseazaButonCautare = false; this.lgfLucrare.AfiseazaButonGuma = false; this.lgfTehnician.AfiseazaButonGuma = false; if (this.lComanda == null) { this.lgfClinica.Goleste(); this.lgfLucrare.Text = this.lLucrareSelectata.Denumire; this.lgfTehnician.Goleste(); this.txtNrElemente.Text = BMultiLingv.getElementById(BMultiLingv.EnumDictionar.Unu); this.lgfClinica.Text = this.lClient.Denumire; this.ctrlComandaDataPrimire.DataAfisata = DateTime.Now; if (this.lLucrareSelectata.TermenMediuZile != 0) { this.ctrlComandaDataLaGata.Initializeaza(this.ctrlComandaDataPrimire.DataAfisata.AddDays(this.lLucrareSelectata.TermenMediuZile), ComboBoxOra.EnumPas.JumatateDeOra); } else { this.ctrlComandaDataLaGata.Initializeaza(CConstante.DataNula, ComboBoxOra.EnumPas.JumatateDeOra); } this.ctrlDataOraTermen.Initializeaza(CConstante.DataNula, ComboBoxOra.EnumPas.JumatateDeOra); this.txtComandaPacientNume.Goleste(); this.txtComandaPacientPrenume.Goleste(); this.txtVarsta.Goleste(); this.txtObservatiiComanda.Goleste(); this.txtCodComanda.Goleste(); ////lore 03.09.2019 if (this.lLucrareSelectata.ValoareEUR != 0) { if (this.lpretnegociat == null) { this.lblPretUnitarInitial.Text = this.lLucrareSelectata.ValoareEUR.ToString(); this.txtpretunitarfin.ValoareDouble = this.lLucrareSelectata.ValoareEUR; } else { this.lblPretUnitarInitial.Text = this.lpretnegociat.ValoareEUR.ToString(); this.txtpretunitarfin.ValoareDouble = this.lpretnegociat.ValoareEUR; } this.lblmoneda.Text = "EUR"; this.lblValoareFinala.Text = string.Concat("TOTAL:", " ", this.txtpretunitarfin.ValoareDouble * this.txtNrElemente.ValoareDouble, " ", this.lblmoneda.Text); } else { if (this.lpretnegociat == null) { this.lblPretUnitarInitial.Text = this.lLucrareSelectata.ValoareRON.ToString(); this.txtpretunitarfin.ValoareDouble = this.lLucrareSelectata.ValoareRON; } else { this.lblPretUnitarInitial.Text = (this.lpretnegociat.ValoareRON).ToString(); this.txtpretunitarfin.ValoareDouble = this.lpretnegociat.ValoareRON; } this.lblmoneda.Text = "RON"; this.lblValoareFinala.Text = string.Concat("TOTAL:", " ", this.txtpretunitarfin.ValoareDouble * this.txtNrElemente.ValoareDouble, " ", this.lblmoneda.Text); } } else { this.lLucrareSelectata = BListaPreturiStandard.getById(this.lComanda.IdLucrare, null); if (this.lComanda.IdTehnician > 0) { this.lgfTehnician.ObiectCorespunzator = BUtilizator.GetById(this.lComanda.IdTehnician, null); } else { this.lgfTehnician.Goleste(); } this.lgfClinica.Text = this.lClient.Denumire; this.lgfLucrare.Text = this.lLucrareSelectata.Denumire; this.cboComandaReprezentant.SelectedValue = lComanda.IdReprezentantClient; this.cboCabinet.SelectedValue = lComanda.IdCabinet; this.txtComandaPacientNume.Text = lComanda.NumePacient; this.txtComandaPacientPrenume.Text = lComanda.PrenumePacient; this.txtVarsta.ValoareIntreaga = lComanda.Varsta; this.rbFeminin.Checked = this.lComanda.SexPacient == 1; this.rbMasculin.Checked = this.lComanda.SexPacient == 2; this.ctrlComandaDataPrimire.DataAfisata = lComanda.DataPrimire; this.ctrlComandaDataLaGata.Initializeaza(lComanda.DataLaGata, ComboBoxOra.EnumPas.JumatateDeOra); this.txtObservatiiComanda.Text = lComanda.Observatii; this.txtObservatiiEtapaCurenta.Text = lComanda.ObservatiiEtapa; this.chkUrgent.Checked = lComanda.Urgent; this.txtNrElemente.Text = lComanda.NrElemente.ToString(); this.ctrlDataOraTermen.Initializeaza(this.lComanda.DataSfarsitEtapa, ComboBoxOra.EnumPas.JumatateDeOra); this.chkRefacere.Checked = this.lComanda.Refacere; this.txtCuloare.Text = this.lComanda.Culoare; this.chkAcceptata.Checked = this.lComanda.Acceptata; this.txtCodComanda.Text = this.lComanda.CodLucrare; ////lore 05.09.2019 this.lblPretUnitarInitial.Text = pComanda.PretUnitarInitial.ToString(); this.txtpretunitarfin.ValoareDouble = pComanda.PretUnitarFinal; ////lore 03.09.2019 if (this.lLucrareSelectata.ValoareEUR != 0) { this.lblmoneda.Text = "EUR"; this.lblValoareFinala.Text = string.Concat("TOTAL:", " ", this.txtpretunitarfin.ValoareDouble * this.txtNrElemente.ValoareDouble, " ", this.lblmoneda.Text); } else { this.lblmoneda.Text = "RON"; this.lblValoareFinala.Text = string.Concat("TOTAL:", " ", this.txtpretunitarfin.ValoareDouble * this.txtNrElemente.ValoareDouble, " ", this.lblmoneda.Text); } } initListe(); if (this.lComanda != null && !this.lComanda.EsteActiv) { AllowModification(false); } else { AllowModification(true); } finalizeazaIncarcarea(); }