Пример #1
0
        public UserProfile GetProfileByUserName(string username)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("username", username);
            return(processor.QueryOne <UserProfile>("select * from userprofile where username=@username COLLATE NOCASE", dic));
        }
Пример #2
0
 public Meanings GetMeaningByName(string meanName)
 {
     if (!string.IsNullOrEmpty(meanName))
     {
         Dictionary <string, object> dic = new Dictionary <string, object>();
         dic.Add("Desc", meanName);
         return(processor.QueryOne <Meanings>("select * from Meanings where desc=@Desc", dic));
     }
     else
     {
         return(null);
     }
 }
Пример #3
0
 public int GetReportEditorPKValue()
 {
     try
     {
         //object u = processor.QueryScalar("select Max(ID) from ReportEditor", null);
         ReportEditor r = processor.QueryOne <ReportEditor>("select * from ReportEditor where id=(select max(id) from ReportEditor)", () => null);
         //if (r != null)
         return(r.ID);
         //if (u != null && u.ToString() != string.Empty)
         //    return Convert.ToInt32(u);
         //else
         //    return 0;
     }
     catch { return(0); }
 }
Пример #4
0
        public LogConfig GetLogConfigBySNTN(string serialNum, string tripNum)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("sn", serialNum);
            dic.Add("tn", tripNum);
            return(processor.QueryOne <LogConfig>("select * from LogConfig where SN=@sn and TN=@tn", dic));
        }
Пример #5
0
        public PointInfo GetPointsListByTNSN(string serialNum, string tripNum)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("sn", serialNum);
            dic.Add("tn", tripNum);
            return(processor.QueryOne <PointInfo>("select * from pointinfo where SN=@sn and TN=@tn", dic));
        }
Пример #6
0
        public Device GetDeviceBySnTn(string sn, string tn)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("sn", sn);
            dic.Add("tn", tn);
            return(processor.QueryOne <Device>("select * from Device where SerialNum=@sn and TripNum=@tn", dic));
        }
Пример #7
0
        public void Init()
        {
            List <RoleInfo> role = processor.Query <RoleInfo>("SELECT * FROM RoleInfo", null);

            if (role == null || role.Count == 0)
            {
                role.Add(new RoleInfo()
                {
                    ID = 1, Rolename = "Admin", Remark = DateTime.Now.ToString()
                });
                role.Add(new RoleInfo()
                {
                    ID = 2, Rolename = "User", Remark = DateTime.Now.ToString()
                });
                processor.Insert <RoleInfo>(role);
            }
            this.cbxRole.DataSource    = role;
            this.cbxRole.DisplayMember = "Rolename";
            this.cbxRole.ValueMember   = "ID";
            userid = this.GetCurrentUserId();
            if (username != null && username != string.Empty)
            {
                user = processor.QueryOne <UserInfo>("SELECT * FROM USERINFO WHERE username=@username COLLATE NOCASE", delegate()
                {
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("username", username.Trim().ToLower());
                    return(dic);
                });
                this.tbUserName.Text    = user.UserName;
                this.tbFullName.Text    = user.FullName;
                this.tbPwd.Text         = user.Pwd;
                this.tbDescription.Text = user.Description;
                this.tbConfirm.Text     = user.Pwd;
                switch (user.RoleId)
                {
                case 1:
                    this.cbxRole.SelectedValue = 1;
                    break;

                case 2:
                    this.cbxRole.SelectedValue = 2;
                    break;

                default:
                    break;
                }
                // 如果为普通用户,则隐藏锁定、Diable、Group修改选项
                if (Common.User.RoleId != 1 || Common.User.Userid == user.Userid)
                {
                    this.cbxRole.Enabled = false;
                }
                Common.SetControlEnable(this.tbUserName, false);
            }
            else
            {
                Common.SetControlEnable(this.tbUserName, true);
            }
        }
Пример #8
0
        /// <summary>
        /// 根据用户名获得并封装当前对象
        /// </summary>
        /// <returns></returns>
        public UserInfo GetUserInfoByUsername(string username)
        {
            UserInfo result = null;

            result = processor.QueryOne <UserInfo>("SELECT * FROM UserInfo WHERE username=@username COLLATE NOCASE", delegate()
            {
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("@username", username.Trim());
                return(dic);
            });
            return(result);
        }
