Esempio n. 1
0
 public ValueOfList(int id, String name, String friendlyName, string language, OptIn optIn)
 {
     _id           = id;
     _friendlyName = friendlyName;
     _language     = language;
     _optInList    = optIn;
     _name         = name;
 }
Esempio n. 2
0
        public async Task <IActionResult> OptIn([FromBody] OptIn optIn, [FromHeader] string authorization)
        {
            var result = await service.OptIn(optIn, authorization);

            if (result)
            {
                return(Created("OptIn", null));
            }

            return(BadRequest());
        }
        public ActionResult Register(string name, string email, string facebook, string qa1, string qa2, string qa3, string city, string zip)
        {
            //get name and email and create OptIn record in db
            using (DBEntities db = new DBEntities())
            {
                try
                {
                    //save data from opt-in
                    OptIn o = new OptIn();
                    o.EmailAddress = email;
                    o.Name         = name;
                    o.CreateDate   = DateTime.Now;
                    o.City         = city;
                    o.zip          = zip;
                    o.facebook     = facebook;

                    db.OptIn.Add(o);
                    db.SaveChanges();

                    //save answers in optin answers table
                    //q1
                    //OptInQAnswers newOAnswers = new OptInQAnswers();
                    //newOAnswers.OptInID = o.OptInID;
                    //newOAnswers.questionChoiceID = 0;

                    //db.OptInQAnswers.Add(newOAnswers);
                    //db.SaveChanges();

                    ////q2
                    //OptInQAnswers newOAnswers2 = new OptInQAnswers();
                    //newOAnswers2.OptInID = o.OptInID;
                    //newOAnswers2.questionChoiceID = 0;

                    //db.OptInQAnswers.Add(newOAnswers2);
                    //db.SaveChanges();

                    ////q3
                    //OptInQAnswers newOAnswers3 = new OptInQAnswers();
                    //newOAnswers3.OptInID = o.OptInID;
                    //newOAnswers3.questionChoiceID = 0;

                    //db.OptInQAnswers.Add(newOAnswers3);
                    //db.SaveChanges();

                    //save as session object
                    Session["optin"] = o;
                }
                catch (Exception)
                {
                }
            }

            return(View());
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (HasOptIn)
            {
                hash ^= OptIn.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 5
0
        public async Task <bool> OptIn(OptIn optIn, string authorization)
        {
            const string safraUrl = "https://af3tqle6wgdocsdirzlfrq7w5m.apigateway.sa-saopaulo-1.oci.customer-oci.com/fiap-sandbox/accounts/v1/optin";

            var headers = new Dictionary <string, string>()
            {
                { "Authorization", authorization }
            };

            var json = JsonSerializer.Serialize <OptIn>(optIn);

            var result = await httpService.ExecuteRequest(safraUrl, Method.POST, headers, json, "application/json");

            return(result.StatusCode == System.Net.HttpStatusCode.Created);
        }
        public ActionResult RegisterOpt(string email)
        {
            using (DBEntities db = new DBEntities())
            {
                try
                {
                    //save data from opt-in
                    OptIn o = new OptIn();
                    o.EmailAddress = email;
                    o.CreateDate   = DateTime.Now;

                    db.OptIn.Add(o);
                    db.SaveChanges();
                }
                catch (Exception)
                {
                }
            }
            //return Redirect("http://couplesdatingscene.com/stamp");
            return(Redirect("https://localhost:44300/Stamp/index.html?thx=" + email.ToString()));
        }