Exemplo n.º 1
0
        public SysUserCollection FetchByQuery(Query qry)
        {
            SysUserCollection coll = new SysUserCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemplo n.º 2
0
        public SysUserCollection FetchAll()
        {
            SysUserCollection coll = new SysUserCollection();
            Query             qry  = new Query(SysUser.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Exemplo n.º 3
0
        public static LIS.DAL.SysUserCollection GetSysUserCollection(long varIRole)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand("SELECT * FROM [dbo].[Sys_Users] INNER JOIN [tbl_RolesForUsers] ON [Sys_Users].[FP_sBranchID] = [tbl_RolesForUsers].[FP_sBranchID] WHERE [tbl_RolesForUsers].[FP_sBranchID] = @FP_sBranchID", SysRole.Schema.Provider.Name);
            cmd.AddParameter("@FP_sBranchID", varIRole, DbType.String);
            IDataReader       rdr  = SubSonic.DataService.GetReader(cmd);
            SysUserCollection coll = new SysUserCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Exemplo n.º 4
0
        public static void SaveSysUserMap(long varIRole, SysUserCollection items)
        {
            QueryCommandCollection coll = new SubSonic.QueryCommandCollection();
            //delete out the existing
            QueryCommand cmdDel = new QueryCommand("DELETE FROM [tbl_RolesForUsers] WHERE [tbl_RolesForUsers].[FP_sBranchID] = @FP_sBranchID", SysRole.Schema.Provider.Name);

            cmdDel.AddParameter("@FP_sBranchID", varIRole, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (SysUser item in items)
            {
                TblRolesForUser varTblRolesForUser = new TblRolesForUser();
                varTblRolesForUser.SetColumnValue("FP_sBranchID", varIRole);
                varTblRolesForUser.SetColumnValue("FP_sBranchID", item.GetPrimaryKeyValue());
                varTblRolesForUser.Save();
            }
        }
Exemplo n.º 5
0
        public SysUserCollection FetchByID(object PkSuid)
        {
            SysUserCollection coll = new SysUserCollection().Where("PK_sUID", PkSuid).Load();

            return(coll);
        }