Пример #9
0
        /// <summary>
        /// summary product信息列表
        /// </summary>
        private void InitProduct()
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("PID", 10001);
            Device d = processor.QueryOne <Device>("select * from device where pid=@PID", dic);

            lProductName.Text = string.Format("Product Name: {0}", d.ProductName);
            lSerialNum.Text   = string.Format("Serial Number: {0}", d.SerialNum);
            lModel.Text       = string.Format("Model: {0}", d.Model);
            lTripNum.Text     = string.Format("Trip Number: {0}", d.TripNum);
            lDesc.Text        = string.Format("Description: {0}", d.DESCS);
            lBattery.Text     = string.Format("Battery: {0:#%}", d.Battery);
            lStatus.Text      = string.Format("Current Status: {0}", "Connected-Logging");
        }
Пример #10
0
 public void LoadReportConfiguration(object sender, EventArgs args)
 {
     rc = processor.QueryOne <ReportConfig>("SELECT * FROM ReportConfig", delegate() { return(null); });
     if (rc != null)
     {
         ID = rc.Id;
         this.tbReportTitle.Text  = rc.ReportTitle;
         this.tbAdress.Text       = rc.Adress;
         this.tbCompanyName.Text  = rc.CompanyName;
         this.tbEMail.Text        = rc.Email;
         this.tbFax.Text          = rc.Fax;
         this.tbWebSite.Text      = rc.WebSite;
         this.tbContactPhone.Text = rc.ContactPhone;
         if (rc.Logo != null && rc.Logo.Length > 0)
         {
             this.pbLogo.Image = Utils.ReadSource(rc.Logo);
         }
     }
 }
Пример #11
0
        private void InitEvent()
        {
            this.Load += new EventHandler(delegate(object sender, EventArgs args) { this.tbUserName.Focus(); });
            #region username
            this.tbUserName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    //判断用户名是否使用过
                    UserInfo user = processor.QueryOne <UserInfo>("select * from userinfo where username=@username", delegate()
                    {
                        Dictionary <string, object> dic = new Dictionary <string, object>();
                        dic.Add("username", tbUserName.Text);
                        return(dic);
                    });
                    if (user.Userid == 0)
                    {
                        lbAlarmUn.Text = "√";
                    }
                    else
                    {
                        this.lbAlarmUn.Text  = "x " + tbUserName.Text + " has been used";
                        this.tbUserName.Text = "";
                        //this.tbUserName.Focus();
                    }
                }
                else
                {
                    //this.tbUserName.Focus();
                    this.lbAlarmUn.Text = "x none content";
                }
            });
            #endregion
            #region fullname
            this.tbFullName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    this.lbAlarmFN.Text = "√";
                }
                else
                {
                    //this.tbFullName.Focus();
                    this.lbAlarmFN.Text = "x none content";
                }
            });
            #endregion
            #region desc
            this.tbDescription.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbDescription))
                {
                    this.lbAlarmDesc.Text = "√";
                }
                else
                {
                    //this.tbDescription.Focus();
                    this.lbAlarmDesc.Text = "x none content";
                }
            });
            #endregion
            #region pwd
            this.tbPwd.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbPwd))
                {
                    //判断密钥长度
                    if (Common.Policy == null)
                    {
                        this.lbAlarmPwd.Text = "√";
                    }
                    else
                    {
                        if (tbPwd.Text.TrimEnd().Length >= Common.Policy.MinPwdSize)
                        {
                            this.lbAlarmPwd.Text = "√";
                        }
                        else
                        {
                            this.lbAlarmPwd.Text = "x min pwd size is " + Common.Policy.MinPwdSize.ToString();
                            //this.tbPwd.Focus();
                        }
                    }
                }
                else if (!Common.TextBoxChecked(tbPwd))
                {
                    //this.tbPwd.Focus();
                    this.lbAlarmPwd.Text = "x none content";
                }

                if (Common.PasswordConfirmed(tbPwd, tbConfirm))
                {
                    this.lbAlarmConfirm.Text = "√";
                }
            });
            #endregion
            #region confirm
            this.tbConfirm.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbConfirm))
                {
                    if (Common.PasswordConfirmed(tbPwd, tbConfirm))
                    {
                        this.lbAlarmConfirm.Text = "√";
                    }
                    else
                    {
                        this.lbAlarmConfirm.Text = "x confirmed failure";
                    }
                }
                else
                {
                    //this.tbConfirm.Focus();
                    this.lbAlarmConfirm.Text = "x none content";
                }
            });
            #endregion
        }
