Ejemplo n.º 1
0
        public Models.UserInGroupResultDo GetUserInGroup(Models.UserGroupCriteriaDo criteria)
        {
            Models.UserInGroupResultDo result = new Models.UserInGroupResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_UserInGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "GroupID", criteria.GroupID);

                result.Rows         = command.ToList <Models.UserInGroupDo>();
                result.TotalRecords = result.Rows.Count;
            }));

            return(result);
        }
Ejemplo n.º 2
0
        public List <Models.ScreenGroupPermissionDo> GetUserGroupPermission(Models.UserGroupCriteriaDo criteria)
        {
            List <Models.ScreenGroupPermissionDo> result = new List <Models.ScreenGroupPermissionDo>();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_UserGroupPermission]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", criteria.GroupID);

                List <Models.ScreenPermissionDo> permissions = command.ToList <Models.ScreenPermissionDo>();
                foreach (Models.ScreenPermissionDo p in permissions)
                {
                    if (Utils.CommonUtil.IsNullOrEmpty(p.GroupNameEN) &&
                        Utils.CommonUtil.IsNullOrEmpty(p.GroupNameLC))
                    {
                        Models.ScreenGroupPermissionDo grp = new Models.ScreenGroupPermissionDo();
                        grp.Screens = new List <Models.ScreenPermissionDo>();
                        result.Add(grp);

                        grp.Screens.Add(p);
                    }
                    else
                    {
                        Models.ScreenGroupPermissionDo grp = result.Find(x =>
                                                                         x.GroupNameEN == p.GroupNameEN &&
                                                                         x.GroupNameLC == p.GroupNameLC);
                        if (grp == null)
                        {
                            grp                = new Models.ScreenGroupPermissionDo();
                            grp.GroupNameEN    = p.GroupNameEN;
                            grp.GroupNameLC    = p.GroupNameLC;
                            grp.GroupImageIcon = p.GroupImageIcon;

                            grp.Screens = new List <Models.ScreenPermissionDo>();
                            result.Add(grp);
                        }

                        grp.Screens.Add(p);
                    }
                }
            }));

            return(result);
        }
Ejemplo n.º 3
0
        public Models.UserGroupDo GetUserGroup(Models.UserGroupCriteriaDo criteria)
        {
            Models.UserGroupDo result = null;

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_UserGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", criteria.GroupID);

                List <Models.UserGroupDo> list = command.ToList <Models.UserGroupDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result = list[0];
                    }
                }
            }));

            return(result);
        }
Ejemplo n.º 4
0
        public Models.UserGroupFSResultDo GetUserGroupList(Models.UserGroupCriteriaDo criteria)
        {
            Models.UserGroupFSResultDo result = new Models.UserGroupFSResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_UserGroupList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "GroupName", criteria.GroupName);
                command.AddParameter(typeof(string), "Description", criteria.Description);
                command.AddParameter(typeof(string), "UserName", criteria.UserName);
                command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive);
                command.AddParameter(typeof(bool), "IncludeSystemAdmin", criteria.IncludeSystemAdmin);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.UserGroupFSDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }