Exemplo n.º 1
0
        static void PrintRanks(Player p, AccessController access, string initial)
        {
            StringBuilder perms = new StringBuilder(initial);

            access.Describe(p, perms);
            p.Message(perms.ToString());
        }
Exemplo n.º 2
0
        static bool SetList(Player p, string name,
                            AccessController access, CommandData data, Level lvl)
        {
            bool   include = name[0] == '+';
            string mode    = include ? "whitelist" : "blacklist";

            name = name.Substring(1);
            if (name.Length == 0)
            {
                p.Message("You must provide a player name to {0}.", mode);
                return(false);
            }

            name = PlayerInfo.FindMatchesPreferOnline(p, name);
            if (name == null)
            {
                return(false);
            }

            if (!include && name.CaselessEq(p.name))
            {
                p.Message("&WYou cannot blacklist yourself."); return(false);
            }

            if (include)
            {
                access.Whitelist(p, data.Rank, lvl, name);
            }
            else
            {
                access.Blacklist(p, data.Rank, lvl, name);
            }
            return(true);
        }
            /*
             * Internal type checks within all update methods contain
             * internal inlined optimizations checking for the common
             * cases where the class is final (in which case a simple
             * getClass comparison suffices) or is of type Object (in
             * which case no check is needed because all objects are
             * instances of Object). The Object case is handled simply by
             * setting vclass to null in constructor.  The targetCheck and
             * updateCheck methods are invoked when these faster
             * screenings fail.
             */

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: AtomicReferenceFieldUpdaterImpl(final Class tclass, final Class vclass, final String fieldName, final Class caller)
            internal AtomicReferenceFieldUpdaterImpl(Class tclass, Class vclass, String fieldName, Class caller)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Field field;
                Field field;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Class fieldClass;
                Class fieldClass;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int modifiers;
                int modifiers;

                try
                {
                    field     = AccessController.doPrivileged(new PrivilegedExceptionActionAnonymousInnerClassHelper(this, tclass, fieldName));
                    modifiers = field.Modifiers;
                    sun.reflect.misc.ReflectUtil.ensureMemberAccess(caller, tclass, null, modifiers);
                    ClassLoader cl  = tclass.ClassLoader;
                    ClassLoader ccl = caller.ClassLoader;
                    if ((ccl != null) && (ccl != cl) && ((cl == null) || !IsAncestor(cl, ccl)))
                    {
                        sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
                    }
                    fieldClass = field.Type;
                }
                catch (PrivilegedActionException pae)
                {
                    throw new RuntimeException(pae.Exception);
                }
                catch (Exception ex)
                {
                    throw new RuntimeException(ex);
                }

                if (vclass != fieldClass)
                {
                    throw new ClassCastException();
                }
                if (vclass.Primitive)
                {
                    throw new IllegalArgumentException("Must be reference type");
                }

                if (!Modifier.isVolatile(modifiers))
                {
                    throw new IllegalArgumentException("Must be volatile type");
                }

                this.Cclass = (Modifier.isProtected(modifiers) && caller != tclass) ? caller : null;
                this.Tclass = tclass;
                if (vclass == typeof(Object))
                {
                    this.Vclass = null;
                }
                else
                {
                    this.Vclass = vclass;
                }
                Offset = @unsafe.objectFieldOffset(field);
            }
Exemplo n.º 4
0
        /// <summary>
        /// {@inheritDoc}
        /// <p>this method inspects the stack trace and checks who is calling
        /// <seealso cref="System#exit(int)"/> and similar methods </summary>
        /// <exception cref="SecurityException"> if the caller of this method is not the test runner itself. </exception>
        public override void CheckExit(int status)
        {
            AccessController.doPrivileged(new PrivilegedActionAnonymousClass(this, status));

            // we passed the stack check, delegate to super, so default policy can still deny permission:
            base.CheckExit(status);
        }
