Exemplo n.º 1
0
        // private void SetDebugMenu()
        // {
        //pCIManagerToolStripMenuItem.Visible = false;
        //pCILogToolStripMenuItem.Visible = false;
        //pCNLogToolStripMenuItem.Visible = false;

        //mnuToolsDocRelease.Visible = false;
        //  }

        void fl_OnSuccessLogin(int userID, string sessionID)
        {
            RSLib.COAppSetting aps = new RSLib.COAppSetting();

            this.Show();
            aps.InitAppSettings();

            if (aps.WindowMax == true)
            {
                this.WindowState = FormWindowState.Maximized;
            }
            else
            {
                this.WindowState = FormWindowState.Normal;
                this.Height      = aps.WindowHt;
                this.Width       = aps.WindowWid;
                if (Screen.PrimaryScreen.Bounds.Width >= this.Width)
                {
                    this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
                }

                if (Screen.PrimaryScreen.Bounds.Height >= this.Height)
                {
                    this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
                }
            }

            tssStatus1.Text = "Ready";
            tssStatus2.Text = DateTime.Now.ToShortDateString();
            calcelClicked   = true;
            SetAccessForSecurityLevel();

            //  MessageBox.Show("fl_OnSuccessLogin working again"); //***********************************************11/24
        }
Exemplo n.º 2
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            CBUser user = new CBUser();

            RSLib.COAppSetting aps = new RSLib.COAppSetting();
            RSLib.COSecurity   sec = new RSLib.COSecurity();

            user.Load(txtUser.Text, txtPassword.Text);
            //SSS 20131105 Added to force focus on password field on startup
            txtPassword.Focus();

            if (user.ID > 0)
            {
                aps.InitAppSettings();
                aps.LastUser = user.Username;
                aps.SaveAppSettings();

                sec.UserID    = user.ID;
                sec.SessionID = System.Guid.NewGuid().ToString();
                sec.SaveAppSettings();

                if (OnSuccessLogin != null)
                {
                    OnSuccessLogin(user.ID, sec.SessionID);
                }

                // MessageBox.Show("Loading User");
                LoadScreenToObject();
                // MessageBox.Show(moLog.Name);

                Common.GlobalVar.GlobalValue = moLog.Save();

                UserName = txtUser.Text;

                //   MessageBox.Show(Common.GlobalVar.GlobalValue + "----" + UserName);


                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid User Name or Password", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtPassword.Text = "";
                txtPassword.Focus();
            }
        }
Exemplo n.º 3
0
        private void FLogin_Load(object sender, EventArgs e)
        {
            RSLib.COAppSetting aps = new RSLib.COAppSetting();

            aps.InitAppSettings();

            if (aps.LastUser.Length > 0)
            {
                txtUser.Text   = aps.LastUser;
                timer1.Enabled = true;
            }
            else
            {
                txtUser.Text     = "";
                txtPassword.Text = "";
            }
        }
Exemplo n.º 4
0
        private void FMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            // if (MessageBox.Show("Are you sure you wish to exit PCATS?", "Exit PCATS", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            // {
            RSLib.COAppSetting aps = new RSLib.COAppSetting();

            aps.InitAppSettings();

            if (this.WindowState == FormWindowState.Maximized)
            {
                aps.WindowMax = true;
            }
            else
            {
                aps.WindowMax = false;
                aps.WindowHt  = this.Height;
                aps.WindowWid = this.Width;
            }

            aps.SaveAppSettings();

            RSLib.COSecurity.Delete();
            //*****************************Added 6/16/15 *****************MZ
            if (calcelClicked == true)
            {
                moLog.Name = this.UserName;
                //   moLog.Save_LogOff(); //****************************************12/1 commented
            }    //tried 6/25/2015
            //*************************************************************

            //}
            //else;
            //{
            //   e.Cancel = true;
            //   this.Activate();
            //}

            //  CDbLog.UpdateFor_LogOff(msCurrentUserName);
            CDbLog.UpdateFor_LogOff_Global(Common.GlobalVar.GlobalValue);

            //  MessageBox.Show(msCurrentUserName + ".....logging off");
        }