public JsonResult EmailMeMyResults(string name, string email, string attitude, string action, string information, string processing, string endurance, string patterns, string presence, string compensation, string concentration) { AddresseeClient adc = new AddresseeClient(); LockedModeUserClient lmu = new LockedModeUserClient(); string emailpartition = AddresseeClient.GetPartitionKeyForEmail(email); Addressee a = adc.GetByPartitionAndRowKey(emailpartition, email); if (a == null) { adc.AddNewItem(new Addressee(email.ToLower()) { Name = name, Email = email.ToLower() }); } LockedModeUser user = lmu.GetByPartitionAndRowKey(emailpartition, email); if (user == null) { lmu.AddNewItem(new LockedModeUser { PartitionKey = emailpartition, RowKey = email.ToLower(), Name = name, Email = email.ToLower(), Referer = "general", Attitude = attitude == null ? "" : attitude, Action = action == null ? "" : action, Information = information == null ? "" : information, Processing = processing == null ? "" : processing, Endurance = endurance == null ? "" : endurance, Patterns = patterns == null ? "" : patterns, Presence = presence == null ? "" : presence, Compensation = compensation == null ? "" : compensation, Concentration = concentration == null ? "" : concentration }); } else { user.Attitude = attitude == null ? "" : attitude; user.Action = action == null ? "" : action; user.Information = information == null ? "" : information; user.Processing = processing == null ? "" : processing; user.Endurance = endurance == null ? "" : endurance; user.Patterns = patterns == null ? "" : patterns; user.Presence = presence == null ? "" : presence; user.Compensation = compensation == null ? "" : compensation; user.Concentration = concentration == null ? "" : concentration; lmu.Update(user); } sendResultEmail(name, email); return(new JsonResult { Data = new { result = "ok" } }); }
public JsonResult EmailMeMyResults(string name, string email) { AddresseeClient adc = new AddresseeClient(); LockedModeUserClient lmu = new LockedModeUserClient(); string emailpartition = AddresseeClient.GetPartitionKeyForEmail(email); Addressee a = adc.GetByPartitionAndRowKey(emailpartition, email); if (a == null) { adc.AddNewItem(new Addressee(email.ToLower()) { Name = name, Email = email.ToLower() }); } LockedModeUser user = lmu.GetByPartitionAndRowKey(emailpartition, email); if (user == null) { lmu.AddNewItem(new LockedModeUser { PartitionKey = emailpartition, RowKey = email.ToLower(), Name = name, Email = email.ToLower(), Referer = "lm", Attitude = Request.Cookies["attitude"] != null ? Request.Cookies["attitude"].Value : "", Action = Request.Cookies["action"] != null ? Request.Cookies["action"].Value : "", Information = Request.Cookies["information"] != null ? Request.Cookies["information"].Value : "", Processing = Request.Cookies["processing"] != null ? Request.Cookies["processing"].Value : "", Endurance = Request.Cookies["endurance"] != null ? Request.Cookies["endurance"].Value : "", Patterns = Request.Cookies["patterns"] != null ? Request.Cookies["patterns"].Value : "", Presence = Request.Cookies["presence"] != null ? Request.Cookies["presence"].Value : "", Compensation = Request.Cookies["compensation"] != null ? Request.Cookies["compensation"].Value : "", Concentration = Request.Cookies["concentration"] != null ? Request.Cookies["concentration"].Value : "" }); } sendResultEmail(name, email); return(new JsonResult { Data = new { result = "ok" } }); }
public JsonResult EmailMeMyInterestResults(string name, string email, int admiration, int adventure, int animals, int beauty, int competition, int coordinating, int creativity, int critical, int drafting, int duty, int handlabor, int helping, int machinery, int numbers, int people, int politics, int safety, int salesy, int science, int strength, int technology) { AddresseeClient adc = new AddresseeClient(); LockedModeUserClient lmu = new LockedModeUserClient(); string emailpartition = AddresseeClient.GetPartitionKeyForEmail(email); Addressee a = adc.GetByPartitionAndRowKey(emailpartition, email); if (a == null) { adc.AddNewItem(new Addressee(email.ToLower()) { Name = name, Email = email.ToLower() }); } LockedModeUser user = lmu.GetByPartitionAndRowKey(emailpartition, email); if (user == null) { lmu.AddNewItem(new LockedModeUser { PartitionKey = emailpartition, RowKey = email.ToLower(), Name = name, Email = email.ToLower(), Referer = "general", admiration = admiration, adventure = adventure, animals = animals, beauty = beauty, competition = competition, coordinating = coordinating, creativity = creativity, critical = critical, drafting = drafting, duty = duty, handlabor = handlabor, helping = helping, machinery = machinery, numbers = numbers, people = people, politics = politics, safety = safety, salesy = salesy, science = science, strength = strength, technology = technology }); } else { user.admiration = admiration; user.adventure = adventure; user.animals = animals; user.beauty = beauty; user.competition = competition; user.coordinating = coordinating; user.creativity = creativity; user.critical = critical; user.drafting = drafting; user.duty = duty; user.handlabor = handlabor; user.helping = helping; user.machinery = machinery; user.numbers = numbers; user.people = people; user.politics = politics; user.safety = safety; user.salesy = salesy; user.science = science; user.strength = strength; user.technology = technology; lmu.Update(user); } sendInterestResultEmail(name, email); return(new JsonResult { Data = new { result = "ok" } }); }
public ActionResult EmailResults(string name, string email, string phone, string interests, string selectedschool, string otherschools, string originpage) { AddresseeClient adc = new AddresseeClient(); LockedModeUserClient lmu = new LockedModeUserClient(); string emailpartition = AddresseeClient.GetPartitionKeyForEmail(email); interests = interests == null ? "" : interests; Addressee a = adc.GetByPartitionAndRowKey(emailpartition, email.ToLower()); if (a == null) { adc.AddNewItem(new Addressee(email.ToLower()) { Name = name, Email = email.ToLower() }); } LockedModeUser user = lmu.GetByPartitionAndRowKey(emailpartition, email); if (user == null) { lmu.AddNewItem(new LockedModeUser { PartitionKey = emailpartition, RowKey = email.ToLower(), Name = name, Email = email.ToLower(), Phone = phone, Referer = "lm", Attitude = Request.Cookies["attitude"] != null ? Request.Cookies["attitude"].Value : "", Action = Request.Cookies["action"] != null ? Request.Cookies["action"].Value : "", Information = Request.Cookies["information"] != null ? Request.Cookies["information"].Value : "", Processing = Request.Cookies["processing"] != null ? Request.Cookies["processing"].Value : "", Endurance = Request.Cookies["endurance"] != null ? Request.Cookies["endurance"].Value : "", Patterns = Request.Cookies["patterns"] != null ? Request.Cookies["patterns"].Value : "", Presence = Request.Cookies["presence"] != null ? Request.Cookies["presence"].Value : "", Compensation = Request.Cookies["compensation"] != null ? Request.Cookies["compensation"].Value : "", Concentration = Request.Cookies["concentration"] != null ? Request.Cookies["concentration"].Value : "", admiration = interests.Contains("admiration") ? 1 : 0, adventure = interests.Contains("adventure") ? 1 : 0, animals = interests.Contains("animals") ? 1 : 0, beauty = interests.Contains("beauty") ? 1 : 0, competition = interests.Contains("competition") ? 1 : 0, coordinating = interests.Contains("coordinating") ? 1 : 0, creativity = interests.Contains("creativity") ? 1 : 0, critical = interests.Contains("critical") ? 1 : 0, drafting = interests.Contains("drafting") ? 1 : 0, duty = interests.Contains("duty") ? 1 : 0, handlabor = interests.Contains("handlabor") ? 1 : 0, helping = interests.Contains("helping") ? 1 : 0, machinery = interests.Contains("machinery") ? 1 : 0, numbers = interests.Contains("numbers") ? 1 : 0, people = interests.Contains("people") ? 1 : 0, politics = interests.Contains("politics") ? 1 : 0, safety = interests.Contains("safety") ? 1 : 0, salesy = interests.Contains("salesy") ? 1 : 0, science = interests.Contains("science") ? 1 : 0, strength = interests.Contains("strength") ? 1 : 0, technology = interests.Contains("technology") ? 1 : 0, Color = Request.Cookies["color"] != null ? Request.Cookies["color"].Value : "", Shape = Request.Cookies["shape"] != null ? Request.Cookies["shape"].Value : "", Sport = Request.Cookies["sport"] != null ? Request.Cookies["sport"].Value : "", School = Request.Cookies["school"] != null ? Request.Cookies["school"].Value : "", EduLevel = Request.Cookies["educationSelected"] != null ? Request.Cookies["educationSelected"].Value : "" }); } else { user.Name = name; user.Phone = phone; user.Attitude = Request.Cookies["attitude"] != null ? Request.Cookies["attitude"].Value : ""; user.Action = Request.Cookies["action"] != null ? Request.Cookies["action"].Value : ""; user.Information = Request.Cookies["information"] != null ? Request.Cookies["information"].Value : ""; user.Processing = Request.Cookies["processing"] != null ? Request.Cookies["processing"].Value : ""; user.Endurance = Request.Cookies["endurance"] != null ? Request.Cookies["endurance"].Value : ""; user.Patterns = Request.Cookies["patterns"] != null ? Request.Cookies["patterns"].Value : ""; user.Presence = Request.Cookies["presence"] != null ? Request.Cookies["presence"].Value : ""; user.Compensation = Request.Cookies["compensation"] != null ? Request.Cookies["compensation"].Value : ""; user.Concentration = Request.Cookies["concentration"] != null ? Request.Cookies["concentration"].Value : ""; user.admiration = interests.Contains("admiration") ? 1 : 0; user.adventure = interests.Contains("adventure") ? 1 : 0; user.animals = interests.Contains("animals") ? 1 : 0; user.beauty = interests.Contains("beauty") ? 1 : 0; user.competition = interests.Contains("competition") ? 1 : 0; user.coordinating = interests.Contains("coordinating") ? 1 : 0; user.creativity = interests.Contains("creativity") ? 1 : 0; user.critical = interests.Contains("critical") ? 1 : 0; user.drafting = interests.Contains("drafting") ? 1 : 0; user.duty = interests.Contains("duty") ? 1 : 0; user.handlabor = interests.Contains("handlabor") ? 1 : 0; user.helping = interests.Contains("helping") ? 1 : 0; user.machinery = interests.Contains("machinery") ? 1 : 0; user.numbers = interests.Contains("numbers") ? 1 : 0; user.people = interests.Contains("people") ? 1 : 0; user.politics = interests.Contains("politics") ? 1 : 0; user.safety = interests.Contains("safety") ? 1 : 0; user.salesy = interests.Contains("salesy") ? 1 : 0; user.science = interests.Contains("science") ? 1 : 0; user.strength = interests.Contains("strength") ? 1 : 0; user.technology = interests.Contains("technology") ? 1 : 0; user.Color = Request.Cookies["color"] != null ? Request.Cookies["color"].Value : ""; user.Shape = Request.Cookies["shape"] != null ? Request.Cookies["shape"].Value : ""; user.Sport = Request.Cookies["sport"] != null ? Request.Cookies["sport"].Value : ""; user.School = Request.Cookies["school"] != null ? Request.Cookies["school"].Value : ""; user.EduLevel = Request.Cookies["educationSelected"] != null ? Request.Cookies["educationSelected"].Value : ""; lmu.Update(user); } if (!string.IsNullOrEmpty(selectedschool) && !string.IsNullOrEmpty(otherschools)) { sendResultEmailWithSchool(name, email, selectedschool, otherschools); } else { sendResultEmail(name, email); } if (originpage == "testresults") { TempData["resultsEmailed"] = true; return(RedirectToAction("TestResults", "TakeTest")); } else { TempData["resultsEmailed"] = true; return(RedirectToAction("Thankyou", "TakeTest")); } }