Exemple #1
0
        protected void signUpButton_Click(object sender, EventArgs e)
        {
            membEmail        = txtMembEmail.Text;
            membPassword     = txtMembPassword.Text;
            membFirstName    = txtMembFirstName.Text;
            membLastName     = txtMembLastName.Text;
            membOrganization = HFmemb_id.Value;

            membType = (memb_id.Length == 8 && memb_id.Substring(0, 2) == "50") ? "E" : ""; /* put "E" if employee */
            //if (memb_id == "00656068") membType = "E"; /* for testing the VUBIZ member ID will be set to Employee */

            isValidTicket = "true";
            vubizOk       = true;

            if (isValidTicket == "true" && vubizOk)
            {
                // will insert/update if the user is on file and custId is valid - return "ok"
                JSON = v8server.cfibEnroll(custId, membEmail, membPassword, membFirstName, membLastName, membOrganization, membType);
                CfibEnroll cfibEnroll = serializer.Deserialize <CfibEnroll>(JSON);

                if (cfibEnroll.msgId != "ok")
                {
                    Literal.Text = tran("An Account has either been created with this email address (user name) or by another member of your organization.", lang);
                }
                else
                {
                    Literal.Text = tran("Your account has been created.", lang);

                    WScustGuid.Text = cfibEnroll.custGuid;
                    WSmembGuid.Text = cfibEnroll.membGuid;

                    HFmembGuid.Value  = cfibEnroll.membGuid;
                    HFlaunchUrl.Value = "Default.aspx?appId=vubiz.8&profile=" + profile + "&membGuid=" + cfibEnroll.membGuid;
                    launchUrl.Text    = HFlaunchUrl.Value;

                    string url = "Default.aspx?appId=vubiz.8&profile=" + profile + "&membGuid=" + cfibEnroll.membGuid;

                    Response.Redirect(url, true);
                };
            }
            ;
        }
Exemple #2
0
        protected void register_Click(object sender, EventArgs e)
        {
            if (
                txtCfibId.Text.Length < 1 ||

                txtCompanyName.Text.Length < 1 ||
                txtCmpanyPhoneNumber.Text.Length < 1 ||
                txtCompanyPostalCode.Text.Length < 1 ||

                txtMembEmail1.Text.Length < 1 ||
                txtMembPassword1.Text.Length < 1 ||
                txtMembFirstName.Text.Length < 1 ||
                txtMembLastName.Text.Length < 1)
            {
                panStatus.Visible = true;
                vubizOk           = false;
                litError.Text     = tran("Oops!<br />One or more fields have not been filled in.", lang) + "<br /><span style='font-size:smaller'>(Register Form)</span>";

                //Control starter = FindControl("txtCfibId");
                //starter.Focus();
                //        Response.Redirect("Credentials.aspx?section=registerSection", true);
            }

            if (vubizOk)
            {
                membOrganization = function.right("00000000" + txtCfibId.Text, 8);
                membEmail        = txtMembEmail1.Text;
                membPassword     = txtMembPassword1.Text;
                membFirstName    = txtMembFirstName.Text;
                membLastName     = txtMembLastName.Text;
                membType         = (membOrganization.Length == 8 && membOrganization.Substring(0, 2) == "50") ? "E" : ""; /* put "E" if employee */

                membMemo = txtCompanyName.Text + "|" + txtCmpanyPhoneNumber.Text + "|" + txtCompanyPostalCode.Text;


                // confirm there is no cfib Member already registered
                JSON = v8server.cfibIsMember(custId, membOrganization, membEmail);
                Status status = serializer.Deserialize <Status>(JSON);
                string err    = status.trueFalse.Substring(0, 3); // "org_asfdalsdkjalsdkfjalsdfjf" or "mai_lakjlkjlkjlj;lj"
                string msg    = status.trueFalse.Substring(4);

                if (status.trueFalse != "False")
                {
                    panStatus.Visible = true;
                    vubizOk           = false;
                    if (err == "org")
                    {
                        litError.Text = tran("Oops!<br />An account has already been set up for your organization by ", lang) + msg + ".";
                    }
                    if (err == "ema")
                    {
                        litError.Text = tran("Oops!<br />An account has already been set up for your organization with that email address by ", lang) + msg + ".";
                    }
                }
            }

            if (vubizOk)
            {
                // will insert/update if the user is on file and custId is valid - return "ok"
                // note: as of Jul 19, 2018, most of the editting was done in the previous step
                // Aug 21, 2019 added membMemo
                JSON = v8server.cfibEnroll(custId, membEmail, membPassword, membFirstName, membLastName, membOrganization, membType, membMemo);
                CfibEnroll cfibEnroll = serializer.Deserialize <CfibEnroll>(JSON);
                membGuid = cfibEnroll.membGuid;

                if (cfibEnroll.msgId != "ok")
                {
                    panStatus.Visible = true;
                    vubizOk           = false;
                    litError.Text     = tran("Oops!<br />An Account has either been created with this email address (unique identifier) or by another member of your organization.", lang);
                }
                else
                {
                    string url = "Default.aspx?appId=vubiz.8&profile=" + profile + "&membGuid=" + membGuid;
                    Response.Redirect(url, true);
                };
            }
            ;
        }