private void DgvComenzi_EditareLinie(DataGridViewPersonalizat pDGVSender, int pIndexRand) { if (this.lSeIncarca) { return; } try { incepeIncarcarea(); BClientiComenzi comandaDeModificat = (pDGVSender as DataGridViewPersonalizat).Rows[pIndexRand].Tag as BClientiComenzi; if (comandaDeModificat != null) { FormListaLucrari._SLucrare = BListaPreturiStandard.getLucrareById(comandaDeModificat.IdLucrare, null); if (FormDetaliuComanda.Afiseaza(this.GetFormParinte(), comandaDeModificat, this.lClient)) { incarcaRand(this.dgvComenziInLucru.Rows[pIndexRand], comandaDeModificat); } } } catch (Exception ex) { GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex); } finally { finalizeazaIncarcarea(); } }
public void Initializeaza(BClientiComenzi pComanda, BClienti pClient) { base.InitializeazaVariabileleGenerale(); incepeIncarcarea(); this.lComanda = pComanda; this.lClient = pClient; initListe(); this.cboComandaReprezentant.Focus(); this.panelOptiuni.Visible = false; if (this.lComanda == null || this.lClient == null) { this.ctrlComandaDataPrimire.DataAfisata = DateTime.Now; this.lLucrareSelectata = FormListaLucrari._SLucrare; this.lblFindLucrare.Text = this.lLucrareSelectata.Denumire; this.ctrlComandaDataLaGata.DataAfisata = this.ctrlComandaDataPrimire.DataAfisata.AddDays(this.lLucrareSelectata.TermenMediuZile); this.txtComandaPacientNume.Goleste(); this.txtComandaPacientPrenume.Goleste(); this.ctrlPacientDataNasterii.Goleste(); this.chkComandaPacientFeminin.Checked = false; this.chkComandaPacientMasculin.Checked = false; this.txtComandaObservatii.Goleste(); } else { this.lLucrareSelectata = BListaPreturiStandard.getLucrareById(this.lComanda.IdLucrare, null); this.lblFindLucrare.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.ctrlPacientDataNasterii.DataAfisata = lComanda.DataNasterePacient; this.chkComandaPacientFeminin.Checked = getSexClient(true); this.chkComandaPacientMasculin.Checked = getSexClient(false); this.ctrlComandaDataPrimire.DataAfisata = lComanda.DataPrimire; this.ctrlComandaDataLaGata.DataAfisata = lComanda.DataLaGata; this.txtComandaObservatii.Text = lComanda.Observatii; } ConstruiesteColoaneDGV(); ConstruiesteRanduriDGV(); finalizeazaIncarcarea(); }
internal bool Salveaza() { bool esteValid = BListaPreturiStandard.SuntInformatiileNecesareCoerente(this.txtDenumireLucrare.Text); if (this.lPretLucrare == 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.lPretLucrare = BListaPreturiStandard.getLucrareById(id, null); } else { seteazaAlerta(); } } else { this.lPretLucrare.Denumire = this.txtDenumireLucrare.Text; this.lPretLucrare.DenumirePrescurtata = this.txtPrescurtareLucrare.Text; this.lPretLucrare.CodIntern = this.txtCodLucrare.Text; this.lPretLucrare.IdCategorie = getIdCategorie(); if (this.lPretLucrare.ValoareRON != 0) { this.lPretLucrare.ValoareRON = Double.Parse(this.txtValoareLucrare.Text); } else { this.lPretLucrare.ValoareEUR = Double.Parse(this.txtValoareLucrare.Text); } this.lPretLucrare.TermenMediuZile = CUtil.GetTextInt32(this.txtTermenMediuLucrare.Text); if (esteValid) { this.lPretLucrare.UpdateAll(); if (this.dgvListaEtapaAdaugate.RowCount > 0) { salveazaEtape(this.lPretLucrare.Id); } } else { seteazaAlerta(); } } return(esteValid); }
private bool SalveazaNull() { bool esteValid = BListaPreturiStandard.SuntInformatiileNecesareCoerente(this.txtDenumireLucrare.Text); if (this.lPretLucrare == 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.lPretLucrare = BListaPreturiStandard.getLucrareById(id, null); } else { seteazaAlerta(); } } else { return(true); } return(esteValid); }