Пример #12
0
        private void InitEvent()
        {
            this.Load += new EventHandler(delegate(object sender, EventArgs args) {
                this.tbUserName.Focus();
                if (FirstCreate)
                {
                    this.parentForm.FormTitleText = InputBoxTitle.WizardCreateAdmin;
                }
                this.rbUser.Enabled  = !FirstCreate;
                this.rbAdmin.Checked = FirstCreate;
                this.rbUser.Checked  = !FirstCreate;
            });
            #region username
            this.tbUserName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                ((TextBox)sender).Text = ((TextBox)sender).Text.Trim();
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    //判断用户名是否使用过
                    UserInfo user = processor.QueryOne <UserInfo>("select * from userinfo where username=@username COLLATE NOCASE", delegate()
                    {
                        Dictionary <string, object> dic = new Dictionary <string, object>();
                        dic.Add("username", tbUserName.Text.Trim().ToLower());
                        return(dic);
                    });
                    if (user.Userid == 0)
                    {
                        Common.ClearToolTip(this.wrongTip, this.pbUserNameTip);
                    }
                    else
                    {
                        Common.SetToolTip(this.wrongTip, this.pbUserNameTip, Messages.UserNameOccupied);
                    }
                }
                else
                {
                    Common.SetToolTip(this.wrongTip, this.pbUserNameTip, Messages.EmptyContentError);
                }
            });
            #endregion
            #region fullname
            this.tbFullName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    Common.ClearToolTip(this.wrongTip, this.pbFullNameTip);
                }
                else
                {
                    Common.SetToolTip(this.wrongTip, this.pbFullNameTip, Messages.EmptyContentError);
                }
            });
            #endregion
            #region desc
            this.tbDescription.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbDescription))
                {
                    Common.ClearToolTip(this.wrongTip, this.pbRoleTip);
                }
                else
                {
                    Common.SetToolTip(this.wrongTip, this.pbRoleTip, Messages.EmptyContentError);
                }
            });
            #endregion
            #region pwd
            this.tbPwd.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbPwd))
                {
                    //判断密钥长度
                    if (Common.Policy == null)
                    {
                        Common.ClearToolTip(this.wrongTip, this.pbPasswordTip);
                    }
                    else
                    {
                        if (tbPwd.Text.TrimEnd().Length >= Common.Policy.MinPwdSize)
                        {
                            Common.ClearToolTip(this.wrongTip, this.pbPasswordTip);
                        }
                        else
                        {
                            Common.SetToolTip(this.wrongTip, this.pbPasswordTip, string.Format(Messages.PasswordShortThanDefined, Common.Policy.MinPwdSize));
                        }
                    }
                }
                else
                {
                    Common.SetToolTip(this.wrongTip, this.pbPasswordTip, Messages.EmptyContentError);
                }
            });
            #endregion
            #region confirm
            this.tbConfirm.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbConfirm))
                {
                    if (Common.PasswordConfirmed(tbPwd, tbConfirm))
                    {
                        Common.ClearToolTip(this.wrongTip, this.pbConfirmPasswordTip);
                    }
                    else
                    {
                        Common.SetToolTip(this.wrongTip, this.pbConfirmPasswordTip, Messages.MismatchPassword);
                    }
                }
                else
                {
                    Common.SetToolTip(this.wrongTip, this.pbConfirmPasswordTip, Messages.EmptyContentError);
                }
            });
            #endregion

            this.initGroupRadioCheckEvent();
            //非法字符处理事件
            this.tbUserName.TextChanged += new EventHandler((sender, e) => {
                Utils.IsInputTextValid(this.tbUserName);
            });
            this.tbFullName.TextChanged += new EventHandler((sender, e) =>
            {
                Utils.IsInputTextValid(this.tbFullName);
            });
        }
