Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string sql     = "select distinct usercode from m_user ";
            sqlCON connect = new sqlCON();

            connect.getComboBoxData(sql, ref cmb_user);
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                Version deploy = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion;

                StringBuilder version = new StringBuilder();
                //version.Append("VERSION:   ");
                version.Append("TechLink Version: ");
                version.Append(deploy.Major);
                version.Append("_");
                version.Append(deploy.Minor);
                version.Append("_");
                version.Append(deploy.Build);
                version.Append("_");
                version.Append(deploy.Revision);

                Version_lbl.Text = version.ToString();
                Class.valiballecommon.GetStorage()._version = Version_lbl.Text;
            }
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string sql     = "select distinct usercode from m_user ";
            sqlCON connect = new sqlCON();

            connect.getComboBoxData(sql, ref cmb_user);
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                Version deploy = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion;

                StringBuilder version = new StringBuilder();
                //version.Append("VERSION:   ");
                version.Append("TechLink Version: ");
                version.Append(deploy.Major);
                version.Append("_");
                version.Append(deploy.Minor);
                version.Append("_");
                version.Append(deploy.Build);
                version.Append("_");
                version.Append(deploy.Revision);

                Version_lbl.Text = version.ToString();
                Class.valiballecommon.GetStorage()._version = Version_lbl.Text;
            }

            cb_Language.Items.Add("English");
            cb_Language.Items.Add("TiengViet");
            cb_Language.Items.Add("Chinese");

            cb_Database.Items.Add("TECHLINK");
            cb_Database.Items.Add("TLVN2");
            cb_Database.Items.Add("TEST03152021");
            Class.valiballecommon SettingGet = new Class.valiballecommon();
            if (File.Exists(PathSaveConfig))
            {
                SettingGet = (Class.valiballecommon)SaveObject.Load_data(PathSaveConfig);
                if (SettingGet.Language == null)
                {
                    cb_Language.SelectedItem = "English";
                }
                if (SettingGet.DBERP == null)
                {
                    cb_Database.SelectedItem = "TLVN2";
                }
                Class.valiballecommon.GetStorage().Warehouse  = SettingGet.Warehouse;
                Class.valiballecommon.GetStorage().Department = SettingGet.Department;
                Class.valiballecommon.GetStorage().Currency   = SettingGet.Currency;
                Class.valiballecommon.GetStorage().Client     = SettingGet.Client;
                //tuanngoc
                Class.valiballecommon.GetStorage().DocNo = SettingGet.DocNo;
            }
            else
            {
                cb_Language.SelectedItem = "English";
                cb_Database.SelectedItem = "TLVN2";
            }
            if (SettingGet.DBERP != null)
            {
                cb_Database.SelectedItem = SettingGet.DBERP;
            }
            if (SettingGet.UserCode != null)
            {
                cmb_user.SelectedItem = SettingGet.UserCode;
            }
            if (SettingGet.Language != null)
            {
                cb_Language.SelectedItem = SettingGet.Language;
            }
        }