Exemplo n.º 1
0
    public void GetFormSendInfomation()
    {
        if (string.IsNullOrEmpty(txtName.text) || string.IsNullOrEmpty(txtage.text) || string.IsNullOrEmpty(txtPhone.text) ||
            string.IsNullOrEmpty(txtEmail.text))
        {
            PanelPopUp.intance.OnInitInforPopUp("Opps", "Check your input");
            return;
        }
        if (!IsValidEmail(txtEmail.text.Trim()))
        {
            {
                PanelPopUp.intance.OnInitInforPopUp("Opps", "Email không hợp lệ");
                return;
            }
        }

        frmSent = new FormSent();
        ReadTexture();
        frmSent.name     = txtName.text;
        frmSent.email    = txtEmail.text;
        frmSent.age      = int.Parse(txtage.text);
        frmSent.phone    = txtPhone.text;
        frmSent.timeplay = (int)controlQuest.timeRuning;
        Sent();
    }
Exemplo n.º 2
0
        /// <summary>
        /// Create a form instance (FormSent record)
        /// </summary>
        /// <param name="formId"></param>
        /// <returns></returns>
        public FormSent CreateFormSent(int formId)
        {
            var formSent = new FormSent
            {
                FormId          = formId,
                CreatorUserName = LoginData.SuperUserName,
                CreationDate    = DateTime.UtcNow,
                ForAppNo        = 1,
                IsExpired       = false,
                IsDeleted       = false
            };

            formSent.Id = (int)_readWriteData.Create(formSent, true);
            return(formSent);
        }
        /// <summary>
        /// Set up records needed for a formInbox notification
        /// </summary>
        public void CreateNotificationData()
        {
            _form                   = FormDataAccessor.CreateForm(string.Join(" ", Faker.Lorem.Words(3)));
            _formSent               = FormDataAccessor.CreateFormSent(_form.Id);
            _wfStepInstance         = WorkflowDataAccessor.CreateWorkflowStepInstance(_formSent.Id);
            _wfStepInstanceAssignee = WorkflowDataAccessor.CreateWorkflowStepInstanceAssignee(_wfStepInstance.Id, TargetUser);

            ExpectedResult = new NotificationResult()
            {
                Title     = _form.Title,
                PopupInfo = new NotificationPopupResult
                {
                    FrameId = "MainContentsIFrame",
                    Url     = $"EForm.aspx?src=admin&NoInstructions=1&ID={_formSent.Guid}",
                    Content = string.Empty //TODO: Resolve data setup gap that is generating server error
                }
            };

            ValidateNotificationExistsForFormSentId();
        }