Пример #13
0
        private void InitEvents()
        {
            this.btnOK.Click += new EventHandler(delegate(object sender, EventArgs args){
                if (Common.TextBoxChecked(this.tbUserName) /*&& Common.TextBoxChecked(this.tbFullName) &&
                                                            * Common.TextBoxChecked(this.tbDescription)*/&& Common.TextBoxChecked(this.tbPwd) &&
                    Common.TextBoxChecked(this.tbConfirm) && Common.PasswordConfirmed(tbPwd, tbConfirm))
                {
                    /*密钥长度*/
                    if (Common.Policy == null || Common.Policy.MinPwdSize > this.tbPwd.Text.Length)
                    {
                        return;
                    }
                    if (username == string.Empty)
                    {
                        user.Userid = ++userid;
                    }
                    user.Account            = this.tbUserName.Text.TrimEnd();
                    user.FullName           = this.tbFullName.Text.TrimEnd();
                    user.Description        = this.tbDescription.Text.TrimEnd();
                    user.LastPwdChangedTime = this.tbPwd.Text == user.Pwd ? user.LastPwdChangedTime : DateTime.Now;
                    user.Pwd       = this.tbPwd.Text.TrimEnd();
                    user.Locked    = this.cbLocked.Checked == true ? 1 : 0;
                    user.ChangePwd = this.cbChangePwd.Checked == true ? 1 : 0;
                    user.Remark    = DateTime.Now.ToString();
                    user.RoleId    = this.cbxRole.SelectedValue == null ? 1: Convert.ToInt32(this.cbxRole.SelectedValue);
                    if (processor.InsertOrUpdate <UserInfo>(user, null, username == string.Empty ? true : false))
                    {
                        MessageBox.Show("Saved Successfully");
                        form.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        MessageBox.Show("Saved Failure");
                        form.DialogResult = DialogResult.No;
                    }
                }
            });
            this.btnCancel.Click += new EventHandler(delegate(object sender, EventArgs args){
                form.Close();
            });
            this.tbUserName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    //判断用户名是否使用过
                    UserInfo user = processor.QueryOne <UserInfo>("select * from userinfo where username=@username", delegate() {
                        Dictionary <string, object> dic = new Dictionary <string, object>();
                        dic.Add("username", tbUserName.Text);
                        return(dic);
                    });
                    if (user.Userid == 0)
                    {
                        lbAlarmUn.Text = "√";
                    }
                    else
                    {
                        this.lbAlarmUn.Text = "x " + tbUserName.Text + " has been used";
                        this.tbUserName.Focus();
                    }
                }
                else
                {
                    this.tbUserName.Focus();
                    this.lbAlarmUn.Text = "x none content";
                }
            });
            this.tbFullName.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked((TextBox)sender))
                {
                    this.lbAlarmFN.Text = "√";
                }
                else
                {
                    //this.tbFullName.Focus();
                    this.lbAlarmFN.Text = "x none content";
                }
            });
            this.tbDescription.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbDescription))
                {
                    this.lbAlarmDesc.Text = "√";
                }
                else
                {
                    //this.tbDescription.Focus();
                    this.lbAlarmDesc.Text = "x none content";
                }
            });
            this.tbPwd.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbPwd))
                {
                    //判断密钥长度
                    if (Common.Policy == null)
                    {
                        this.lbAlarmPwd.Text = "√";
                    }
                    else
                    {
                        if (tbPwd.Text.TrimEnd().Length >= Common.Policy.MinPwdSize)
                        {
                            this.lbAlarmPwd.Text = "√";
                        }
                        else
                        {
                            this.lbAlarmPwd.Text = "x min pwd size is " + Common.Policy.MinPwdSize.ToString();
                            //this.tbPwd.Focus();
                        }
                    }
                }
                else if (!Common.TextBoxChecked(tbPwd))
                {
                    //this.tbPwd.Focus();
                    this.lbAlarmPwd.Text = "x none content";
                }

                if (Common.PasswordConfirmed(tbPwd, tbConfirm))
                {
                    this.lbAlarmConfirm.Text = "√";
                }
            });
            this.tbConfirm.Leave += new EventHandler(delegate(object sender, EventArgs args)
            {
                if (Common.TextBoxChecked(tbConfirm))
                {
                    if (Common.PasswordConfirmed(tbPwd, tbConfirm))
                    {
                        this.lbAlarmConfirm.Text = "√";
                    }
                    else
                    {
                        this.lbAlarmConfirm.Text = "x confirmed failure";
                    }
                }
                else
                {
                    //this.tbConfirm.Focus();
                    this.lbAlarmConfirm.Text = "x none content";
                }
            });
        }
