Beispiel #1
0
        public TblUserCollection FetchByQuery(Query qry)
        {
            var coll = new TblUserCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Beispiel #2
0
        public TblUserCollection FetchAll()
        {
            var coll = new TblUserCollection();
            var qry  = new Query(TblUser.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Beispiel #3
0
        public static TblUserCollection GetTblUserCollection(string varPkSBranchID)
        {
            var cmd =
                new QueryCommand(
                    "SELECT * FROM [dbo].[tbl_Users] INNER JOIN [tbl_RolesForUsers] ON [tbl_Users].[FP_sBranchID] = [tbl_RolesForUsers].[FP_sBranchID] WHERE [tbl_RolesForUsers].[FP_sBranchID] = @FP_sBranchID",
                    Schema.Provider.Name);

            cmd.AddParameter("@FP_sBranchID", varPkSBranchID, DbType.String);
            IDataReader rdr  = DataService.GetReader(cmd);
            var         coll = new TblUserCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }
Beispiel #4
0
        public static void SaveTblUserMap(string varPkSBranchID, TblUserCollection items)
        {
            var coll = new QueryCommandCollection();
            //delete out the existing
            var cmdDel =
                new QueryCommand(
                    "DELETE FROM [tbl_RolesForUsers] WHERE [tbl_RolesForUsers].[FP_sBranchID] = @FP_sBranchID",
                    Schema.Provider.Name);

            cmdDel.AddParameter("@FP_sBranchID", varPkSBranchID, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (TblUser item in items)
            {
                var varTblRolesForUser = new TblRolesForUser();
                varTblRolesForUser.SetColumnValue("FP_sBranchID", varPkSBranchID);
                varTblRolesForUser.SetColumnValue("FP_sBranchID", item.GetPrimaryKeyValue());
                varTblRolesForUser.Save();
            }
        }
Beispiel #5
0
        public TblUserCollection FetchByID(object PkSuid)
        {
            TblUserCollection coll = new TblUserCollection().Where("PK_sUID", PkSuid).Load();

            return(coll);
        }