public void Insert(string SUID, long IRoleID, long IParentRoleID, string FpSBranchID)
        {
            var item = new TblRolesForUser();

            item.SUID = SUID;

            item.IRoleID = IRoleID;

            item.IParentRoleID = IParentRoleID;

            item.FpSBranchID = FpSBranchID;


            item.Save(UserName);
        }
        public void Update(string SUID, long IRoleID, long IParentRoleID, string FpSBranchID)
        {
            var item = new TblRolesForUser();

            item.MarkOld();
            item.IsLoaded = true;

            item.SUID = SUID;

            item.IRoleID = IRoleID;

            item.IParentRoleID = IParentRoleID;

            item.FpSBranchID = FpSBranchID;

            item.Save(UserName);
        }
Exemplo n.º 3
0
        public static void SaveTblRoleMap(string varPkSuid, long[] itemList)
        {
            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", varPkSuid, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (long item in itemList)
            {
                var varTblRolesForUser = new TblRolesForUser();
                varTblRolesForUser.SetColumnValue("FP_sBranchID", varPkSuid);
                varTblRolesForUser.SetColumnValue("FP_sBranchID", item);
                varTblRolesForUser.Save();
            }
        }
Exemplo n.º 4
0
        public static void SaveTblManagementUnitMap(long varIRole, TblManagementUnitCollection 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", varIRole, DbType.String);
            coll.Add(cmdDel);
            DataService.ExecuteTransaction(coll);
            foreach (TblManagementUnit item in items)
            {
                var varTblRolesForUser = new TblRolesForUser();
                varTblRolesForUser.SetColumnValue("FP_sBranchID", varIRole);
                varTblRolesForUser.SetColumnValue("FP_sBranchID", item.GetPrimaryKeyValue());
                varTblRolesForUser.Save();
            }
        }
 public bool Destroy(object SUID)
 {
     return(TblRolesForUser.Destroy(SUID) == 1);
 }
 public bool Delete(object SUID)
 {
     return(TblRolesForUser.Delete(SUID) == 1);
 }