示例#1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            _log.Info("Start CashRegPrime prgoram...");
            clsLoginDialog f = new clsLoginDialog();
            DialogResult   i = f.ShowDialog();

            if (i == DialogResult.OK)
            {
                //Check user rights
                if (objGlobal.DefaultSManID != "")
                {
                    // If user has default SmanId
                    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(objGlobal.CultureInfo);

                    objUtil.Localization.TranslateForm(this);
                    loadProfileData();
                    this.Text    = objGlobal.DMSFirstUserName + "@" + objAppConfig.getSiteNameOnScreen();
                    this.Visible = true;
                    this.ContextMenuStrip.Items[this.ContextMenuStrip.Items.IndexOfKey("scheduleTaskToolStripMenuItem")].Visible = false;
                    _log.Info("CultureInfo = " + objGlobal.CultureInfo + ", ClientName = " + new clsCashBox().getClientPCName());
                }
                else
                {
                    MessageBox.Show("ERROR: User " + objGlobal.DMSFirstUserName + " must be assigned to a default SmanId !");
                    Application.Exit();
                }
            }
            else
            {
                Application.Exit();
            }
        }
示例#2
0
        private void SCMain_Load(object sender, EventArgs e)
        {
            ContractOid = -1;
            _log.Info("Start Service Contract Prime...Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            clsLoginDialog f = new clsLoginDialog();
            DialogResult   i = f.ShowDialog();

            if (i == DialogResult.OK)
            {
                //Check user rights
                // If user has been autenticated
                System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(objGlobal.CultureInfo);

                //objUtil.Localization.TranslateForm(this);
                loadProfileData();

                this.Text = objGlobal.DMSFirstUserName + "@" + objAppConfig.getSiteNameOnScreen();//+ this.Text;
                _log.Info("Version = " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + ", Title = " + this.Text);

                this.Visible     = true;
                this.WindowState = FormWindowState.Maximized;

                //testing

                /*
                 * SCBase objBase = new SCBase();
                 * List<SCContractType> aList = objBase.getContractTypes();
                 * MessageBox.Show(aList.Count.ToString());
                 * //objBase.saveContractTypes(aList);
                 * List<SCOptionCategory> objOptionCats = SCOptionCategory.getContractOptionCategoryPriceList(2);
                 * MessageBox.Show(objOptionCats.Count.ToString());
                 */
                resizeHeight();
                //ThuyetLV
                initData();
            }
            else
            {
                Application.Exit();
            }
        }