Ejemplo n.º 1
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="keyId">主键-密钥编号</param>
        /// <returns></returns>
        private UsbKeyData getData(string keyId)
        {
            #region
            UsbKeyData   usbkeydata          = new UsbKeyData();
            DBConditions querybusinessparams = new DBConditions();
            querybusinessparams.Add(UsbKeyData.keyId, EnumSqlType.sqlint, EnumCondition.Equal, keyId);
            this._usbkeyclass.GetSingleTAllWithoutCount(usbkeydata, querybusinessparams);
            return(usbkeydata);

            #endregion
        }
Ejemplo n.º 2
0
        public DataSet SelectAllocMissions(DBConditions conditions)
        {
            #region
            DataSet wlogmissiondata = new DataSet();
            string  businessSql     = @"SELECT missionId as id, missionName as text FROM [WLOGMission]";
            conditions.AddKeys(WLOGMissionData.missionId);
            base.GetCustomBusiness(businessSql, wlogmissiondata, conditions);
            return(wlogmissiondata);

            #endregion
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="collectTypeId">关系建</param>
        /// <returns></returns>
        private InsideCollectData getDataByCollectTypeId(string collectTypeId)
        {
            #region
            InsideCollectData insidecollectdata   = new InsideCollectData();
            DBConditions      querybusinessparams = new DBConditions();
            querybusinessparams.Add(InsideCollectData.collectTypeId, EnumSqlType.sqlint, EnumCondition.Equal, collectTypeId);
            this._insidecollectclass.GetSingleT(insidecollectdata, querybusinessparams);
            return(insidecollectdata);

            #endregion
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="examHistoryId">主键-考试成绩单编号</param>
        /// <returns></returns>
        private ExamHistoryData getData(string examHistoryId)
        {
            #region
            ExamHistoryData examhistorydata     = new ExamHistoryData();
            DBConditions    querybusinessparams = new DBConditions();
            querybusinessparams.Add(ExamHistoryData.examHistoryId, EnumSqlType.sqlint, EnumCondition.Equal, examHistoryId);
            this._examhistoryclass.GetSingleTAllWithoutCount(examhistorydata, querybusinessparams);
            return(examhistorydata);

            #endregion
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="logId">主键-日志流水号</param>
        /// <returns></returns>
        private WLOGPersonLogData getData(string logId)
        {
            #region
            WLOGPersonLogData wlogpersonLogData   = new WLOGPersonLogData();
            DBConditions      querybusinessparams = new DBConditions();
            querybusinessparams.Add(WLOGPersonLogData.logId, EnumSqlType.sqlint, EnumCondition.Equal, logId);
            this._wlogpersonlogclass.GetSingleTAllWithoutCount(wlogpersonLogData, querybusinessparams);
            return(wlogpersonLogData);

            #endregion
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="domainTypeId">主键-</param>
        /// <returns></returns>
        private BookDomainTypeData getData(string domainTypeId)
        {
            #region
            BookDomainTypeData bookvomaintypedata  = new BookDomainTypeData();
            DBConditions       querybusinessparams = new DBConditions();
            querybusinessparams.Add(BookDomainTypeData.domainTypeId, EnumSqlType.sqlint, EnumCondition.Equal, domainTypeId);
            this._bookdomaintypeclass.GetSingleT(bookvomaintypedata, querybusinessparams);
            return(bookvomaintypedata);

            #endregion
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 根据主键值检索符合该条件的记录,用于编辑和删除记录时。
        /// </summary>
        /// <param name="uid">主键-用户序列号</param>
        /// <returns></returns>
        private TUserData getData(string uid)
        {
            #region
            TUserData    tuserdata           = new TUserData();
            DBConditions querybusinessparams = new DBConditions();
            querybusinessparams.Add(TUserData.uid, EnumSqlType.sqlint, EnumCondition.Equal, uid);
            this._tuserclass.GetSingleTAllWithoutCount(tuserdata, querybusinessparams);
            return(tuserdata);

            #endregion
        }
Ejemplo n.º 8
0
        public DataSet GetMenuByRole(DBConditions conditions)
        {
            #region
            DataSet menudata    = new DataSet();
            string  businessSql = @"SELECT a.*,b.roleId FROM [Menu] a 
                inner join [RoleControlMenu] b on a.menuId = b.menuId ";
            conditions.AddKeys(MenuData.menuId);
            base.GetCustomBusiness(businessSql, menudata, conditions);
            return(menudata);

            #endregion
        }
Ejemplo n.º 9
0
        public string GetCity(int parentId)
        {
            #region
            DBConditions querybusinessparams = new DBConditions();
            querybusinessparams.Add(AddressData.parentId, EnumSqlType.sqlint, EnumCondition.Equal, parentId);
            int         totalCount  = 0;
            AddressData addressdata = new AddressData();
            totalCount = this._addressclass.GetSingleTAll(addressdata, querybusinessparams);
            return(base.GetJson(addressdata, totalCount));

            #endregion
        }
Ejemplo n.º 10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fillDs"></param>
 /// <param name="conditions"></param>
 /// <returns></returns>
 public void GetSingleTAllWithoutCount(DataSet fillDs,
                                       DBConditions conditions)
 {
     #region
     if (conditions == null)
     {
         conditions = new DBConditions();
     }
     conditions.PageSize = int.MaxValue;
     getCustomDs(fillDs, conditions,
                 EnumDBReturnAccess.FillDsByCustom, false);
     #endregion
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 获取单表数据(非存储过程)
        /// </summary>
        /// <param name="fillDs">传入数据集</param>
        /// <param name="conditions">查询条件</param>
        /// <returns>符合where条件的记录条数(去除分页)</returns>
        public int GetSingleT(DataSet fillDs,
                              DBConditions conditions)
        {
            #region
            if (conditions == null)
            {
                conditions = new DBConditions();
            }
            return(getCustomDs(fillDs, conditions,
                               EnumDBReturnAccess.FillDsByCustom, true));

            #endregion
        }
Ejemplo n.º 12
0
        public string GetLogsTimes(EntityLogsTimes logstimes)
        {
            #region
            PageParams   pageparams          = new PageParams();
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(WLOGPersonLogData.writeUser, EnumSqlType.sqlint,
                                    EnumCondition.InValues, logstimes.writeUser);
            DataSet logstimesdata = this._wlogpersonlogclass.SelectLogsTimes(querybusinessparams,
                                                                             logstimes.startDate, logstimes.endDate);
            int totalCount = logstimesdata.Tables[0].Rows.Count;
            return(base.GetJson(logstimesdata, totalCount));

            #endregion
        }
Ejemplo n.º 13
0
        public DataSet GetFriendsByGroup(string uid)
        {
            #region
            DBConditions querybusinessparams = new DBConditions();

            querybusinessparams.Add(TUserData.uid, EnumSqlType.sqlint, EnumCondition.Equal, uid);

            DataSet tuserdata = this._tuserclass
                                .SelectUserByGroup(querybusinessparams);

            return(tuserdata);

            #endregion
        }
Ejemplo n.º 14
0
        /****************************************
         ***生成器版本:V1.0.1.31494
         ***生成时间:2013-04-24 18:44:01
         ***公司:山西ICat Studio有限公司
         ***友情提示:以下代码为生成器自动生成,可做参照复制之用;
         ***         如需有其他业务要求,则可在region外添加新的业务关联方法;
         ***         如发现任何编译错误,请联系QQ:330669393。
         *****************************************/
        /// <summary>
        /// 检索数据并分页返回数据集
        /// </summary>
        /// <param name="recordCount">符合条件的总记录数</param>
        /// <param name="qParams">分页对象</param>
        /// <param name="conditions">查询条件集合</param>
        /// <returns>分页数据</returns>
        public int SelectWLOGMissionByPage(WLOGMissionData wlogmissiondata, DBConditions conditions)
        {
            #region
            string sqlformat   = @"SELECT {0} FROM [WLOGMission] a 
                                         left join 
                                              (select count(logId) as personlogcount,missionid from dbo.WLOGPersonLog group by missionid) b 
                                                      on a.missionid = b.missionid";
            string businesssql = string.Format(sqlformat, "a.*, b.personlogcount");
            string countsql    = string.Format(sqlformat, "count(*)");
            conditions.AddKeys(WLOGMissionData.missionId);
            return(base.GetCustomBusiness(businesssql, countsql, wlogmissiondata, conditions));

            #endregion
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 获取单表所有数据
        /// </summary>
        /// <param name="fillDs">传入数据集</param>
        /// <param name="conditions">查询条件</param>
        /// <returns>符合where条件的记录条数(去除分页)</returns>
        public int GetSingleTAll(DataSet fillDs,
                                 DBConditions conditions)
        {
            #region
            if (conditions == null)
            {
                conditions = new DBConditions();
            }
            conditions.PageSize = int.MaxValue;
            return(getCustomDs(fillDs, conditions,
                               EnumDBReturnAccess.FillDsByCustom, true));

            #endregion
        }
Ejemplo n.º 16
0
        ///****************************************
        //***生成器版本:V1.0.1.31494
        //***生成时间:2013-04-24 18:44:01
        //***公司:山西ICat Studio有限公司
        //***友情提示:以下代码为生成器自动生成,可做参照复制之用;
        //***         如需有其他业务要求,则可在region外添加新的业务关联方法;
        //***         如发现任何编译错误,请联系QQ:330669393。
        //*****************************************/

        /// <summary>
        /// 检索数据并分页返回数据集
        /// </summary>
        /// <param name="recordCount">符合条件的总记录数</param>
        /// <param name="qParams">分页对象</param>
        /// <param name="conditions">查询条件集合</param>
        /// <returns>分页数据</returns>
        public DataSet SelectWLOGProjectTreeByPage(PageParams qParams,
                                                   DBConditions conditions)
        {
            #region
            WLOGProjectTreeData wlogprojecttreedata = new WLOGProjectTreeData();
            string businessSql = @"SELECT * FROM [WLOGProjectTree]";

            //conditions.AddKeys(WLOGProjectTreeData.currentId);

            base.GetCustomBusiness(businessSql, wlogprojecttreedata, conditions);
            return(wlogprojecttreedata);

            #endregion
        }
Ejemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="conditions"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="missionState"></param>
        /// <param name="reviewState"></param>
        /// <returns></returns>
        public DataSet SelectWorktotal(DBConditions conditions,
                                       string startDate, string endDate, string missionState,
                                       string reviewState)
        {
            #region
            DataSet  worktotaldata   = new DataSet();
            string[] innerconditions = new string[4] {
                "", "", "", ""
            };
            string businessSql = @"SELECT a.userid, a.fullName, a.isTotal, 
            isnull(c.missiondays, 0) as 计划内工作量, 
            isnull(b.missiondays, 0) as 计划外工作量, 
            isnull(b.missiondays, 0)+isnull(c.missiondays, 0) as 所有工作量 FROM [ApplicationUser] a
left join 
(
select a1.writeuser, sum(missionday) as missiondays from dbo.WLOGMission a1 left join 
(select missionid, count(*) as missionday from dbo.WLOGPersonLog group by missionid ) b1
on a1.missionid = b1.missionid where a1.planned = 0{0}{1}{2}{3} group by a1.writeuser) b 
on a.userid = b.writeuser 
left join 
(
select a1.writeuser, sum(plantimelimit) as missiondays from dbo.WLOGMission a1 
where a1.planned = 1{0}{1}{2}{3} group by a1.writeuser) c 
on a.userid = c.writeuser ";
            if (!string.IsNullOrEmpty(startDate))
            {
                innerconditions[0] = " and (a1.startDate >= '" + startDate + "') ";
            }
            if (!string.IsNullOrEmpty(endDate))
            {
                innerconditions[1] = " and (a1.startDate <= '" + endDate + "') ";
            }
            if (!string.IsNullOrEmpty(missionState))
            {
                innerconditions[2] = " and (a1.missionState = '" + missionState + "') ";
            }
            if (!string.IsNullOrEmpty(reviewState))
            {
                innerconditions[3] = " and (a1.reviewState = " + ((reviewState.ToLower() == "true") ? "1" : "0") + ") ";
            }

            businessSql = string.Format(businessSql, innerconditions);
            conditions.AddKeys(WLOGMissionData.missionId);

            base.GetWithoutPageBusiness(businessSql, worktotaldata, conditions);
            return(worktotaldata);

            #endregion
        }
Ejemplo n.º 18
0
        public string GetWorkTotal(EntityMissionReport missionReport)
        {
            #region
            DBConditions querybusinessparams = new DBConditions();
            querybusinessparams.Add(ApplicationUserData.userid, EnumSqlType.sqlint,
                                    EnumCondition.InValues, missionReport.writeUser);
            querybusinessparams.Add(ApplicationUserData.isTotal, EnumSqlType.bit,
                                    EnumCondition.Equal, true);
            DataSet wlogmissiondata = this._wlogmissionclass.SelectWorktotal(querybusinessparams,
                                                                             missionReport.startDate, missionReport.endDate, missionReport.missionState, missionReport.reviewState);
            int totalCount = wlogmissiondata.Tables[0].Rows.Count;
            return(base.GetJson(wlogmissiondata, totalCount));

            #endregion
        }
Ejemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="personlog"></param>
        /// <param name="isAddMissionIdNull"></param>
        /// <returns></returns>
        public string GetPersonLogByMissionId(EntityWLOGPersonLog personlog, SceneMission scene)
        {
            #region
            PageParams   pageparams          = new PageParams();
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(WLOGPersonLogData.writeUser,
                                    EnumSqlType.sqlint, EnumCondition.Equal, personlog.writeUser);
            querybusinessparams.Add(WLOGPersonLogData.isMission,
                                    EnumSqlType.bit, EnumCondition.Equal, true);

            switch (scene)
            {
            case SceneMission.ViewPersonlogs:
                querybusinessparams.Add(WLOGPersonLogData.missionId,
                                        EnumSqlType.sqlint, EnumCondition.Equal, personlog.missionId);
                break;

            case SceneMission.AddMission:
                querybusinessparams.Add(WLOGPersonLogData.missionId,
                                        EnumSqlType.sqlint, EnumCondition.EmptyIsNull, "");
                break;

            case SceneMission.EditMission:
                querybusinessparams.Or(WLOGPersonLogData.missionId,
                                       EnumSqlType.sqlint, EnumCondition.EmptyIsNull, "");
                querybusinessparams.Add(WLOGPersonLogData.missionId,
                                        EnumSqlType.sqlint, EnumCondition.Equal, personlog.missionId);
                querybusinessparams.Add(WLOGPersonLogData.writeUser,
                                        EnumSqlType.sqlint, EnumCondition.Equal, personlog.writeUser);
                querybusinessparams.Add(WLOGPersonLogData.isMission,
                                        EnumSqlType.bit, EnumCondition.Equal, true);

                break;

            default:
                break;
            }


            int totalCount = 0;
            WLOGPersonLogData wlogpersonlogdata = new WLOGPersonLogData();
            this._wlogpersonlogclass.GetSingleT(wlogpersonlogdata, querybusinessparams);
            totalCount = wlogpersonlogdata.Tables[0].Rows.Count;
            return(base.GetJson(wlogpersonlogdata, totalCount));

            #endregion
        }
Ejemplo n.º 20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public DataSet GetControlMenu(int roleId)
        {
            #region
            DataSet rolecontrolmenudata = new DataSet();
            string  businessSql         = @"SELECT a.*,
                            case when b.menuId is NULL then 'false' else 'true' end as Checked 
                            FROM [Menu] a 
                            left join (select * from [RoleControlMenu] where roleid = {0}) b on a.menuId = b.menuId";
            businessSql = String.Format(businessSql, roleId);
            DBConditions conditions = new DBConditions();
            conditions.AddKeys(RoleControlMenuData.roleId);
            conditions.AddKeys(RoleControlMenuData.menuId);
            base.GetWithoutPageBusiness(businessSql, rolecontrolmenudata, conditions);
            return(rolecontrolmenudata);

            #endregion
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 添加检索操作,带条件过滤
        /// </summary>
        /// <param name="sqlExpression"></param>
        /// <param name="conditions"></param>
        /// <param name="fillDs"></param>
        public override void AddAction(string sqlExpression,
                                       DBConditions conditions, DataSet fillDs, EnumDBReturnAccess enumReturn)
        {
            if (enumReturn == EnumDBReturnAccess.ExeNoQuery ||
                enumReturn == EnumDBReturnAccess.SaveDS ||
                enumReturn == EnumDBReturnAccess.Scalar)
            {
                ExtConsole.Write("该接口只提供填充数据集的功能!");
                return;
            }
            Expression sql = this.createSqlAction();

            sql.ReturnDS      = fillDs;
            sql.SqlBusiness   = sqlExpression;
            sql.SqlConditions = conditions;
            sql.EnumReturn    = enumReturn;
            this._executor.Actions.Add(sql);
        }
Ejemplo n.º 22
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sqlExpression"></param>
 /// <param name="enumReturn"></param>
 /// <param name="conditions"></param>
 public override void AddAction(string sqlExpression,
                                EnumDBReturnAccess enumReturn, DBConditions conditions)
 {
     #region
     if (enumReturn == EnumDBReturnAccess.SaveDS ||
         enumReturn == EnumDBReturnAccess.FillDsByCustom ||
         enumReturn == EnumDBReturnAccess.FillDsByStoredProcedure)
     {
         ExtConsole.Write("该接口不提供存储数据集或检索数据集功能!");
         return;
     }
     Expression sql = this.createSqlAction();
     sql.SqlBusiness   = sqlExpression;
     sql.EnumReturn    = enumReturn;
     sql.SqlConditions = conditions;
     this._executor.Actions.Add(sql);
     #endregion
 }
Ejemplo n.º 23
0
        /// <summary>
        /// 根据条件筛选所有Address指定页码的数据(分页型)
        /// </summary>
        /// <param name="address">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public DataSet GetData(EntityAddress address, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(AddressData.addrId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, address.addrId);
            querybusinessparams.Add(AddressData.addrName, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, address.addrName);
            querybusinessparams.Add(AddressData.parentId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, address.parentId);
            querybusinessparams.Add(AddressData.usable, EnumSqlType.bit,
                                    EnumCondition.Equal, address.usable);
            AddressData addressdata = new AddressData();
            totalCount = this._addressclass.GetSingleT(addressdata, querybusinessparams);
            return(addressdata);

            #endregion
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 根据条件筛选所有BookFromCountry指定页码的数据(分页型)
        /// </summary>
        /// <param name="bookfromcountry">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public DataSet GetData(EntityBookFromCountry bookfromcountry, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(BookFromCountryData.countryId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, bookfromcountry.countryId);
            querybusinessparams.Add(BookFromCountryData.countryName, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, bookfromcountry.countryName);
            querybusinessparams.Add(BookFromCountryData.usable, EnumSqlType.bit,
                                    EnumCondition.Equal, bookfromcountry.usable);
            querybusinessparams.Add(BookFromCountryData.sort, EnumSqlType.sqlint,
                                    EnumCondition.Equal, bookfromcountry.sort);
            BookFromCountryData bookfromcountrydata = new BookFromCountryData();
            totalCount = this._bookfromcountryclass.GetSingleT(bookfromcountrydata, querybusinessparams);
            return(bookfromcountrydata);

            #endregion
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 根据条件筛选所有BookBelongTo指定页码的数据(分页型)
        /// </summary>
        /// <param name="bookbelongto">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public DataSet GetData(EntityBookBelongTo bookbelongto, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(BookBelongToData.belongtoId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, bookbelongto.belongtoId);
            querybusinessparams.Add(BookBelongToData.fullname, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, bookbelongto.fullname);
            querybusinessparams.Add(BookBelongToData.usable, EnumSqlType.bit,
                                    EnumCondition.Equal, bookbelongto.usable);
            querybusinessparams.Add(BookBelongToData.sort, EnumSqlType.sqlint,
                                    EnumCondition.Equal, bookbelongto.sort);
            BookBelongToData bookbelongdata = new BookBelongToData();
            totalCount = this._bookbelongtoclass.GetSingleT(bookbelongdata, querybusinessparams);
            return(bookbelongdata);

            #endregion
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 根据条件筛选所有Group指定页码的数据(分页型)
        /// </summary>
        /// <param name="group">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public GroupData GetData(EntityGroup group, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(GroupData.gid, EnumSqlType.sqlint,
                                    EnumCondition.Equal, group.gid);
            querybusinessparams.Add(GroupData.uid, EnumSqlType.sqlint,
                                    EnumCondition.Equal, group.uid);
            querybusinessparams.Add(GroupData.groupName, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, group.groupName);
            querybusinessparams.Add(GroupData.writeTime, EnumSqlType.datetime,
                                    EnumCondition.Equal, group.writeTime);
            GroupData groupdata = new GroupData();
            totalCount = this._groupclass.GetSingleT(groupdata, querybusinessparams);
            return(groupdata);

            #endregion
        }
Ejemplo n.º 27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public DataSet SelectUserByGroup(DBConditions conditions)
        {
            #region
            DataSet userbygroupdata = new DataSet();
            string  businessSql     = @"SELECT a.[uid],d.[uid] as friendId, a.[userid], d.[userid] as friendQQ,
	c.[groupName], a.[userfullName], d.[UserFullName] as friendFullname from [Friendship] b
	inner join [TUser] a  on a.[uid] = b.[meId] 
	inner join [Group] c on b.[gid] = c.[gid] 
	left join [TUser] d on b.[friendid] = d.[uid] "    ;

            conditions.AddKeys(TUserData.uid);

            base.GetWithoutPageBusiness(
                businessSql, userbygroupdata, conditions);

            return(userbygroupdata);

            #endregion
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 根据权限组获取菜单json(系统左边菜单列表显示)
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public string GetSystemMenuList(string roleId, string userId)
        {
            #region
            string    menulistjson = "";
            MenuClass menuclass    = new MenuClass();
            if (String.IsNullOrEmpty(roleId))
            {
                return("{ topics:[]}");
            }

            DBConditions queryconditions = new DBConditions();
            queryconditions.Add(RoleControlMenuData.roleId, EnumSqlType.tinyint, EnumCondition.Equal, roleId);
            queryconditions.Add(MenuData.usable, EnumSqlType.bit, EnumCondition.Equal, true);

            DataSet menulistdata = menuclass.GetMenuByRole(queryconditions);

            menulistjson += string.Format("{{ roleId:'{0}',userid:'{1}', topics:[", roleId, userId);

            DataRow[] menucollect = menulistdata.Tables[0].Select(MenuData.parentId + " = 0");

            foreach (DataRow dr in menucollect)
            {
                string treejson      = "";
                string currentmenuid = dr[MenuData.currentId].ToString();
                this.iteratorSystemMenu(menulistdata, currentmenuid, ref treejson);
                menulistjson += "{menuid:'" + currentmenuid + "',menuname:'" + dr[MenuData.menuName].ToString() + "',children:[" + treejson;
                if (menulistdata.Tables[0].Select(MenuData.parentId + " = " + currentmenuid).Length == 0)
                {
                    menulistjson += "]";
                }
                menulistjson += "},";
            }
            //去掉json中多余的逗号
            if (menucollect.Length > 0)
            {
                menulistjson = menulistjson.Remove(menulistjson.Length - 1, 1);
            }

            menulistjson += "]}";
            return(menulistjson);

            #endregion
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 根据条件筛选所有Friendship指定页码的数据(分页型)
        /// </summary>
        /// <param name="friendship">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public FriendshipData GetData(EntityFriendship friendship, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(FriendshipData.fid, EnumSqlType.sqlint,
                                    EnumCondition.Equal, friendship.fid);
            querybusinessparams.Add(FriendshipData.meId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, friendship.meId);
            querybusinessparams.Add(FriendshipData.friendId, EnumSqlType.sqlint,
                                    EnumCondition.Equal, friendship.friendId);
            querybusinessparams.Add(FriendshipData.gid, EnumSqlType.sqlint,
                                    EnumCondition.Equal, friendship.gid);
            querybusinessparams.Add(FriendshipData.writeTime, EnumSqlType.datetime,
                                    EnumCondition.Equal, friendship.writeTime);
            FriendshipData friendshipdata = new FriendshipData();
            totalCount = this._friendshipclass.GetSingleT(friendshipdata, querybusinessparams);
            return(friendshipdata);

            #endregion
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 根据条件筛选所有SystemRole指定页码的数据(分页型)
        /// </summary>
        /// <param name="systemrole">实体对象</param>
        /// <param name="pageparams">分页对象</param>
        /// <param name="totalCount">符合条件的记录总数量</param>
        /// <returns></returns>
        public DataSet GetData(EntitySystemRole systemrole, PageParams pageparams, out int totalCount)
        {
            #region
            DBConditions querybusinessparams = new DBConditions(pageparams);
            querybusinessparams.Add(SystemRoleData.roleId, EnumSqlType.tinyint,
                                    EnumCondition.Equal, systemrole.roleId);
            querybusinessparams.Add(SystemRoleData.roleName, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, systemrole.roleName);
            querybusinessparams.Add(SystemRoleData.usable, EnumSqlType.bit,
                                    EnumCondition.Equal, systemrole.usable);
            querybusinessparams.Add(SystemRoleData.remark, EnumSqlType.nvarchar,
                                    EnumCondition.Equal, systemrole.remark);
            querybusinessparams.Add(SystemRoleData.sort, EnumSqlType.tinyint,
                                    EnumCondition.Equal, systemrole.sort);
            SystemRoleData systemroledata = new SystemRoleData();
            totalCount = this._systemroleclass.GetSingleT(systemroledata, querybusinessparams);
            return(systemroledata);

            #endregion
        }