Пример #14
0
 /// <summary>
 /// 判断是否登录成功,同时保存用户信息
 /// </summary>
 /// <returns></returns>
 public bool Login()
 {
     try
     {
         if (Common.TextBoxChecked(tbAccount) && Common.TextBoxChecked(tbPwd))
         {
             UserInfo user = processor.QueryOne <UserInfo>("SELECT * FROM UserInfo WHERE username=@username", delegate()
             {
                 Dictionary <string, object> dic = new Dictionary <string, object>();
                 dic.Add("username", tbAccount.Text.TrimEnd());
                 //dic.Add("pwd", tbPwd.Text.TrimEnd());
                 return(dic);
             });
             if (user.Locked == 0)
             {
                 if (LoginTimes <= Common.Policy.LockedTimes)
                 {
                     if (user.Userid != 0 && user.Pwd.Equals(this.tbPwd.Text))
                     {
                         Common.User = user;
                         LoginTimes  = 0;
                         this.SaveUserList();//保存列表
                         //记录成功的日志
                         logBll.InsertLog(() =>
                         {
                             Dictionary <string, object> dic = new Dictionary <string, object>();
                             dic.Add("OperateTime", DateTime.Now);
                             dic.Add("Action", "Log on");
                             dic.Add("UserName", user.UserName);
                             dic.Add("FullName", user.FullName);
                             dic.Add("Detail", "Success");
                             dic.Add("LogType", 0);
                             return(dic);
                         });
                         return(true);
                     }
                     else if (user.Userid == 0)
                     {
                         this.lbAccount.Text = "× user does not exist.";
                         //this.lbAccount.ForeColor = System.Drawing.Color.Red;
                         return(false);
                     }
                     else
                     {
                         this.lbPwd.Text = "× password invalid.";
                         //this.lbPwd.ForeColor = System.Drawing.Color.Red;
                         LoginTimes++;
                         //记录日志
                         logBll.InsertLog(() =>
                         {
                             Dictionary <string, object> dic = new Dictionary <string, object>();
                             dic.Add("OperateTime", DateTime.Now);
                             dic.Add("Action", "Log on");
                             dic.Add("UserName", user.UserName);
                             dic.Add("FullName", user.FullName);
                             dic.Add("Detail", "Failure");
                             dic.Add("LogType", 0);
                             return(dic);
                         });
                         return(false);
                     }
                 }
                 else
                 {
                     Dictionary <string, object> dic = new Dictionary <string, object>();
                     dic.Add("locked", 1);
                     dic.Add("username", this.tbAccount.Text.TrimEnd());
                     processor.ExecuteNonQuery("UPDATE userinfo set locked=@locked where username=@username", dic);
                     this.lbPwd.Text = "× over " + Common.Policy.LockedTimes.ToString() + " times";
                 }
             }
             else
             {
                 this.lbPwd.Text = "× account's locked.";
                 //记录账号锁定日志
                 logBll.InsertLog(() =>
                 {
                     Dictionary <string, object> dic = new Dictionary <string, object>();
                     dic.Add("OperateTime", DateTime.Now);
                     dic.Add("Action", "Log on");
                     dic.Add("UserName", user.UserName);
                     dic.Add("FullName", user.FullName);
                     dic.Add("Detail", "Failure");
                     dic.Add("LogType", 0);
                     return(dic);
                 });
             }
         }
         return(false);
     }
     catch (Exception exc) { return(false); }
 }
