Exemple #1
0
        private void CheckPassword(String userid)
        {
            DateTime date = new DateTime();
            DateTime today = DateTime.Today;
            String value = "";
            object[] param = new object[3];
            param[0] = userid;

            object[] myRet = CliUtils.CallMethod("GLModule", "GetPasswordLastDate", param);
            if (myRet != null && myRet[0].ToString() == "0")
            {
                if (myRet[1] == DBNull.Value || myRet[1].ToString() == "")
                    value = "new";
                else
                {
                    date = DateTime.ParseExact(myRet[1].ToString(), "yyyyMMdd", null);
                    TimeSpan ts = today - date;
                    value = ts.TotalDays.ToString();
                }
            }

            if (value == "new")
            {
                SYS_LANGUAGE language = CliUtils.fClientLang;
                string message = SysMsg.GetSystemMessage(CliUtils.fClientLang, "EEPNetClient", "FrmClientMain", "NewPassword");
                MessageBox.Show(message);

                CliUtils.CallMethod("GLModule", "LogOut", new object[] { (object)(CliUtils.fLoginUser) });
                frmUserPWD fupwd = new frmUserPWD();
                fupwd.ShowDialog();
                if (!fupwd.upwdControl1.isOK)
                    Environment.Exit(0);
                else
                {
                    string sParam = CliUtils.fLoginUser + ':' + CliUtils.fLoginPassword + ':' + CliUtils.fLoginDB + ':' + "0";
                    CliUtils.CallMethod("GLModule", "CheckUser", new object[] { (object)sParam });
                }
            }
            else
            {
                if (Convert.ToInt32(value) > CliUtils.fPassWordExpiry)
                {
                    SYS_LANGUAGE language = CliUtils.fClientLang;
                    string message = SysMsg.GetSystemMessage(CliUtils.fClientLang, "EEPNetClient", "FrmClientMain", "PasswordAnnulment");
                    MessageBox.Show(message);
                    CliUtils.CallMethod("GLModule", "LogOut", new object[] { (object)(CliUtils.fLoginUser) });
                    frmUserPWD fupwd = new frmUserPWD();
                    fupwd.ShowDialog();
                    if (!fupwd.upwdControl1.isOK)
                        Environment.Exit(0);
                }
                else if ((CliUtils.fPassWordExpiry - Convert.ToInt32(value)) <= CliUtils.fPassWordNotify)
                {
                    SYS_LANGUAGE language = CliUtils.fClientLang;
                    string message = SysMsg.GetSystemMessage(CliUtils.fClientLang, "EEPNetClient", "FrmClientMain", "PasswordNotify");
                    MessageBox.Show(String.Format(message, CliUtils.fPassWordExpiry - Convert.ToInt32(value)));
                }
            }
        }
Exemple #2
0
 private void menuItemCP_Click(object sender, EventArgs e)
 {
     frmUserPWD fupwd = new frmUserPWD();
     fupwd.ShowDialog();
 }