示例#1
0
 protected override bool InsertObject()
 {
     try
     {
         var tb = _dtb.GetChanges(DataRowState.Added);
         if (tb != null)
         {
             foreach (DataRow r in tb.Rows)
             {
                 var o = new Pol_UserRole() { Pol_UserId = (Guid)r["ID"], Pol_RoleId = _idParent };
                 _bll.Pol_UserRole.Insert(o);
             }
             return true;
         }
         else return false;
     }
     catch { return false; }
 }
示例#2
0
文件: Sample.cs 项目: enrio/skg-pro
        /// <summary>
        /// Pol_UserRole table
        /// </summary>
        void CreatePol_UserRole()
        {
            if (Pol_UserRole.Count() > 0) return;

            var a = (Pol_Dictionary)Pol_Dictionary.Select("ND");
            var b = (Pol_User)Pol_User.Select("nvl");
            var o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("nvt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("ntt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("admin");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("kt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("duylong");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("tranhieu");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("cv");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("cr");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("nvl");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("CV");
            b = (Pol_User)Pol_User.Select("nvt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("cv");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("CR");
            b = (Pol_User)Pol_User.Select("ntt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("cr");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("QT");
            b = (Pol_User)Pol_User.Select("admin");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("TK");
            b = (Pol_User)Pol_User.Select("kt");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("duylong");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
            b = (Pol_User)Pol_User.Select("tranhieu");
            o = new Pol_UserRole() { UserId = b.Id, RoleId = a.Id };
            Pol_UserRole.Insert(o);
        }