예제 #1
0
        private void logIn(string userName, string pwd)
        {
            if (userName != "")
            {
                this.Enabled  = false;
                btnCancel.Tag = "login";
                for (int i = 0; i < clsUsers.RowCount; i++)
                {
                    if (cancelLogIn == false)
                    {
                        if (clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString().ToUpper() == userName)
                        {
                            if (pwd == clsUsers.DSet.Tables[0].Rows[i]["Password"].ToString().ToUpper())
                            {
                                CCFBGlobal.currentUser_Name            = clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString();
                                CCFBGlobal.currentUser_PermissionLevel =
                                    getPermissionsInt(clsUsers.DSet.Tables[0].Rows[i].Field <string>("UserRole"));
                                CCFBGlobal.pcName     = System.Windows.Forms.SystemInformation.ComputerName;
                                CCFBGlobal.dbUserName = CCFBGlobal.currentUser_Name + "/" + CCFBGlobal.pcName;
                                saveToRegistry();
                                writeToDSNValues();
                                //CCFBPrefs.Init();
                                CCFBGlobal.LoadTypes();

                                CCFBGlobal.getRegTemplatePath();
                                this.Visible       = false;
                                this.Enabled       = true;
                                this.ShowInTaskbar = false;
                                //#if FASTTRACK
                                SelectDonor formMain = new SelectDonor(this);
                                //#endif
#if CCFB
                                // CCFBPrefs.Init();
                                // formMain = new MainForm(this);
#endif

                                formMain.ShowDialog();
                                resetForm();
                                break;
                            }
                            else
                            {
                                MessageBox.Show("The Password Does Not Match For This User");
                                tbPassword.Text = "";
                                this.Enabled    = true;
                                tbPassword.Focus();
                                Application.DoEvents();
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Please Select A User");
            }
            btnCancel.Tag = "";
        }
예제 #2
0
        private void logIn(string userName, string pwd)
        {
            if (userName != "")
            {
                this.Enabled = false;
                btnCancel.Tag = "login";
                for (int i = 0; i < clsUsers.RowCount; i++)
                {
                    if (cancelLogIn == false)
                    {
                        if (clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString().ToUpper() == userName)
                        {
                            if (pwd == clsUsers.DSet.Tables[0].Rows[i]["Password"].ToString().ToUpper())
                            {
                                CCFBGlobal.currentUser_Name = clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString();
                                CCFBGlobal.currentUser_PermissionLevel =
                                    getPermissionsInt(clsUsers.DSet.Tables[0].Rows[i].Field<string>("UserRole"));
                                CCFBGlobal.pcName = System.Windows.Forms.SystemInformation.ComputerName;
                                CCFBGlobal.dbUserName = CCFBGlobal.currentUser_Name + "/" + CCFBGlobal.pcName;
                                saveToRegistry();
                                writeToDSNValues();
                                //CCFBPrefs.Init();
                                CCFBGlobal.LoadTypes();

                                CCFBGlobal.getRegTemplatePath();
                                this.Visible = false;
                                this.Enabled = true;
                                this.ShowInTaskbar = false;
                                //#if FASTTRACK
                                SelectDonor formMain = new SelectDonor(this);
                                //#endif
#if CCFB
                                // CCFBPrefs.Init();
                                // formMain = new MainForm(this);
#endif

                                formMain.ShowDialog();
                                resetForm();
                                break;
                            }
                            else
                            {
                                MessageBox.Show("The Password Does Not Match For This User");
                                tbPassword.Text = "";
                                this.Enabled = true;
                                tbPassword.Focus();
                                Application.DoEvents();
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Please Select A User");
            }
            btnCancel.Tag = "";
        }