Exemplo n.º 5
0
        private void ChatMessagesNew(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "projects.chat"))
            {
                return;
            }

            try
            {
                var PreMessage = Package.Unpacking <Chat>(ClientResponse.DataBytes);

                using (var db = new DatabaseContext())
                {
                    PreMessage.UserId = Users.GetUserById(NetworkClient.Id).Id;
                    PreMessage.Date   = DateTime.Now;

                    db.Chats.Add(PreMessage);
                    db.SaveChanges();

                    Sender.Broadcast("Chat.Messages.New.Confirm", GetModelMessage(db, PreMessage));
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникло исключение при добавлении нового сообщения. Код ошибки:\n" + ex);

                Sender.Send(NetworkClient, "Chat.Messages.New.Error");
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Implements the SPNEGO authentication sequence interaction using the current default principal
 /// in the Kerberos cache (normally set via kinit).
 /// </summary>
 /// <param name="token">the authentication token being used for the user.</param>
 /// <exception cref="System.IO.IOException">if an IO error occurred.</exception>
 /// <exception cref="AuthenticationException">if an authentication error occurred.</exception>
 /// <exception cref="Org.Apache.Hadoop.Security.Authentication.Client.AuthenticationException
 ///     "/>
 private void DoSpnegoSequence(AuthenticatedURL.Token token)
 {
     try
     {
         AccessControlContext context = AccessController.GetContext();
         Subject subject = Subject.GetSubject(context);
         if (subject == null || (subject.GetPrivateCredentials <KerberosKey>().IsEmpty() &&
                                 subject.GetPrivateCredentials <KerberosTicket>().IsEmpty()))
         {
             Log.Debug("No subject in context, logging in");
             subject = new Subject();
             LoginContext login = new LoginContext(string.Empty, subject, null, new KerberosAuthenticator.KerberosConfiguration
                                                       ());
             login.Login();
         }
         if (Log.IsDebugEnabled())
         {
             Log.Debug("Using subject: " + subject);
         }
         Subject.DoAs(subject, new _PrivilegedExceptionAction_287(this));
     }
     catch (PrivilegedActionException ex)
     {
         // Loop while the context is still not established
         throw new AuthenticationException(ex.GetException());
     }
     catch (LoginException ex)
     {
         throw new AuthenticationException(ex);
     }
     AuthenticatedURL.ExtractToken(conn, token);
 }
        protected void LoadData(string key)
        {
            List <ReimbursementStandard> list = ReimbursementStandard.GetAll();

            //根据权限过滤
            list = list.FindAll(a => a.员工信息 != null && AccessController.CheckPayGroup(a.员工信息.薪资组));
            list = list.OrderBy(a => a.员工信息.员工序号).ToList();
            if (string.IsNullOrEmpty(key) == false)
            {
                list = list.FindAll(a => a.姓名.Contains(key));
            }
            //如果不显示历史记录
            if (chk显示历史记录.Checked == false)
            {
                List <ReimbursementStandard> tempList = new List <ReimbursementStandard>();
                foreach (ReimbursementStandard item in list)
                {
                    //只需要最后生效的记录
                    DateTime date = list.FindAll(a => a.效).Max(a => a.生效日期);
                    if (item.生效日期 == date)
                    {
                        tempList.Add(item);
                    }
                }
                list = tempList;
            }
            gridControl1.DataSource = list;
            gridControl1.RefreshDataSource();
            gridView1.ExpandAllGroups();
        }
Exemplo n.º 8
0
        private void AddProject(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "projects.add"))
            {
                return;
            }

            try
            {
                using (var db = new DatabaseContext())
                {
                    var MPorject = Package.Unpacking <Project>(ClientResponse.DataBytes);
                    MPorject.UserId = Users.GetUserById(NetworkClient.Id).Id;

                    db.Projects.Attach(MPorject);
                    db.SaveChanges();

                    if (AccessController.IsPrivilege(NetworkClient, "edit_project"))
                    {
                        Sender.Broadcast("Project.Add.Confirm", MPorject);
                    }
                }
            }
            catch (DbException ex)
            {
            }
        }
Exemplo n.º 9
0
        private void GetTeamUsers(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "teams"))
            {
                return;
            }

            try
            {
                using (var db = new DatabaseContext())
                {
                    var UsersDb = db.Users.ToArray();

                    Debug.Log($"Получен список пользователей из базы данных в количестве {UsersDb.Length} записей.", ConsoleColor.Magenta);

                    var TGroup      = Package.Unpacking <TeamGroup>(ClientResponse.DataBytes);
                    var TeamUsersDb = db.TeamUsers.Where(t => t.TeamGroupId == TGroup.Id).ToArray();

                    Debug.Log($"Получен список команд и пользователей из базы данных в количестве {TeamUsersDb.Length} записей.", ConsoleColor.Magenta);

                    Sender.Send(NetworkClient, "TeamUser.Get",
                                DbConvertToWpf.ConvertTeamUserCompilation(UsersDb, TeamUsersDb), ClientResponse.WindowUid);
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникла ошибка при получении списка пользователей из базы данных! Код ошибки:\n" + ex);

                Sender.Send(NetworkClient, "TeamUser.Get.Error");
            }
        }
