Exemple #1
0
 public void init()
 {
     if (adminService == null)
     {
         adminService = new ServiceAdmin();
     }
 }
        public ExtServiceAdmin queryPageAdmin(Dictionary <String, object> condition)
        {
            int StartPoint = 1, EndPoint = 15;

            if (condition.ContainsKey("start"))
            {
                StartPoint = Convert.ToInt16(condition["start"]) + 1;
            }
            if (condition.ContainsKey("limit"))
            {
                EndPoint = Convert.ToInt16(condition["limit"]);
                EndPoint = StartPoint + EndPoint - 1;
            }
            UtilDictionary.Removes(condition, "start", "limit");

            if (adminService == null)
            {
                adminService = new ServiceAdmin();
            }
            string WhereClause = FiltertoCondition(condition);
            int    RowCount    = adminService.Count(WhereClause);//总行记录数

            if (RowCount > 0)
            {
                List <Admin> listAdmins = adminService.QueryPage(StartPoint, EndPoint, WhereClause).ToList <Admin>();
                if (EndPoint > RowCount)
                {
                    EndPoint = RowCount;
                }
                this.Stores = new List <Object>();
                foreach (Admin admin in listAdmins)
                {
                    admin.RoletypeShow    = EnumRoletype.RoletypeShow(Convert.ToChar(admin.Roletype));
                    admin.SeescopeShow    = EnumSeescope.SeescopeShow(Convert.ToChar(admin.Seescope));
                    admin.Department_Name = admin.Department.Department_Name;
                    this.Stores.Add((Admin)ClearInclude(admin));
                }
            }
            this.TotalCount = RowCount;
            this.Success    = true;
            return(this);
        }
        public ExtServiceAdmin queryPageAdmin(Dictionary<String, object> condition)
        {
            int StartPoint = 1, EndPoint = 15;

            if (condition.ContainsKey("start")) StartPoint = Convert.ToInt16(condition["start"])+1;
            if (condition.ContainsKey("limit"))
            {
                EndPoint = Convert.ToInt16(condition["limit"]);
                EndPoint = StartPoint + EndPoint - 1;
            }
            UtilDictionary.Removes(condition, "start", "limit");

            if (adminService == null) adminService = new ServiceAdmin();
            string WhereClause = FiltertoCondition(condition);
            int RowCount = adminService.Count(WhereClause);//总行记录数
            if (RowCount > 0)
            {
                List<Admin> listAdmins = adminService.QueryPage(StartPoint, EndPoint, WhereClause).ToList<Admin>();
                if (EndPoint > RowCount) EndPoint = RowCount;
                this.Stores = new List<Object>();
                foreach (Admin admin in listAdmins)
                {
                    admin.RoletypeShow = EnumRoletype.RoletypeShow(Convert.ToChar(admin.Roletype));
                    admin.SeescopeShow = EnumSeescope.SeescopeShow(Convert.ToChar(admin.Seescope));
                    admin.Department_Name = admin.Department.Department_Name;
                    this.Stores.Add((Admin)ClearInclude(admin));
                }
            }
            this.TotalCount = RowCount;
            this.Success = true;
            return this;
        }
 public void init()
 {
     if (adminService == null) adminService = new ServiceAdmin();
 }