コード例 #1
0
        private void LoadChamps()
        {
            string connString = ConfigSettings.ReadSetting("connString");

            if (connString != null)
            {
                foreach (string s in connString.Split(";".ToCharArray()))
                {
                    switch ((s.Split("=".ToCharArray()))[0])
                    {
                    case "Server":
                        textBoxServer.Text = (s.Split("=".ToCharArray()))[1];
                        break;

                    case "Port":
                        textBoxPort.Text = (s.Split("=".ToCharArray()))[1];
                        break;

                    case "User Id":
                        textBoxDBUser.Text = (s.Split("=".ToCharArray()))[1];
                        break;

                    case "Password":
                        textBoxDBUserPass.Text = (s.Split("=".ToCharArray()))[1];
                        break;

                    case "DataBase":
                        textBoxDB.Text = (s.Split("=".ToCharArray()))[1];
                        break;
                    }
                }
            }
        }
コード例 #2
0
ファイル: frmChargement.cs プロジェクト: gbaligh/gpressing
        private void frmChargement_Load(object sender, EventArgs e)
        {
            string connString     = ConfigSettings.ReadSetting("connString");
            string PrefixFacture  = ConfigSettings.ReadSetting("prefixFacutre");
            string PremierFacture = ConfigSettings.ReadSetting("firstFacutre");
            string PrefixClient   = ConfigSettings.ReadSetting("prefixClient");
            string Printer        = ConfigSettings.ReadSetting("Printer");
            string Page           = ConfigSettings.ReadSetting("Page");
            string NbTicket       = ConfigSettings.ReadSetting("NbTicket");
            string maxPressing    = ConfigSettings.ReadSetting("MaxPressing");
            string maxRepassage   = ConfigSettings.ReadSetting("MaxRepassage");
            string maxTenture     = ConfigSettings.ReadSetting("MaxTenture");
            string maxAutre       = ConfigSettings.ReadSetting("MaxAutre");

            GlobalVars.maxAutre          = maxAutre != null ? maxAutre : "#";
            GlobalVars.maxPressing       = maxPressing != null ? maxPressing : "#";
            GlobalVars.maxRepassage      = maxRepassage != null ? maxRepassage : "#";
            GlobalVars.maxTenture        = maxTenture != null ? maxTenture : "#";
            GlobalVars.connString        = connString != null ? connString : string.Empty;
            GlobalVars.PrefixFacture     = PrefixFacture != null ? PrefixFacture : "F";
            GlobalVars.PremierFacture    = PremierFacture != null ? PremierFacture : "0";
            GlobalVars.PrefixClient      = PrefixClient != null ? PrefixClient : "C";
            GlobalVars.namePrinter       = Printer != null ? Printer : string.Empty;
            GlobalVars.page              = Page != null ? Page : string.Empty;
            GlobalVars.nombreCopieTicket = NbTicket != null ? NbTicket : string.Empty;
        }