public bool Delete(string Ids)
        {
            var id = Ids.Split(',');

            int[] output = Array.ConvertAll <string, int>(id, delegate(string s) { return(int.Parse(s)); });
            return(SqlSugarHelper.GetInstance().Deleteable <Permissions>().In(id).ExecuteCommand() > 0);
        }
Esempio n. 2
0
 /// <summary>
 /// 分页查询
 /// </summary>
 /// <returns></returns>
 public PageResult<Users> Query(PageResult<Users> model)
 {
     int totalCount = 0;
     model.Data= SqlSugarHelper.GetInstance().Queryable<Users>().ToPageList(model.pageIndex, model.pageSize, ref totalCount);
     model.totalCount = totalCount;
     return model;
 }
Esempio n. 3
0
 /// <summary>
 /// 编辑
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public bool Update(Users t)
 {
     return SqlSugarHelper.GetInstance().Updateable<Users>(t).ExecuteCommand() > 0;
 }
Esempio n. 4
0
 /// <summary>
 /// 根据ID获取数据
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public Users QueryById(int Id)
 {
     return SqlSugarHelper.GetInstance().Queryable<Users>().Where(m => m.Id.Equals(Id)).First() ?? null;
 }
Esempio n. 5
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="Name"></param>
 /// <param name="Pwd"></param>
 /// <returns></returns>
 public Users Login(string Name, string Pwd)
 {
     return SqlSugarHelper.GetInstance().Queryable<Users>().Where(m=>m.UserName.Equals(Name)&&m.Password.Equals(Pwd)).First()??null;
 }
Esempio n. 6
0
 /// <summary>
 /// 新增用户
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public bool Add(Users t)
 {
    return SqlSugarHelper.GetInstance().Insertable<Users>(t).ExecuteCommand()>0;
 }
 public bool Update(Permissions t)
 {
     return(SqlSugarHelper.GetInstance().Updateable <Permissions>(t).ExecuteCommand() > 0);
 }
 public Permissions QueryById(int Id)
 {
     return(SqlSugarHelper.GetInstance().Queryable <Permissions>().Where(m => m.PermissionId.Equals(Id)).First() ?? null);
 }
 public bool Add(Permissions t)
 {
     return(SqlSugarHelper.GetInstance().Insertable <Permissions>(t).ExecuteCommand() > 0);
 }