예제 #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_RoleRight()
                 {
                     Pol_RightId = (Guid)r["ID"],
                     Pol_RoleId = (Guid)r["ParentID"],
                     Add = (bool)r["Add"],
                     Edit = (bool)r["Edit"],
                     Delete = (bool)r["Delete"],
                     Default = (bool)r["Default"],
                     Print = (bool)r["Print"],
                     Access = (bool)r["Access"],
                     Full = (bool)r["Full"],
                     None = (bool)r["None"]
                 };
                 _bll.Pol_RoleRight.Insert(o);
             }
             return true;
         }
         else return false;
     }
     catch { return false; }
 }
예제 #2
0
파일: Sample.cs 프로젝트: enrio/skg-pro
        /// <summary>
        /// Pol_RoleRight table
        /// </summary>
        void CreatePol_RoleRight()
        {
            if (Pol_RoleRight.Count() > 0) return;

            var a = (Pol_Dictionary)Pol_Dictionary.Select("ND");
            var b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Level1).FullName);
            var o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = false };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Grant.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = false };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            //b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.FrmPol_Permis).FullName);
            //o = new Pol_RoleRight() { Pol_RoleId = a.Id, Pol_RightId = b.Id, Access = false };
            //Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.FrmPol_Close).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.FrmPol_Exit).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Help.Level1).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Help.Infor.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Help.Infor.Frm_Manual).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Help.Util.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Level1).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Manage.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Sumary.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.InDepot.FrmTra_InDepotFixed).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("QT");
            //b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.FrmPol_Right).FullName);
            //o = new Pol_RoleRight() { Pol_RoleId = a.Id, Pol_RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            //Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.FrmPol_Role).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.FrmPol_User).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.FrmPol_Dictionary).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true, Default = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Grant.FrmPol_UserRight).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Grant.FrmPol_RoleRight).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Grant.FrmPol_UserRole).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Catalog.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Grant.Level2).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            //b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.FrmPol_Permis).FullName);
            //o = new Pol_RoleRight() { Pol_RoleId = a.Id, Pol_RightId = b.Id, Access = true };
            //Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Home.Sytem.FrmPol_Setting).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_Group).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_Tariff).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_VehicleNormal).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_GateInNormal).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            //b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Manage.FrmTra_HandIn).FullName);
            //o = new Pol_RoleRight() { Pol_RoleId = a.Id, Pol_RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            //Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Manage.FrmTra_GateOut).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Sumary.FrmTra_SalesFixed).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true, Print = true };
            Pol_RoleRight.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("CV");
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_GateInNormal).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true, Default = true };
            Pol_RoleRight.Insert(o);
            //b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Manage.FrmTra_HandIn).FullName);
            //o = new Pol_RoleRight() { Pol_RoleId = a.Id, Pol_RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true };
            //Pol_RoleRight.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("CR");
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Manage.FrmTra_GateOut).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true, Default = true };
            Pol_RoleRight.Insert(o);
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Normal.FrmTra_GateInNormal).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Edit = true, Access = true };
            Pol_RoleRight.Insert(o);

            a = (Pol_Dictionary)Pol_Dictionary.Select("TK");
            b = (Pol_Dictionary)Pol_Dictionary.Select(typeof(SKG.DXF.Station.Sumary.FrmTra_SalesFixed).FullName);
            o = new Pol_RoleRight() { RoleId = a.Id, RightId = b.Id, Add = true, Edit = true, Delete = true, Access = true, Print = true, Default = true };
            Pol_RoleRight.Insert(o);
        }