Пример #15
0
 /// <summary>
 /// 判断是否登录成功,同时保存用户信息
 /// </summary>
 /// <returns></returns>
 public bool Login()
 {
     try
     {
         if (Common.TextBoxChecked(tbAccount) && Common.TextBoxChecked(tbPwd))
         {
             UserInfo user = processor.QueryOne <UserInfo>("SELECT * FROM UserInfo WHERE username=@username COLLATE NOCASE", delegate()
             {
                 Dictionary <string, object> dic = new Dictionary <string, object>();
                 dic.Add("username", tbAccount.Text.Trim().ToLower());
                 //dic.Add("pwd", tbPwd.Text.TrimEnd());
                 return(dic);
             });
             if (user.Locked == 0)
             {
                 if (user.Userid != 0 && user.Pwd.Equals(this.tbPwd.Text) && user.Disabled == 0)
                 {
                     Common.User = user;
                     loginTimes[user.UserName] = 0;
                     this.SaveUserList();    //保存列表
                     //记录成功的日志
                     if (Common.User.UserName != Common.SUPERUSER)
                     {
                         logBll.InsertLog(() =>
                         {
                             Dictionary <string, object> dic = new Dictionary <string, object>();
                             dic.Add("OperateTime", DateTime.UtcNow);
                             dic.Add("Action", LogAction.Logon);
                             dic.Add("UserName", user.UserName);
                             dic.Add("FullName", user.FullName);
                             dic.Add("Detail", "Successful");
                             dic.Add("LogType", LogAction.SystemAuditTrail);
                             return(dic);
                         });
                     }
                     return(true);
                 }
                 else if (user.Userid == 0 || user.Disabled == 1)
                 {
                     //TODO:
                     if (tbAccount.Text == Common.SUPERUSER && tbPwd.Text == Common.SUPERUSERPWD)
                     {
                         UserInfo super = new UserInfo()
                         {
                             UserName           = Common.SUPERUSER,
                             Pwd                = Common.SUPERUSERPWD,
                             FullName           = "super admin",
                             LastPwdChangedTime = DateTime.UtcNow,
                             RoleId             = 1
                         };
                         Common.User = super;
                         return(true);
                     }
                     else
                     {
                         Utils.ShowMessageBox(Messages.WrongUserNameOrPassword, Messages.TitleError);
                         return(false);
                     }
                 }
                 else if (user.Pwd != this.tbPwd.Text)
                 {
                     if (!loginTimes.ContainsKey(user.UserName))
                     {
                         loginTimes[user.UserName] = 0;
                     }
                     loginTimes[user.UserName]++;
                     if (loginTimes[user.UserName] >= Common.Policy.LockedTimes && Common.Policy.LockedTimes > 0)
                     {
                         Dictionary <string, object> dic = new Dictionary <string, object>();
                         dic.Add("locked", 1);
                         dic.Add("username", this.tbAccount.Text.TrimEnd());
                         processor.ExecuteNonQuery("UPDATE userinfo set locked=@locked where username=@username COLLATE NOCASE", dic);
                         Utils.ShowMessageBox(Messages.WrongPasswordExcceedCertainTimes, Messages.TitleError);
                     }
                     else
                     {
                         Utils.ShowMessageBox(Messages.WrongUserNameOrPassword, Messages.TitleError);
                     }
                     //记录账号锁定日志
                     if (Common.User.UserName != Common.SUPERUSER)
                     {
                         logBll.InsertLog(() =>
                         {
                             Dictionary <string, object> dic = new Dictionary <string, object>();
                             dic.Add("OperateTime", DateTime.UtcNow);
                             dic.Add("Action", LogAction.Logon);
                             dic.Add("UserName", user.UserName);
                             dic.Add("FullName", user.FullName);
                             dic.Add("Detail", "Failed");
                             dic.Add("LogType", LogAction.SystemAuditTrail);
                             return(dic);
                         });
                     }
                     return(false);
                 }
                 else
                 {
                     return(false);
                 }
             }
             else
             {
                 Utils.ShowMessageBox(Messages.UserLocked, Messages.TitleError);
             }
         }
         else
         {
             Utils.ShowMessageBox(Messages.WrongUserNameOrPassword, Messages.TitleError);
         }
         return(false);
     }
     catch { return(false); }
 }