コード例 #1
0
        internal bool Salveaza()
        {
            bool   esteValid          = BClientiComenzi.SuntInformatiileNecesareCoerente(this.lLucrareSelectata.Id);
            double pPretUnitarInitial = Convert.ToDouble(this.lblPretUnitarInitial.Text);
            double pPretUnitarFinal   = this.txtpretunitarfin.ValoareDouble;

            if (this.lComanda == null)
            {
                if (esteValid && suntCompleteInformatiile())
                {
                    this.lComanda = BClientiComenzi.Add(this.lClient.Id, CUtil.GetAsInt32(this.cboComandaReprezentant.SelectedValue), this.txtComandaPacientNume.Text, this.txtComandaPacientPrenume.Text, this.txtVarsta.ValoareIntreaga, getSexClient(), this.ctrlComandaDataPrimire.DataAfisata, this.ctrlComandaDataLaGata.DataAfisata, this.txtObservatiiComanda.Text, CUtil.GetAsInt32(this.cboCabinet.SelectedValue), this.lLucrareSelectata.Id, this.chkUrgent.Checked, pPretUnitarInitial, pPretUnitarFinal, CUtil.GetAsInt32(this.txtNrElemente.Text), getIdEtapaCurenta(), this.lgfTehnician.IdObiectCorespunzator, this.ctrlDataOraTermen.DataAfisata, this.chkRefacere.Checked, this.cboStare.SelectedIndex, this.txtCuloare.Text, this.txtObservatiiEtapaCurenta.Text, this.chkAcceptata.Checked, this.txtCodComanda.Text, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                this.lComanda.IdClient             = this.lClient.Id;
                this.lComanda.IdReprezentantClient = this.cboComandaReprezentant.GetSelectedValueAsInt32();
                this.lComanda.IdLucrare            = this.lLucrareSelectata.Id;
                this.lComanda.NumePacient          = this.txtComandaPacientNume.Text;
                this.lComanda.PrenumePacient       = this.txtComandaPacientPrenume.Text;
                this.lComanda.Varsta      = this.txtVarsta.ValoareIntreaga;
                this.lComanda.SexPacient  = getSexClient();
                this.lComanda.DataPrimire = this.ctrlComandaDataPrimire.DataAfisata;
                this.lComanda.DataLaGata  = this.ctrlComandaDataLaGata.DataAfisata;
                this.lComanda.IdCabinet   = this.cboCabinet.GetSelectedValueAsInt32();
                this.lComanda.Urgent      = this.chkUrgent.Checked;
                //lore 05.09.2019
                this.lComanda.ValoareInitiala   = (pPretUnitarInitial * Convert.ToDouble(this.txtNrElemente.Text));
                this.lComanda.ValoareFinala     = (pPretUnitarFinal * Convert.ToDouble(this.txtNrElemente.Text));
                this.lComanda.PretUnitarInitial = pPretUnitarInitial;
                this.lComanda.PretUnitarFinal   = pPretUnitarFinal;
                //////////////////////
                this.lComanda.NrElemente = CUtil.GetAsInt32(this.txtNrElemente.Text);
                this.lComanda.Culoare    = this.txtCuloare.Text;
                this.lComanda.Observatii = this.txtObservatiiComanda.Text;
                this.lComanda.Acceptata  = this.chkAcceptata.Checked;
                this.lComanda.CodLucrare = this.txtCodComanda.Text;
                //this.lComanda.IdTehnician = this.lgfTehnician.IdObiectCorespunzator;

                if (esteValid && suntCompleteInformatiile())
                {
                    this.lComanda.UpdateAll(getIdEtapaCurenta(), this.lgfTehnician.IdObiectCorespunzator, this.ctrlDataOraTermen.DataAfisata, this.txtObservatiiEtapaCurenta.Text, this.chkRefacere.Checked, this.cboStare.SelectedIndex, null);
                }
                else
                {
                    seteazaAlerta();
                }
            }

            return(esteValid && suntCompleteInformatiile() && verificaData());
        }
コード例 #2
0
        private void BtnAdaugaLucrareRapida_Click(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                //Adaugam lucrarea
                //Minim clinica si lucrarea trebuie sa fie selectate
                if (this.ctrlADCautareClinica.AreValoare() && this.ctrlADCautareLucrare.AreValoare())
                {
                    if (this.ctrlADCautareEtapa.AreValoare() || !this.ctrlADCautaTehnician.AreValoare())
                    {
                        Tuple <string, string> numePrenumePac = CUtil.GetNumePrenumeDinText(this.txtADPacient.Text);
                        BClientiComenzi.Add(this.ctrlADCautareClinica.GetIdClient(), this.ctrlADCautareMedicClinica.GetIdMedic(), numePrenumePac.Item1, numePrenumePac.Item2, 0, 0, this.ctrlADDataOraPrimire.DataAfisata, CConstante.DataNula, string.Empty, this.ctrlADCautareCabinetClinica.GetIdCabinet(), this.ctrlADCautareLucrare.GetIdLucrare(), false, 0, 0, this.txtADNrElemente.ValoareIntreaga, this.ctrlADCautareEtapa.GetIdEtapa(), this.ctrlADCautaTehnician.GetIdTehnician(), CConstante.DataNula, false, 0, this.txtADCuloare.Text, string.Empty, false, string.Empty, null);

                        this.ctrlADCautareLucrare.Goleste();
                        this.ctrlADDataOraPrimire.DataAfisata = DateTime.Now;

                        ConstruiesteRanduriDGV();

                        this.dgvListaComenzi.ScrollToBottom();
                    }
                    else
                    {
                        if (this.ctrlADCautaTehnician.AreValoare())
                        {
                            this.ctrlADCautareEtapa.DeschideLista();
                        }
                    }
                }
                else
                {
                    Mesaj.Eroare(this.GetFormParinte(), BMultiLingv.getElementById(BMultiLingv.EnumDictionar.SelectatiCelPutinClinicaSiLucrarea));
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
コード例 #3
0
        internal bool Salveaza()
        {
            bool esteValid = BClientiComenzi.SuntInformatiileNecesareCoerente(CUtil.GetAsInt32(this.cboComandaReprezentant.SelectedValue));

            if (this.lComanda == null)
            {
                if (esteValid)
                {
                    BClientiComenzi.Add(this.lClient.Id, CUtil.GetAsInt32(this.cboComandaReprezentant.SelectedValue), this.txtComandaPacientNume.Text, this.txtComandaPacientPrenume.Text, this.ctrlPacientDataNasterii.DataAfisata, getSexSelectat(), this.ctrlComandaDataPrimire.DataAfisata, this.ctrlComandaDataLaGata.DataAfisata, this.txtComandaObservatii.Text, CUtil.GetAsInt32(this.cboCabinet.SelectedValue), this.lLucrareSelectata.Id, null);
                    BColectieClientiComenzi lstComenzi = BClientiComenzi.GetListByParamIdClient(this.lClient.Id, CDefinitiiComune.EnumStare.Activa, null);
                    this.lComanda = lstComenzi[lstComenzi.Count - 1];
                }
                else
                {
                    seteazaAlerta();
                }
            }
            else
            {
                this.lComanda.IdReprezentantClient = CUtil.GetAsInt32(this.cboComandaReprezentant.SelectedValue);
                this.lComanda.NumePacient          = this.txtComandaPacientNume.Text;
                this.lComanda.PrenumePacient       = this.txtComandaPacientPrenume.Text;
                this.lComanda.DataNasterePacient   = this.ctrlPacientDataNasterii.DataAfisata;
                this.lComanda.SexPacient           = getSexSelectat();
                this.lComanda.DataPrimire          = this.ctrlComandaDataPrimire.DataAfisata;
                this.lComanda.DataLaGata           = this.ctrlComandaDataLaGata.DataAfisata;
                this.lComanda.Observatii           = this.txtComandaObservatii.Text;
                this.lComanda.IdCabinet            = CUtil.GetAsInt32(this.cboCabinet.SelectedValue);

                if (esteValid)
                {
                    this.lComanda.UpdateAll();
                }
                else
                {
                    seteazaAlerta();
                }
            }

            return(esteValid && SalveazaEtapele());
        }