/// <summary> /// Конструктор используется только при восстановлении из хранилища /// </summary> internal Confirmation( string id, string userId, string key, ConfirmationState state, DateTime creationTime) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentException("Not set", nameof(id)); } if (string.IsNullOrWhiteSpace(userId)) { throw new ArgumentException("Not set", nameof(userId)); } if (string.IsNullOrWhiteSpace(key)) { throw new ArgumentException("Not set", nameof(key)); } if (creationTime == default(DateTime)) { throw new ArgumentException("Not set", nameof(creationTime)); } Id = id; UserId = userId; Key = key; CreationTime = creationTime; State = state; }
public ActionResult ConfirmEmail(string userId, string code) { ConfirmationState cs = UserService.IsConfirmationOk(userId, code); if (cs != ConfirmationState.OK) { if (cs == ConfirmationState.DataKO) { ViewBag.errorMessage = Resources.AccountConfirmLinkFailed; ViewBag.buttonFailedLinkFlag = true; } else if (cs == ConfirmationState.Outdated) { ViewBag.errorMessage = Resources.AccountConfirmLinkOutdated; ViewBag.buttonFailedLinkFlag = true; } else if (cs == ConfirmationState.ConnectionProblem) { ViewBag.errorMessage = Resources.AccountConfirmLinkOutofConnection; } return(View("Error")); } SetString(Resources.ConfirmEmailOKFlag, "OK"); return(View("ConfirmEmail")); }
private void SendNotificationToStudent(int confirmationId, ConfirmationState state) { var confirmation = _teacherConfirmationRepository.GetTeacherAndOrganizerByConfirmationId(confirmationId); var teacherName = $"{confirmation.Teacher.FirstName} {confirmation.Teacher.LastName}"; var studentEmail = confirmation.Application.Organizer.Email; _notificationService.SendTeacherConfirmationToStudent(teacherName, studentEmail, state); }
public TeacherConfirmation UpdateTeacherConfirmation(int id, ConfirmationState newState) { var confirmation = _context.TeacherConfirmations.FirstOrDefault(x => x.Id == id); if (confirmation == null) { return(null); } confirmation.State = newState; _context.SaveChanges(); return(confirmation); }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } view = transform.GetChild(0).gameObject; confirmationState = ConfirmationState.Buy; }
private void setState(ConfirmationState newState) { switch (newState) { case ConfirmationState.Pending: PurchasePanel.SetActive(value: true); SuccessPanel.SetActive(value: false); break; case ConfirmationState.Complete: PurchasePanel.SetActive(value: false); SuccessPanel.SetActive(value: true); break; } currentState = newState; }
private IEnumerator tweenIconToTray() { currentState = ConfirmationState.Animating; DisneyStoreTrayAnimator animator = storeController.GetTrayAnimator(); RewardCategory category = DisneyStoreUtils.GetItemRewardCategory(item); Transform tweenDestination = animator.MyPenguinDestination; if (category == RewardCategory.consumables) { tweenDestination = animator.ToyboxDestination; } animator.TweenToTray(tweenDestination, IconImage.transform); yield return(new WaitForSeconds(animator.TweenTime)); storeFranchise.HideConfirmation(); yield return(null); }
public void InitiateBuyConfirmation(Item getItem) { confirmationState = ConfirmationState.Buy; inventoryQty.SetActive(true); inventoryBoxQty.SetActive(false); item = getItem; itemImage.sprite = item.itemImage; itemName.text = item.itemName; curQty = 0; setQty = 1; setMaxQty = 1; maxQty = item.maxQuantityOnInventory; maxQuantity.text = "/" + maxQty.ToString(); prc = item.price; for (int i = 0; i < PlayerData.instance.inventoryItem.Count; i++) { if (PlayerData.instance.inventoryItem[i].id == item.id) { curQty = PlayerData.instance.inventoryItem[i].quantity; break; } } curGold = PlayerData.instance.gold; cGold.text = curGold.ToString(); setMaxQty = maxQty - curQty; if (setMaxQty > (curGold / prc)) { setMaxQty = curGold / prc; } curQuantity.text = curQty.ToString(); RefreshText(); SetSliderState(); }
public void InitiateSellConfirmation(Item getItem) { confirmationState = ConfirmationState.Sell; }
private string CreateMessageForStudent(string teacherName, ConfirmationState state) { return ($"<center>Prowadzacy <b>{teacherName}</b> podjął decyzję odnośnie prowadzenia kursu poprawkowego.<br/>" + $"Twoje podanie zostało <b>{state.ToString()}</b>."); }
public void SendTeacherConfirmationToStudent(string senderName, string receiverEmail, ConfirmationState state) { var htmlMessage = CreateMessageForStudent(senderName, state); var message = CreatePostMarkMessage(receiverEmail, htmlMessage); _postmarkClient.SendMessage(message); }
/// <summary> /// Подтверждение пользователя. Если уже подтвержден, бросает <see cref="AlreadyConfirmedException"/>. /// </summary> public void Confirm() { State = ConfirmationState.Confirmed; }