예제 #1
0
        public static ConfirmationData GetData(Guid id)
        {
            if (!_dict.ContainsKey(id))
            {
                throw new BusinessLogicException("Данные устарели, вернитесь и обновите страницу");
            }

            var data = _dict[id];

            if (!data.IsUsed)
            {
                var newData = new ConfirmationData
                {
                    ActionUrl    = data.ActionUrl,
                    CreationDate = data.CreationDate,
                    IsUsed       = true,
                    Message      = data.Message,
                    PostData     = data.PostData,
                    ReturnUrl    = data.ReturnUrl
                };

                _dict.Remove(id);
                _dict.Add(id, newData);
            }

            return(data);
        }
예제 #2
0
        public static ConfirmationData GetData(Guid id)
        {
            if (!_dict.ContainsKey(id))
                throw new BusinessLogicException("Данные устарели, вернитесь и обновите страницу");

            var data = _dict[id];

            if (!data.IsUsed)
            {
                var newData = new ConfirmationData
                {
                    ActionUrl = data.ActionUrl,
                    CreationDate = data.CreationDate,
                    IsUsed = true,
                    Message = data.Message,
                    PostData = data.PostData,
                    ReturnUrl = data.ReturnUrl
                };

                _dict.Remove(id);
                _dict.Add(id, newData);
            }

            return data;
        }
예제 #3
0
        public static Guid GetId(ConfirmationData data)
        {
            var id = Guid.NewGuid();
            data.CreationDate = DateTime.Now;
            _dict.Add(id, data);

            return id;
        }
예제 #4
0
        public static Guid GetId(ConfirmationData data)
        {
            var id = Guid.NewGuid();

            data.CreationDate = DateTime.Now;
            _dict.Add(id, data);

            return(id);
        }
예제 #5
0
        public static void SetReturnUrl(Guid id, string returnUrl)
        {
            var data    = _dict[id];
            var newData = new ConfirmationData
            {
                ActionUrl    = data.ActionUrl,
                CreationDate = data.CreationDate,
                IsUsed       = data.IsUsed,
                Message      = data.Message,
                PostData     = data.PostData,
                ReturnUrl    = returnUrl
            };

            _dict.Remove(id);
            _dict.Add(id, newData);
        }
예제 #6
0
        public static void SetReturnUrl(Guid id, string returnUrl)
        {
            var data = _dict[id];
            var newData = new ConfirmationData
            {
                ActionUrl = data.ActionUrl,
                CreationDate = data.CreationDate,
                IsUsed = data.IsUsed,
                Message = data.Message,
                PostData = data.PostData,
                ReturnUrl = returnUrl
            };

            _dict.Remove(id);
            _dict.Add(id, newData);
        }