/// <summary> /// 检查用户名是否存在 /// </summary> /// <param name="userName"></param> /// <returns></returns> public bool IsExist(string userName) { AdminEntity entity = new AdminEntity(); entity.Include(a => new { a.ID, a.UserCode, a.UserName, a.PassWord, a.Email, a.Phone, a.Mobile, a.RealName, a.RoleNum, a.DepartNum }); entity.Where(a => a.UserName == userName).And(a => a.IsDelete == (int)EIsDelete.NotDelete); entity = this.Admin.GetSingle(entity); if (entity.IsNotNull()) { return(true); } return(false); }
public ActionResult ChangePwd(string currentPassword, string passWord) { AdminProvider provider = new AdminProvider(); AdminEntity entity = provider.Login(this.LoginUser.UserName, currentPassword); int line = 0; if (entity.IsNotNull()) { entity.PassWord = passWord; line = provider.UpdatePwd(entity); } if (line > 0) { this.ReturnJson.AddProperty("d", "success"); } else { this.ReturnJson.AddProperty("d", ""); } return(Content(this.ReturnJson.ToString())); }
/// <summary> /// 查询产品类别分页 /// </summary> /// <param name="entity"></param> /// <param name="pageInfo"></param> /// <returns></returns> public List <ProductCategoryEntity> GetList(ProductCategoryEntity entity, ref PageInfo pageInfo) { entity.IncludeAll(); entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete); entity.OrderBy(a => a.ID, EOrderBy.DESC); int rowCount = 0; List <ProductCategoryEntity> list = this.ProductCategory.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount); pageInfo.RowCount = rowCount; if (!list.IsNullOrEmpty()) { AdminProvider adminProvider = new AdminProvider(); foreach (ProductCategoryEntity item in list) { if (!item.CreateUser.IsEmpty()) { AdminEntity admin = adminProvider.GetAdmin(item.CreateUser); item.CreateUser = admin.IsNotNull() ? admin.UserName : item.CreateUser; } } } return(list); }