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); }
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; }
public static Guid GetId(ConfirmationData data) { var id = Guid.NewGuid(); data.CreationDate = DateTime.Now; _dict.Add(id, data); return id; }
public static Guid GetId(ConfirmationData data) { var id = Guid.NewGuid(); data.CreationDate = DateTime.Now; _dict.Add(id, data); return(id); }
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); }