Exemplo n.º 10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private Object readResolve() throws ReflectiveOperationException
        private Object ReadResolve()
        {
            try
            {
                Method deserialize = AccessController.doPrivileged(new PrivilegedExceptionActionAnonymousInnerClassHelper(this));

                return(deserialize.invoke(null, this));
            }
            catch (PrivilegedActionException e)
            {
                Exception cause = e.Exception;
                if (cause is ReflectiveOperationException)
                {
                    throw (ReflectiveOperationException)cause;
                }
                else if (cause is RuntimeException)
                {
                    throw (RuntimeException)cause;
                }
                else
                {
                    throw new RuntimeException("Exception in SerializedLambda.readResolve", e);
                }
            }
        }
        protected void LoadData(string key)
        {
            List <EmpSalaryStep> list = EmpSalaryStep.GetAll();

            //根据权限过滤
            list = list.FindAll(a => AccessController.CheckPayGroup(a.薪资组) && AccessController.CheckGrade(a.薪等标识));
            list = list.OrderBy(a => a.员工信息.员工序号).ToList();
            if (string.IsNullOrEmpty(key) == false)
            {
                list = list.FindAll(a => a.姓名.Contains(key));
            }
            //如果不显示历史记录
            if (chk显示历史记录.Checked == false)
            {
                List <EmpSalaryStep> tempList = new List <EmpSalaryStep>();
                foreach (EmpSalaryStep item in list)
                {
                    EmpSalaryStep effectiveItem = EmpSalaryStep.GetEffective(item.员工编号, DateTime.Today);
                    if (effectiveItem != null && effectiveItem.标识 == item.标识)
                    {
                        tempList.Add(item);
                    }
                }
                list = tempList;
            }
            gridControl1.DataSource = list;
            gridControl1.RefreshDataSource();
            gridView1.ExpandAllGroups();
        }
Exemplo n.º 12
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //清除原来的数据
            currRows.Clear();
            currSalaryGrade = null;
            if (e.Node.Tag != null)
            {
                currSalaryGrade = e.Node.Tag as SalaryNode;

                if (AccessController.CheckGrade(currSalaryGrade.标识))
                {
                    //创建当前薪等下的所有薪级的录入记录
                    currRows = StepPayRate.GetAll().FindAll(a => a.薪等标识 == currSalaryGrade.标识);
                    if (currRows.Count > 0)
                    {
                        StepPayRate step = currRows[0];
                        lbl设定时间.Text = step.设定时间.ToString("yyyy/M/d");
                        lbl执行时间.Text = step.执行日期.ToString("yyyy/M/d");
                    }
                }
                else
                {
                    MessageBox.Show("你没有权限浏览该薪等的职级工资标准。");
                }
            }
            gridControl1.DataSource = currRows;
            gridControl1.RefreshDataSource();
        }
        static InnerClassLambdaMetafactory()
        {
            const String key  = "jdk.internal.lambda.dumpProxyClasses";
            String       path = AccessController.DoPrivileged(new GetPropertyAction(key), null, new PropertyPermission(key, "read"));

            Dumper = (null == path) ? null : ProxyClassesDumper.GetInstance(path);
        }
Exemplo n.º 14
0
        public static ProxyClassesDumper GetInstance(String path)
        {
            if (null == path)
            {
                return(null);
            }
            try
            {
                path = path.Trim();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.nio.file.Path dir = java.nio.file.Paths.get(path.length() == 0 ? "." : path);
                Path dir = Paths.Get(path.Length() == 0 ? "." : path);
                AccessController.DoPrivileged(new PrivilegedActionAnonymousInnerClassHelper(dir), null, new FilePermission("<<ALL FILES>>", "read, write"));
                return(new ProxyClassesDumper(dir));
            }
            catch (InvalidPathException ex)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                PlatformLogger.getLogger(typeof(ProxyClassesDumper).FullName).warning("Path " + path + " is not valid - dumping disabled", ex);
            }
            catch (IllegalArgumentException iae)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                PlatformLogger.getLogger(typeof(ProxyClassesDumper).FullName).warning(iae.Message + " - dumping disabled");
            }
            return(null);
        }
