Ejemplo n.º 1
0
 public async Task AddPotentialStudentEventAsync(PotentialStudentEvent potentialStudent)
 {
     using (await Locker.LockAsync())
     {
         await Database.InsertAsync(potentialStudent);
     }
 }
 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 AssignLeadAttributesEvent()
        {
            _leadEvent = new PotentialStudentEvent();

            // EVENT SPECIFIC PROPERTIES
            _leadEvent.EventID = MainViewModel.Instance.KioskApp.SettingsVm.EventChosen.EventID;
            _leadEvent.OwnerID = MainViewModel.Instance.KioskApp.SettingsVm.DirectorChosen.UserID;

            _leadEvent.QueueName         = DependencyService.Get <IPreferenceRetriever>().GetQueueName();
            _leadEvent.CampusID          = CampusVm.CampusChosen.CampusId;
            _leadEvent.Organisation      = DependencyService.Get <IPreferenceRetriever>().GetOrganizationChosen();
            _leadEvent.FirstName         = NameVm.FirstName;
            _leadEvent.LastName          = NameVm.LastName;
            _leadEvent.Email             = EmailVm.Email;
            _leadEvent.IsExplicitConsent = EmailVm.AllowAlerts;
            _leadEvent.Language          = MainViewModel.Instance.KioskApp.LanguageVm.SelectedLanguage;

            _leadEvent.HomePhoneNumber = TelephoneVm.TelephoneHome;
            _leadEvent.CellPhoneNumber = TelephoneVm.TelephoneMobile;
            _leadEvent.ProgramID1      = ProgramsVm.ProgramChosen.ProgramId;
            _leadEvent.OriginCountryID = CitizenshipCountryVm.CountryChosen.CountryID;
        }
Ejemplo n.º 4
0
        public async Task DeletePotentialStudentEventAsync(PotentialStudentEvent potentialStudent)
        {
            try
            {
                using (await Locker.LockAsync())
                {
                    string query =
                        "DELETE FROM PotentialStudentEvent WHERE FirstName ='"
                        + potentialStudent.FirstName + "' AND LastName ='" +
                        potentialStudent.LastName + "'";

                    await Database.QueryAsync <PotentialStudentEvent>(query);

                    Debug.WriteLine(potentialStudent.FirstName + "" + potentialStudent.LastName + " has been removed from SQLite Database");
                }
            }

            catch (Exception ex)
            {
                Debug.WriteLine("Student: " + potentialStudent.FirstName + " " +
                                potentialStudent.LastName +
                                " not deleted from SQLite Database. WARNING: Potential Duplicate.");
            }
        }
 public async Task <bool> PostLead(PotentialStudentEvent lead, string baseAddress, string actionUrl)
 {
     return(await Post(lead, baseAddress, actionUrl));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Posts a potential student for Event to CRM and returns a boolean based on successful POST.
 /// </summary>
 /// <param name="request">A potential student event, base address(ie.http://kiosk.lasallecollege.com/CRMData.svc/) and a URL action (ie. RegisterLead/Event?ApiKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</param>
 /// <returns>Response Code and document information.</returns>
 public async Task <bool> AddPotentialStudentToCRM(PotentialStudentEvent lead, string baseAddress, string actionUrl)
 {
     return(await _potentialStudentEventAPIRepo.PostLead(lead, baseAddress, actionUrl));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Adds a potential students for Event to SQLite Database.
 /// </summary>
 /// <param name="request">A PotentialStudentEvent.</param>
 /// <returns>Response Code and document information.</returns>
 public async Task AddPotentialStudentEventToSQLiteAsync(PotentialStudentEvent potentialStudent)
 {
     await _potentialStudentEventSQLiteRepo.AddPotentialStudentEventAsync(potentialStudent);
 }