コード例 #1
0
ファイル: fmSetup.cs プロジェクト: balance-as/AkudimSale
        private void fmSetup_Load(object sender, EventArgs e)
        {
            if (Globals.theLanguageCode != "")
            {
                ChangeLanguage(Globals.theLanguageCode);
            }

            BalanceWarehouse Warehouse = new BalanceWarehouse();

            Warehouse.UseDefaultCredentials = true;

            string Sqlserver       = "";
            string SqlInstance     = "";
            string SqlDatabaseUser = "";
            string Company         = "";
            string WebUrl          = "";
            string Language        = "";
            string Printer         = "";

            try
            {
                Warehouse.WsReturnServerInfo(ref Sqlserver, ref SqlInstance, ref SqlDatabaseUser, ref Company, ref Language, ref WebUrl);
                tbSqlServer.Text    = Sqlserver;
                tbInstance.Text     = SqlInstance;
                tbDatabaseUser.Text = SqlDatabaseUser;
                tbCompany.Text      = Company;
                tbLanguage.Text     = Language;
                tbWebUrl.Text       = WebUrl;
            }
            catch (Exception ex)
            {
                MessageBoxExample.MyMessageBox.ShowBox(ex.Message);
            }

            try
            {
                Warehouse.WSReturnPrinterInfo(Globals.theWinlogon, Globals.theLocation, ref Printer);
                lbPrinterName.Text = Printer;
            }
            catch (Exception ex)
            {
                MessageBoxExample.MyMessageBox.ShowBox(ex.Message);
            }

            Warehouse.Dispose();
            tbInputData.Focus();
            tbInputData.SelectAll();

            Assembly asm = Assembly.GetExecutingAssembly();
            FileInfo fi  = new FileInfo(asm.Location);

            lbBuildDateTime.Text = fi.LastWriteTime.ToString();
            lbLocation.Text      = Globals.theLocation;
        }
コード例 #2
0
        private void fmMain_Load(object sender, EventArgs e)
        {
            Globals.theWinlogon = WindowsIdentity.GetCurrent().Name.ToUpper();
            Globals.theUserID   = Globals.theWinlogon.Substring(Globals.theWinlogon.IndexOf('\\') + 1).ToUpper();
            EmployeeTool et = new EmployeeTool();

            et.GetEmployeeSettings(Globals.theWinlogon);
            if (Globals.theLanguageCode != "")
            {
                ChangeLanguage(Globals.theLanguageCode);
            }

            string Sqlserver       = "";
            string SqlInstance     = "";
            string SqlDatabaseUser = "";
            string Company         = "";
            string WebUrl          = "";
            string Language        = "";

            BalanceWarehouse Warehouse = new BalanceWarehouse();

            Warehouse.UseDefaultCredentials = true;

            try
            {
                Warehouse.WsReturnServerInfo(ref Sqlserver, ref SqlInstance, ref SqlDatabaseUser, ref Company, ref Language, ref WebUrl);
                lbCompanyName.Text = Company;
            }
            catch (Exception ex)
            {
                MessageBoxExample.MyMessageBox.ShowBox(ex.Message);
            }

            try
            {
                string ErrorSound   = "";
                string OkSound      = "";
                bool   Errormessage = false;
                Warehouse.WSReturnGeneralSetup(ref ErrorSound, ref OkSound, ref Errormessage);
                Globals.theOkSoundPath = OkSound;
                Globals.theErrorSound  = ErrorSound;
                Globals.theShowMessage = Errormessage;
            }
            catch (Exception ex)
            {
                MessageBoxExample.MyMessageBox.ShowBox(ex.Message);
            }
            Warehouse.Dispose();
        }