Exemplo n.º 15
0
        private void WebRequestDirSaver(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "requests.add"))
            {
                return;
            }

            var WebRequestDirItem = Package.Unpacking <WebRequestDir>(ClientResponse.DataBytes);

            using (var db = new DatabaseContext())
            {
                db.Attach(WebRequestDirItem);
                db.SaveChanges();

                Sender.Broadcast("WebRequestDir.Save.Confirm", WebRequestDirItem, ClientResponse.WindowUid);

                WebRequestItem WebRequestItem =
                    db.WebRequestItems.FirstOrDefault(x => x.Id == WebRequestDirItem.WebRequestItemId);

                MBinding_WebRequest MBinding = new MBinding_WebRequest();
                MBinding.Item      = WebRequestItem;
                MBinding.Params    = db.WebRequestParamsItems.Where(x => x.WebRequestItemId == WebRequestItem.Id).ToArray();
                MBinding.Directory = WebRequestDirItem;

                Sender.Broadcast("WebRequestItem.MBinding_WebRequest.Add", MBinding);
            }
        }
Exemplo n.º 16
0
        private void GetTeamProjects(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "projects"))
            {
                return;
            }

            try
            {
                using (var db = new DatabaseContext())
                {
                    var TeamGroups = db.TeamGroups.ToArray();

                    Debug.Log($"Получен список команд из базы данных в количестве {TeamGroups.Length} записей.", ConsoleColor.Magenta);

                    var MProject   = Package.Unpacking <Project>(ClientResponse.DataBytes);
                    var DbProjects = db.TeamProjects.Where(t => t.ProjectId == MProject.Id).ToArray();

                    Debug.Log($"Получен список проектов и команд из базы данных в количестве {DbProjects.Length} записей.", ConsoleColor.Magenta);

                    Sender.Send(NetworkClient, "TeamProject.Get",
                                DbConvertToWpf.ConvertTeamProjectCompilation(TeamGroups, DbProjects), ClientResponse.WindowUid);
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникла ошибка при получении списка проектов и команд из базы данных! Код ошибки:\n" + ex);

                Sender.Send(NetworkClient, "TeamProject.Get.Error");
            }
        }
Exemplo n.º 17
0
        private void WebRequestBindingGet(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "requests"))
            {
                return;
            }

            int ProjectId = Package.Unpacking <int>(ClientResponse.DataBytes);

            using (var db = new DatabaseContext())
            {
                List <MBinding_WebRequest> MB_WebRequests = new List <MBinding_WebRequest>();

                WebRequestItem[] WebRequestItems =
                    db.WebRequestItems.Where(x => x.ProjectId == ProjectId).ToArray();

                foreach (var RequestItem in WebRequestItems)
                {
                    MBinding_WebRequest ListItem = new MBinding_WebRequest();
                    ListItem.Item      = RequestItem;
                    ListItem.Params    = db.WebRequestParamsItems.Where(x => x.WebRequestItemId == RequestItem.Id).ToArray();
                    ListItem.Directory = db.WebRequestDirs.FirstOrDefault(x => x.WebRequestItemId == RequestItem.Id);

                    MB_WebRequests.Add(ListItem);
                }

                Sender.Send(NetworkClient, "WebRequestItem.MBinding_WebRequest.Get",
                            MB_WebRequests.ToArray(), ClientResponse.WindowUid);
            }
        }
Exemplo n.º 18
0
        private void AccessGetAll(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "users.access"))
            {
                return;
            }

            try
            {
                int UserId = Package.Unpacking <int>(ClientResponse.DataBytes);

                using (var db = new DatabaseContext())
                {
                    var DbUserPrivileges = db.UserPrivileges.Where(x => x.UserId == UserId).ToArray();

                    Debug.Log($"Получен список прав доступа в количестве {DbUserPrivileges.Length} записей.", ConsoleColor.Magenta);

                    Sender.Send(NetworkClient, "User.Access.GetAll.Confirm",
                                DbUserPrivileges, ClientResponse.WindowUid);
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникло исключение при получении списка прав доступа. Код ошибки:\n" + ex);
                Sender.Send(NetworkClient, "User.Access.GetAll.Error");
            }
        }
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            PersonReimbursementInput row = gridView1.GetRow(e.RowHandle) as PersonReimbursementInput;

            if (row != null)
            {
                if (e.Column.FieldName == "员工编号")
                {
                    EmployeeInfo pInfo = EmployeeInfo.GetEmployeeInfo(row.员工编号);
                    if (pInfo == null)
                    {
                        throw new Exception("找不到指定编号的员工");
                    }
                    else
                    {
                        if (AccessController.CheckPayGroup(pInfo.薪资组))
                        {
                            row.姓名 = pInfo.姓名;
                            gridControl1.RefreshDataSource();
                        }
                        else
                        {
                            throw new Exception("您没有权限录入这个员工的报销标准");
                        }
                    }
                }
                row.GetModifiyFields();
            }
        }
Exemplo n.º 20
0
        private void ChatMessagesGetAll(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "projects.chat"))
            {
                return;
            }

            try
            {
                int ProjectId = Package.Unpacking <int>(ClientResponse.DataBytes);

                using (var db = new DatabaseContext())
                {
                    Chat[] ChatMessages = db.Chats.Where(x => x.ProjectId == ProjectId).ToArray();

                    if (ChatMessages.Length != 0)
                    {
                        List <ModelChatMessage> mChatMessages = new List <ModelChatMessage>();

                        foreach (var Message in ChatMessages)
                        {
                            mChatMessages.Add(GetModelMessage(db, Message));
                        }

                        Sender.Send(NetworkClient, "Chat.Messages.GetAll.Confirm", mChatMessages.ToArray());
                    }
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникло исключение при получении списка сообщений. Код ошибки:\n" + ex);

                Sender.Send(NetworkClient, "Chat.Messages.GetAll.Error");
            }
        }
Exemplo n.º 21
0
        private void UsersGetAll(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "users"))
            {
                return;
            }

            try
            {
                using (var db = new DatabaseContext())
                {
                    var DbUsers = db.Users.ToArray();
                    var WUsers  = DbConvertToWpf.ConvertUser(DbUsers);

                    if (AccessController.IsPrivilege(NetworkClient, "users"))
                    {
                        Sender.Send(NetworkClient, "Users.GetAll.Confirm", WUsers);
                    }
                }
            }
            catch (DbException ex)
            {
                Debug.LogError("Возникло исключение при получении списка пользователей. Код ошибки:\n" + ex);
                Sender.Send(NetworkClient, "Users.GetAll.Error");
            }
        }
        void Init()
        {
            myPayGroupList.Clear();
            myCalRunList.Clear();

            DateTime end   = DateTime.Today;
            DateTime start = end.AddMonths(-MyHelper.LatestMonths); //最近三个月

            foreach (CalRunInfo cal in CalRunInfo.GetList(start, end))
            {
                foreach (string groupId in cal.薪资组列表)
                {
                    bool enabled = AccessController.CheckPayGroup(groupId);
                    if (enabled)
                    {
                        PayGroup pg = PayGroup.Get(groupId);
                        if (pg != null)
                        {
                            if (myPayGroupList.Find(a => a.英文名 == pg.英文名) == null)
                            {
                                myPayGroupList.Add(pg);
                            }
                            if (myCalRunList.Find(a => a.日历组编号 == cal.日历组编号) == null)
                            {
                                myCalRunList.Add(cal);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 23
0
 public static bool Do(Player p, string[] args, int offset, bool max,
                       AccessController access, CommandData data, Level lvl)
 {
     for (int i = offset; i < args.Length; i++)
     {
         string arg = args[i];
         if (arg[0] == '+' || arg[0] == '-')
         {
             if (!SetList(p, arg, access, data, lvl))
             {
                 return(false);
             }
         }
         else if (max)
         {
             Group grp = Matcher.FindRanks(p, arg);
             if (grp == null)
             {
                 return(false);
             }
             access.SetMax(p, data.Rank, lvl, grp);
         }
         else
         {
             Group grp = Matcher.FindRanks(p, arg);
             if (grp == null)
             {
                 return(false);
             }
             access.SetMin(p, data.Rank, lvl, grp);
         }
     }
     return(true);
 }
        private void WebRequestParamsUpdate(MResponse ClientResponse, MNetworkClient NetworkClient)
        {
            if (!AccessController.IsPrivilege(NetworkClient, "requests.edit"))
            {
                return;
            }

            try
            {
                var RequestParamsItems = Package.Unpacking <MBinding_WebRequestSaver>(ClientResponse.DataBytes);

                using (var db = new DatabaseContext())
                {
                    var DbRequestParamsItems = new List <WebRequestParamsItem>();

                    foreach (var RequestParamsItem in RequestParamsItems.Params)
                    {
                        WebRequestParamsItem DbRequestParam = db.WebRequestParamsItems.FirstOrDefault
                                                                  (x => x.Id == RequestParamsItem.Id);

                        if (DbRequestParam != null)
                        {
                            DbRequestParam.Key         = RequestParamsItem.Key;
                            DbRequestParam.Value       = RequestParamsItem.Value;
                            DbRequestParam.Description = RequestParamsItem.Description;
                            db.SaveChanges();
                            DbRequestParamsItems.Add(DbRequestParam);
                        }
                        else
                        {
                            //if (db.WebRequestParamsItems.FirstOrDefault(x => x.Key == RequestParamsItem.Key) == null)
                            //{
                            DbRequestParam                  = RequestParamsItem;
                            DbRequestParam.Key              = (DbRequestParam.Key != null) ? DbRequestParam.Key : "";
                            DbRequestParam.Value            = (DbRequestParam.Value != null) ? DbRequestParam.Value : "";
                            DbRequestParam.Description      = (DbRequestParam.Description != null) ? DbRequestParam.Description : "";
                            DbRequestParam.WebRequestItemId = RequestParamsItems.Item.Id;

                            if (DbRequestParam.Key.Trim() != string.Empty || DbRequestParam.Value.Trim() != string.Empty)
                            {
                                db.WebRequestParamsItems.Add(DbRequestParam);
                                db.SaveChanges();
                                DbRequestParamsItems.Add(DbRequestParam);
                            }
                            //}
                        }
                    }

                    if (DbRequestParamsItems.Count != 0)
                    {
                        Sender.Broadcast("WebRequestParamsItem.Update.Confirm", DbRequestParamsItems.ToArray());
                    }
                }
            }
            catch (DbException ex)
            {
                Sender.Send(NetworkClient, "WebRequestParamsItem.Update.Error");
            }
        }
Exemplo n.º 25
0
        public void ReferencesToProjectManagerOK()
        {
            myProjectManager.Controller.AccessController theAccesController = new AccessController();

            //Assert.IsNotNull(theAccesController, "Instance Error : Couldn't create instance of AccessController Class.");

            //Assert.Pass();
        }
Exemplo n.º 26
0
            // returns default file system
            internal static FileSystem DefaultFileSystem()
            {
                // load default provider
                FileSystemProvider provider = AccessController.doPrivileged(new PrivilegedActionAnonymousInnerClassHelper());

                // return file system
                return(provider.GetFileSystem(URI.Create("file:///")));
            }
Exemplo n.º 27
0
        public void CanExit()
        {
            // Arrange
            AccessController controller = new AccessController();

            // Act
            controller.CanExit("H647KPE", AccessDeviceType.LicensePlate, 1);
        }
Exemplo n.º 28
0
        public void Block(Feature feature, AccessController controller)
        {
            if (!m_accessPermissions.ContainsKey(feature))
            {
                m_accessPermissions[feature] = new HashSet <AccessController>();
            }

            m_accessPermissions[feature].Add(controller);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Finds the resource with the specified name on the URL search path.
        /// </summary>
        /// <param name="name"> the name of the resource </param>
        /// <returns> a {@code URL} for the resource, or {@code null}
        /// if the resource could not be found, or if the loader is closed. </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public URL findResource(final String name)
        public override URL FindResource(String name)
        {
            /*
             * The same restriction to finding classes applies to resources
             */
            URL url = AccessController.doPrivileged(new PrivilegedActionAnonymousInnerClassHelper(this, name), Acc);

            return(url != null?Ucp.checkURL(url) : null);
        }
Exemplo n.º 30
0
 protected void LoadData()
 {
     //清除原来的数据
     currInputRows           = ReimbursementStandardInput.GetEditingRows(this.是验证录入);
     currInputRows           = currInputRows.FindAll(a => a.员工信息 != null && AccessController.CheckPayGroup(a.员工信息.薪资组));
     currInputRows           = currInputRows.OrderBy(a => a.编号).ToList();
     gridControl1.DataSource = currInputRows;
     gridControl1.RefreshDataSource();
 }
Exemplo n.º 31
0
	    public void setAccessController(AccessController accessController) {
		    this.accessController = accessController;
	    }