public override void Process()
        {
            Remoting.SaveSingle rem;

            if (string.IsNullOrEmpty(_user.Rev))
            {
                TriggerOnActionChanged(EngineActionType.CreatingGroup, true);
            }
            else
            {
                TriggerOnActionChanged(EngineActionType.ModifyingGroup, true);
            }

            try
            {
                Transitions.User txUser = new Transitions.User();
                rem = new Remoting.SaveSingle(_db, txUser.Transition(_user), _sendTimeout, _receiveTimeout,
                                              _sendBufferSize, _receiveBufferSize);
            }
            catch (Exception e)
            {
                Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.SaveSingle object.", e);
                throw;
            }

            rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply)
            {
                if (!((Commands.PutDocumentReply)reply).Ok)
                {
                    User = null;
                }
                else
                {
                    User = new Security.User(_user.Id, ((Commands.PutDocumentReply)reply).Rev,
                                             null, _user.FirstName, _user.MiddleName, _user.LastName, _user.Groups,
                                             _user.IsSuperuser);
                    User.SetEncryptedPassword(_user.Password);
                }
                TriggerOnComplete(reply);
            };
            rem.OnError += delegate(Remoting.Base sender, string message, Exception exception)
            {
                TriggerOnError(message, exception);
            };
            rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
            {
                TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete);
            };
            rem.OnTimeout += delegate(Remoting.Base sender)
            {
                TriggerOnTimeout();
            };

            rem.Process();
        }
示例#2
0
        public override void Process()
        {
            Remoting.SaveSingle rem;

            if (string.IsNullOrEmpty(_user.Rev))
                TriggerOnActionChanged(EngineActionType.CreatingGroup, true);
            else
                TriggerOnActionChanged(EngineActionType.ModifyingGroup, true);

            try
            {
                Transitions.User txUser = new Transitions.User();
                rem = new Remoting.SaveSingle(_db, txUser.Transition(_user), _sendTimeout, _receiveTimeout,
                    _sendBufferSize, _receiveBufferSize);
            }
            catch (Exception e)
            {
                Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.SaveSingle object.", e);
                throw;
            }

            rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply)
            {
                if (!((Commands.PutDocumentReply)reply).Ok)
                    User = null;
                else
                {
                    User = new Security.User(_user.Id, ((Commands.PutDocumentReply)reply).Rev,
                        null, _user.FirstName, _user.MiddleName, _user.LastName, _user.Groups,
                        _user.IsSuperuser);
                    User.SetEncryptedPassword(_user.Password);
                }
                TriggerOnComplete(reply);
            };
            rem.OnError += delegate(Remoting.Base sender, string message, Exception exception)
            {
                TriggerOnError(message, exception);
            };
            rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
            {
                TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete);
            };
            rem.OnTimeout += delegate(Remoting.Base sender)
            {
                TriggerOnTimeout();
            };

            rem.Process();
        }
示例#3
0
        public override void Process()
        {
            Remoting.Get rem;

            TriggerOnActionChanged(EngineActionType.GettingUser, true);

            try
            {
                rem = new Remoting.Get(_db, _user.Id, _sendTimeout, _receiveTimeout,
                                       _sendBufferSize, _receiveBufferSize);
            }
            catch (Exception e)
            {
                Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.Get object.", e);
                throw;
            }

            rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply)
            {
                Transitions.User txUser = new Transitions.User();
                User = txUser.Transition(((Remoting.Get)sender).Document);
                TriggerOnComplete(reply);
            };
            rem.OnError += delegate(Remoting.Base sender, string message, Exception exception)
            {
                TriggerOnError(message, exception);
            };
            rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
            {
                TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete);
            };
            rem.OnTimeout += delegate(Remoting.Base sender)
            {
                TriggerOnTimeout();
            };

            rem.Process();
        }
示例#4
0
        public override void Process()
        {
            Remoting.Get rem;

            TriggerOnActionChanged(EngineActionType.GettingUser, true);

            try
            {
                rem = new Remoting.Get(_db, _user.Id, _sendTimeout, _receiveTimeout,
                    _sendBufferSize, _receiveBufferSize);
            }
            catch (Exception e)
            {
                Logger.Storage.Error("An exception occurred while instantiating the Transactions.Tasks.Remoting.Get object.", e);
                throw;
            }

            rem.OnComplete += delegate(Remoting.Base sender, ICommandReply reply)
            {
                Transitions.User txUser = new Transitions.User();
                User = txUser.Transition(((Remoting.Get)sender).Document);
                TriggerOnComplete(reply);
            };
            rem.OnError += delegate(Remoting.Base sender, string message, Exception exception)
            {
                TriggerOnError(message, exception);
            };
            rem.OnProgress += delegate(Remoting.Base sender, OpenDMS.Networking.Protocols.Tcp.DirectionType direction, int packetSize, decimal sendPercentComplete, decimal receivePercentComplete)
            {
                TriggerOnProgress(direction, packetSize, sendPercentComplete, receivePercentComplete);
            };
            rem.OnTimeout += delegate(Remoting.Base sender)
            {
                TriggerOnTimeout();
            };

            rem.Process();
        }