コード例 #1
0
        private void BtnImporta_Click(object sender, EventArgs e)
        {
            if (this.lSeIncarca)
            {
                return;
            }
            try
            {
                incepeIncarcarea();

                System.IO.FileInfo fisier = IHMUtile.GetFisierUnic(this.GetFormParinte());

                if (fisier != null)
                {
                    List <StructImportListaPreturi> listaInterv = new List <StructImportListaPreturi>();
                    using (StreamReader sr = new StreamReader(fisier.FullName))
                    {
                        string currentLine;
                        // currentLine will be null when the StreamReader reaches the end of file
                        while ((currentLine = sr.ReadLine()) != null)
                        {
                            // Search, case insensitive, if the currentLine contains the searched keyword
                            if (currentLine.IndexOf(",", StringComparison.CurrentCultureIgnoreCase) >= 0)
                            {
                                string[] dateLinie = currentLine.Split(new string[] { "," }, StringSplitOptions.None);

                                if (dateLinie.Length > 1)
                                {
                                    listaInterv.Add(new StructImportListaPreturi(dateLinie));
                                }
                            }
                        }
                    }

                    if (CUtil.EsteListaVida <StructImportListaPreturi>(listaInterv))
                    {
                        CCL.UI.Mesaj.Eroare(this.GetFormParinte(), "Eroare");
                    }
                    else
                    {
                        if (FormImportaListaPreturi.Afiseaza(this.GetFormParinte(), listaInterv))
                        {
                            ConstruiesteRanduriDGV();
                            this.panelOptiuni.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GestiuneErori.AfiseazaMesaj(this.GetFormParinte(), ex);
            }
            finally
            {
                finalizeazaIncarcarea();
            }
        }
コード例 #2
0
        private void BtnDocumentLocatie_Click(object sender, EventArgs e)
        {
            FileInfo imagine = IHMUtile.GetFisierUnic(this.GetFormParinte());

            if (imagine != null)
            {
                this.lLocatie.UpdateLogoSediu(imagine, null);
                initLogoSediu();
            }
        }
コード例 #3
0
        private void BtnDosarPozaPersonal_Click(object sender, EventArgs e)
        {
            FileInfo imagine = IHMUtile.GetFisierUnic(this.GetFormParinte());

            if (imagine != null)
            {
                this.lUtilizator.UpdateDosarPozaPersonal(imagine, null);
                initDosarPozaPersonal();
            }
        }
コード例 #4
0
        public static bool Afiseaza(Form pEcranPariente)
        {
            System.IO.FileInfo fisier = IHMUtile.GetFisierUnic(pEcranPariente);

            if (fisier != null)
            {
                List <StructImportPersonal> listaPersonal = new List <StructImportPersonal>();
                using (StreamReader sr = new StreamReader(fisier.FullName))
                {
                    string currentLine;
                    // currentLine will be null when the StreamReader reaches the end of file
                    while ((currentLine = sr.ReadLine()) != null)
                    {
                        // Search, case insensitive, if the currentLine contains the searched keyword
                        //if (currentLine.IndexOf(",", StringComparison.CurrentCultureIgnoreCase) >= 0)
                        //{
                        string[] dateLinie = currentLine.Split(new string[] { "," }, StringSplitOptions.None);

                        if (dateLinie.Length > 0)
                        {
                            listaPersonal.Add(new StructImportPersonal(dateLinie));
                        }
                        //}
                    }
                }

                if (CUtil.EsteListaVida <StructImportPersonal>(listaPersonal))
                {
                    CCL.UI.Mesaj.Eroare(pEcranPariente, "Lista vida");
                }
                else
                {
                    using (FormImportPersonal ecran = new FormImportPersonal(listaPersonal))
                    {
                        ecran.AplicaPreferinteleUtilizatorului();
                        return(CCL.UI.IHMUtile.DeschideEcran(pEcranPariente, ecran));
                    }
                }
            }

            return(false);
        }