Example #1
0
        /// <summary>
        /// 根据ID重置密码
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool RePwd(Array id)
        {
            foreach (var item in id)
            {
                int       ID     = Convert.ToInt32(item);
                AdminInfo entity = adminInfoDAL.LoadEntities(u => u.ID == ID).FirstOrDefault();

                if (entity != null)
                {
                    //修改密码,为默认值,并MD5加密
                    entity.PassWord = MD5Helper.EncryptString("123");
                    adminInfoDAL.EditFlag(entity);
                }
            }
            if (unitOfWork.SaveChanges() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }