public void ClearVMData()
 {
     _leadKiosk           = new PotentialStudent();
     _leadEvent           = new PotentialStudentEvent();
     EmailVm              = new EmailPromptViewModel();
     NameVm               = new NamePromptViewModel();
     TelephoneVm          = new TelephonePromptViewModel();
     ObjectiveVm          = new ObjectivePromptViewModel();
     CampusVm             = new CampusPromptViewModel();
     CitizenshipCountryVm = new CitizenShipCountryPromptViewModel();
     ProgramsVm           = new ProgramsPromptViewModel();
     AcknowledgementVm    = new AcknowledgementViewModel();
     LanguageVm           = new LanguagePromptViewModel();
     SubViewModels        = new List <SubViewModel>
     {
         SettingsVm,
         LanguageVm,
         EmailVm,
         NameVm,
         TelephoneVm,
         ObjectiveVm,
         CampusVm,
         CitizenshipCountryVm,
         ProgramsVm,
         AcknowledgementVm
     };
 }
        private void AssignLeadAttributesKiosk()
        {
            _leadKiosk = new PotentialStudent();

            _leadKiosk.QueueName         = DependencyService.Get <IPreferenceRetriever>().GetQueueName();
            _leadKiosk.FirstContact      = "Kiosk";
            _leadKiosk.Organisation      = DependencyService.Get <IPreferenceRetriever>().GetOrganizationChosen();
            _leadKiosk.VisitGoalID       = ObjectiveVm.ObjectiveChosen.VisitGoalID;
            _leadKiosk.FirstName         = NameVm.FirstName;
            _leadKiosk.LastName          = NameVm.LastName;
            _leadKiosk.Email             = EmailVm.Email;
            _leadKiosk.IsExplicitConsent = EmailVm.AllowAlerts;
            _leadKiosk.Language          = LanguageVm.SelectedLanguage;

            if (EmailVm.LeadMatch)
            {
                _leadKiosk.CRMLeadID = EmailVm.CRMID;
                return;
            }

            _leadKiosk.CampusID             = CampusVm.CampusChosen.CampusId;
            _leadKiosk.HomePhoneNumber      = TelephoneVm.TelephoneHome;
            _leadKiosk.CellPhoneNumber      = TelephoneVm.TelephoneMobile;
            _leadKiosk.ProgramID            = ProgramsVm.ProgramChosen.ProgramId;
            _leadKiosk.CitizenShipCountryID = CitizenshipCountryVm.CountryChosen.CountryID;
        }
 public async Task AddPotentialStudentAsync(PotentialStudent potentialStudent)
 {
     using (await Locker.LockAsync())
     {
         await Database.InsertAsync(potentialStudent);
     }
 }
        public async Task DeletePotentialStudentAsync(PotentialStudent potentialStudent)
        {
            try
            {
                using (await Locker.LockAsync())
                {
                    // ADD LOGIC TO HANDLE SQL INJECTION
                    string query =
                        "DELETE FROM PotentialStudent WHERE FirstName ='"
                        + potentialStudent.FirstName + "' AND LastName ='" +
                        potentialStudent.LastName +
                        "' AND VisitGoalID =" + potentialStudent.VisitGoalID;
                    await Database.QueryAsync <PotentialStudent>(query);
                }
            }

            catch (Exception ex)
            {
                Debug.WriteLine("Student: " + potentialStudent.FirstName + " " +
                                potentialStudent.LastName +
                                " not deleted from SQLite Database. WARNING: Potential Duplicate.");
            }
        }
Example #5
0
 public void Update(PotentialStudent PotentialStudent)
 {
     _potentialStudentRepository.Update(PotentialStudent);
 }
Example #6
0
 public PotentialStudent Add(PotentialStudent PotentialStudent)
 {
     return(_potentialStudentRepository.Add(PotentialStudent));
 }
 public PotentialStudentEntered(PotentialStudent student, bool enteredInCRM)
 {
     this.student        = student;
     this.isEnteredInCRM = enteredInCRM;
 }
 public async Task <bool> PostLead(PotentialStudent lead, string baseAddress, string actionUrl)
 {
     return(await Post(lead, baseAddress, actionUrl));
 }
 /// <summary>
 /// Posts a potential student to CRM and returns a boolean based on successful POST.
 /// </summary>
 /// <param name="request">A potential student, base address(ie.http://kiosk.lasallecollege.com/CRMData.svc/) and a URL action (ie. RegisterLead?ApiKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</param>
 /// <returns>Response Code and document information.</returns>
 public async Task <bool> AddPotentialStudentToCRM(PotentialStudent lead, string baseAddress, string actionUrl)
 {
     return(await _potentialStudentAPIRepo.PostLead(lead, baseAddress, actionUrl));
 }
 /// <summary>
 /// Add a Potential Student to SQLite Database.
 /// </summary>
 /// <param name="request">A Potential Student.</param>
 /// <returns>Response Code and document information.</returns>
 public async Task AddPotentialStudentToSQLiteAsync(PotentialStudent potentialStudent)
 {
     await _potentialStudentSQLiteRepo.AddPotentialStudentAsync(potentialStudent);
 }