Esempio n. 1
0
        /// <summary>
        /// Seta os grupo de skin disponiveis do DevExpress
        /// Achamada deste metodo deve ser obrigatóriamente antes da inicialização de qualquer form
        /// </summary>
        private void setTheme()
        {
            // The following line provides localization for the application's user interface.
            Thread.CurrentThread.CurrentUICulture =
                new CultureInfo("pt-BR");

            // The following line provides localization for data formats.
            Thread.CurrentThread.CurrentCulture =
                new CultureInfo("pt-BR");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.Skins.SkinManager.EnableMdiFormSkins();
            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();
            //use o tema DEFAULT do VS
            string skin        = "Office 2010 Blue";
            var    preferences = FileManagerIts.GetDataFile(PREFERENCIAS);

            if (File.Exists(PREFERENCIAS) && preferences.Count > 0)
            {
                skin = preferences.FirstOrDefault();
            }
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = skin;
        }
Esempio n. 2
0
        private void barBtnOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog();

            if (open.ShowDialog() == DialogResult.OK)
            {
                var data = FileManagerIts.GetDataFile(open.FileName);

                var sb = new StringBuilder();
                foreach (var item in data)
                {
                    sb.AppendLine(item);
                }
                scintillaOriginal.Text = FileManagerIts.GetDataStringFile(open.FileName);
            }
        }
Esempio n. 3
0
        private static void generateScriptToSkin()
        {
            //todos os arquivo sem extensao
            var skins = FileManagerIts.ToFiles(@"D:\Program Files\TFS\ITSolution\ITSolution.Framework\Resources", new string[] { "" });
            //lista de temas do dev express
            var lista = new List <string>();

            foreach (var f in skins)
            {
                var skinsData = FileManagerIts.GetDataFile(f);
                Console.WriteLine(f);
                Console.WriteLine("=======================================================================================================");
                foreach (var skin in skinsData)
                {
                    Console.WriteLine("'" + skin + "',");//concatenar usando o excel posteriomente eh mais rapido
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Recupera o nome de usuário no arquivo de preferências
        /// </summary>
        /// <param name="logon"></param>
        /// <returns></returns>
        private string retryLogon(string logon)
        {
            if (logon == null)
            {
                List <string> preferencias = FileManagerIts.GetDataFile(UnitWork.PREFERENCIAS);
                if (preferencias.Count > 3)
                {
                    try
                    {
                        //recupera do arquivo o logon
                        return(ASCIIEncodingIts.Decoded(preferencias[3]));
                    }
                    catch (Exception ex)
                    {
                        LoggerUtilIts.ShowExceptionLogs(ex);

                        FileManagerIts.DeleteFile(UnitWork.PREFERENCIAS);
                        return(null);
                    }
                }
            }
            return(logon);
        }
Esempio n. 5
0
        private void barBtnSelecionaArquivo_ItemClick(object sender, ItemClickEventArgs e)
        {
            var op = openFileDialog1.ShowDialog();

            if (op == DialogResult.OK)
            {
                this.util.PathFile = this.openFileDialog1.FileName;
                this.util.Texto    = null;
                try {
                    var dados = FileManagerIts.GetDataFile(util.PathFile);
                    txtImpressao.Text = "";
                    dados.ForEach(delegate(String line)
                    {
                        txtImpressao.Text = txtImpressao.Text + "\n" + line;
                    });
                }
                catch (IOException ex)
                {
                    string msg = string.Format("Falha ao abrir o arquivo {0}", util.PathFile);

                    XMessageIts.ExceptionMessageDetails(ex, msg);
                }
            }
        }
Esempio n. 6
0
        //carraga as preferencias do arquivo de preferencias

        public void SetPreferences(BalcaoContext ctx = null)
        {
            if (ctx == null)
            {
                ctx = new BalcaoContext();
            }

            using (ctx)
            {
                try
                {
                    var dataPreferences = FileManagerIts.GetDataFile(UnitWork.PREFERENCIAS);

                    //sempre passa aqui
                    if (dataPreferences.Count >= 2)
                    {
                        this.IsInvoke = false;

                        string codMatriz = ASCIIEncodingIts.Decoded(dataPreferences[0]);
                        string codFilial = ASCIIEncodingIts.Decoded(dataPreferences[1]);

                        this.lookUpMatrizFilial1.FindSetMatriz(codMatriz);

                        this.lookUpMatrizFilial1.FindSetFilial(codFilial);

                        UnitWork.Filial = this.Filial;

                        //se salvou eh true;
                        this.chBoxMemorizarFilial.Checked = true;


                        if (!this.lookUpMatrizFilial1.IsMatrizFilial)
                        {
                            this.IsInvoke = true;
                            return;
                        }

                        //tenha certeza q os argumentos setados existem
                        if (dataPreferences.Count == 4 && UnitWork.Filial != null)
                        {
                            try
                            {
                                //se o tem o index 3 entao eh true
                                this.chBoxLoginAuto.Checked = true;
                                //nao chame essa tela
                                this.IsInvoke = false;

                                int idUser = ParseUtil.ToInt(ASCIIEncodingIts.Decoded(dataPreferences[3]));

                                UnitWork.Usuario = ctx.UsuarioDao.Find(idUser);
                            }
                            catch
                            {
                                UnitWork.Usuario = null;
                            }


                            //se estou selecionando e o flag verdade
                            //passe direto
                            //se o flag nao for selecionar abri o form para alterar os argumentos
                            //que ja existem setados
                            if (_action == FormTypeAction.Selecionar && this.chBoxLoginAuto.Checked)
                            {
                                btnOk_ItemClick(null, null);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    LoggerUtilIts.ShowExceptionLogs(ex);
                    DeletePreferences();
                }

                var param = ParametroManager.FindParamByTypeParametro(TypeParametro.dir_digitalizacoes);
                PrinterUtilIts.DirDefault = param.ValorParametro;
            }
        }