コード例 #1
0
 public MobileAppConnection(MobileConfig Config)
 {
     this.AzureNFConnection   = Config.AzureNFConnection;
     this.AzureNFHubName      = Config.AzureNFHubName;
     this.AndroidAppSignInKey = Config.AndroidAppSignInKey;
     this.AndroidAppURL       = Config.AndroidAppURL;
 }
コード例 #2
0
        public async Task SaveExamUpdates()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                App_activity_indicator.IsVisible = true;
                App_activity_indicator.IsRunning = true;

                var url = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                          Format("DataFinder.aspx?dataFormat=UpdateExamMarks&q1={0}&q2={1}&q3={2}&q4={3}&q5={4}&q6={5}&q7={6}&q8={7}&q9={8}&q10={9}&typ={10}&exid={11}",
                                 txtAss1.Text, txtAss2.Text, txtAss3.Text, txtAss4.Text, txtAss5.Text, txtAss6.Text, txtAss7.Text, txtAss8.Text, txtAss9.Text, txtAss10.Text,
                                 Application.Current.Properties["examstat"], _EXID);
                var response = await _client.PostAsync(url, null);

                var responseContent = await response.Content.ReadAsStringAsync();

                // set the server reply a message to the Display Alert
                await DisplayAlert("IUIU Mobile", "" + responseContent, "Ok");

                App_activity_indicator.IsVisible = false;
                App_activity_indicator.IsRunning = false;
            }
            else
            {
                App_activity_indicator.IsVisible = false;
                App_activity_indicator.IsRunning = false;
                await DisplayAlert("No internet Connection", "Sorry, please first connect to the internet.", "Ok");
            }
        }
コード例 #3
0
        public async Task SaveCourseworkUpdates()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                App_activity_indicator.IsVisible = true;
                App_activity_indicator.IsRunning = true;

                var url = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                          Format("DataFinder.aspx?dataFormat=UpdateCourseWork&cw1={0}&cw2={1}&cw3={2}&cw4={3}&cw5={4}&compFormat={5}&cwid={6}",
                                 txtAss1.Text, txtAss2.Text, txtAss3.Text, txtAss4.Text, txtAss5.Text, MobileConfig.get_coursework_compForm(), CWID);
                var response = await _client.PostAsync(url, null);

                var responseContent = await response.Content.ReadAsStringAsync();

                // set the server reply a message to the Display Alert
                await DisplayAlert("IUIU Mobile", "" + responseContent, "Ok");

                App_activity_indicator.IsVisible = false;
                App_activity_indicator.IsRunning = false;
            }
            else
            {
                App_activity_indicator.IsVisible = false;
                App_activity_indicator.IsRunning = false;
                await DisplayAlert("No internet Connection", "Sorry, please first connect to the internet.", "Ok");
            }
        }
コード例 #4
0
 public CourseworkResultSheet(int _csid, string headerText)
 {
     InitializeComponent();
     MobileConfig.save_coursework_settings_id("" + _csid);
     txt_stream.SelectedIndex = 0;
     lbl_header.Text          = headerText;
 }
コード例 #5
0
        public async void saveSettings()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                // retrieving data saved locally and formatting it to JSON object.
                string saved_data = MobileConfig.get_exam_results().Replace("[", "").Replace("]", "");
                //deserializing JSON object.
                Debug.WriteLine("DATA : " + saved_data);
                var    des_json        = JsonConvert.DeserializeObject <Model.Examresultssettings>(saved_data);
                string lecturerID      = des_json.lecturerID;
                int    exam_settingsID = des_json.examSettingsID;
                string acadYr          = des_json.acadyear;
                string sem             = "" + des_json.semester;
                string course_id       = "" + des_json.course_id;
                string prog_id         = "" + des_json.progid;
                string intake          = "-";
                string sess            = "" + des_json.studSession;
                string cyear           = "" + des_json.cyear;
                string mark1           = txtAss1.Text;
                string mark2           = txtAss2.Text;
                string mark3           = txtAss3.Text;
                string mark4           = txtAss4.Text;
                string mark5           = txtAss5.Text;
                string mark6           = txtAss6.Text;
                string mark7           = txtAss7.Text;
                string mark8           = txtAss8.Text;
                string mark9           = txtAss9.Text;
                string mark10          = txtAss10.Text;
                string examratio       = txtEXPercent.Text;
                string cwk_ratio       = txtCWPercent.Text;
                string exam_format     = "";
                string noQns           = "0";
                string finalMark       = txtTotal.Text;


                var url = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                          Format("DataFinder.aspx?dataFormat=ExamSettingsEdit&acad={0}&semester={1}&course_id={2}" +
                                 "&prog_id={3}&intake={4}&sess={5}&cyear={6}&maxQ1={7}&maxQ2={8}&maxQ3={9}" +
                                 "&maxQ4={10}&maxQ5={11}&maxQ6={12}&maxQ7={13}&maxQ8={14}&maxQ9={15}" +
                                 "&maxQ10={16}&cwRatio={17}&examRatio={18}&noQns={19}&" +
                                 "maxTotal={20}&EXID={21}&examFormat={22}&empcode={23}",
                                 acadYr, sem, course_id, prog_id, intake, sess, cyear
                                 , mark1, mark2, mark3, mark4, mark5, mark6, mark7, mark8, mark9, mark10,
                                 cwk_ratio, examratio, noQns, finalMark, exam_settingsID, exam_format, lecturerID);

                Debug.WriteLine("POST : " + url);

                var response = await _client.PostAsync(url, null);

                var responseContent = await response.Content.ReadAsStringAsync();

                // set the server reply a message to the Display Alert
                await DisplayAlert("", "" + responseContent, "Ok");
            }

            else
            {
                await DisplayAlert("No internet Connection", "sorry, please first connect to the internet.", "Ok");
            }
        }
コード例 #6
0
        public async void LoadExamSettings(string username, string cs_code, string sem, string yr, string acad, string prog_id, string sess)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    //retrive the course work settings.

                    string myURL = MobileConfig.
                                   GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.Format("DataFinder.aspx?dataFormat=examsettings&empcode={0}&acad={1}&semester={2}" +
                                                                                                                      "&course_id={3}&prog_id={4}&session={5}&intake=-&cyear={6}", username, acad, sem, cs_code, prog_id, sess, yr);


                    var content = await _client.GetStringAsync(myURL);

                    //Debug.WriteLine("URL ->  " + myURL);
                    //await DisplayAlert("General Error!  ", "" + myURL, "Ok");
                    //saving our json data locally
                    MobileConfig.set_exam_results(content);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error huxy :  " + ex);
            }
            setExamresultsSettings();
        }
コード例 #7
0
        public async void LoadCourseworkSettings(string username, string cs_code, string course_nm, string sem, string yr, string acad, string progcode, string sess)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    //retrive the course work settings.
                    string myURL = MobileConfig.GetWebAddress(campus) + string.
                                   Format("DataFinder.aspx?dataFormat=courseworksettings&empcode={0}&acad={1}&semester={2}" +
                                          "&course_id={3}&prog_id={4}&session={5}&intake=-&cyear={6}", username, acad, sem, cs_code, progcode, sess, yr);
                    var content = await _client.GetStringAsync(myURL);

                    //saving our json data locally
                    //await DisplayAlert("", "" + content, "Ok");
                    MobileConfig.set_course_work_settings(content);
                    setCourseWorkSettings();
                }
                else
                {
                    setCourseWorkSettings();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error :  " + ex);
            }


            setCourseWorkSettings();
        }
コード例 #8
0
        public async Task Invoke(HttpContext context, IHeaders headers, IOptions <MobileConfig> settings)
        {
            try
            {
                var bundleId = context.Request.Headers.FirstOrDefault(x => x.Key == "BundleId").Value.ToString();
                if (string.IsNullOrEmpty(bundleId))
                {
                    context.Response.StatusCode = 403;
                    await context.Response.WriteAsync("Required header - bundleId is missing");

                    return;
                }
                else
                {
                    MobileConfig config    = settings.Value;
                    var          bundleIds = config.BundleIds.Split(",");

                    if (!bundleIds.Contains(bundleId))
                    {
                        context.Response.StatusCode = 403;
                        await context.Response.WriteAsync("Invalid!");

                        return;
                    }
                }

                headers.BundleId = bundleId;
            }
            catch (Exception)
            {
            }

            await next(context);
        }
コード例 #9
0
        async Task Submission()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                // retrieving data saved locally and formatting it to JSON object.
                string saved_data = MobileConfig.get_exam_results().Replace("[", "").Replace("]", "");
                //deserializing JSON object.
                Debug.WriteLine("DATA : " + saved_data);
                var des_json        = JsonConvert.DeserializeObject <Model.Examresultssettings>(saved_data);
                int exam_settingsID = des_json.examSettingsID;

                var url = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                          Format("DataFinder.aspx?dataFormat=SubmitExamResults&EXID={0}", exam_settingsID);

                var response = await _client.PostAsync(url, null);

                var responseContent = await response.Content.ReadAsStringAsync();

                // set the server reply a message to the Display Alert
                await DisplayAlert("IUIU Mobile", "" + responseContent, "OK");
            }

            else
            {
                await DisplayAlert("Connection Error!", "sorry, please first connect to the internet.", "Ok");
            }
        }
コード例 #10
0
        protected async Task RefreshResults()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    string exid     = MobileConfig.get_exam_settings_id();
                    string examstat = txt_status.SelectedItem.ToString();
                    string stream   = txt_stream.SelectedItem.ToString();
                    Application.Current.Properties["examstat"] = examstat;
                    //await DisplayAlert("EXID ", exid, "OK");
                    try
                    {
                        App_activity_indicator.IsVisible = true;
                        App_activity_indicator.IsRunning = true;
                        string webaddress = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                                            Format("DataFinder.aspx?dataFormat=examresults&EXID={0}&examStat={1}&stream={2}",
                                                   exid, examstat, stream);
                        var content = await _client.GetStringAsync(webaddress);

                        // Debug.WriteLine("Exam Results DATA -> ", content);
                        //await DisplayAlert("Content! ", content, "OK");

                        if (content != "[]")
                        {
                            // save the data locally.

                            MobileConfig.save_exam_results_sheet(content);
                            App_activity_indicator.IsRunning = false;
                            DisplayResults();
                        }
                        else
                        {
                            await DisplayAlert("Content Error! ", "No Results Found", "OK");
                        }
                        App_activity_indicator.IsVisible = false;
                        App_activity_indicator.IsRunning = false;
                        DisplayResults();
                    }
                    catch (Exception ex)
                    {
                        await DisplayAlert("General Error! ", ex.Message, "OK");

                        App_activity_indicator.IsVisible = false;
                        App_activity_indicator.IsRunning = false;
                    }
                }
                else
                {
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                //await DisplayAlert("Final Error! ", e.Message, "OK");
                DisplayResults();
            }
        }
コード例 #11
0
        public async void saveSettings()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                // retrieving data saved locally and formatting it to JSON object.
                string saved_data = MobileConfig.get_course_work_settings_json().Replace("[", "").Replace("]", "");
                //deserializing JSON object.
                //await DisplayAlert("", "" + saved_data, "Ok");
                var des_json = JsonConvert.DeserializeObject <Model.CourseworkSettings>(saved_data);

                string lecture_id = des_json.cs_lecturerID;
                string acadYr     = des_json.cs_acadYear;
                string sem        = "" + des_json.cs_semester;
                string course_id  = "" + des_json.cs_courseID;
                string prog_id    = "" + des_json.progid;
                string intake     = "-";
                string sess       = "" + des_json.cs_session;
                string cyear      = "" + des_json.cs_year;
                string assn1      = txtAss1.Text;
                string assn2      = txtAss2.Text;
                string assn3      = txtAss3.Text;
                string Test1      = txtAss4.Text;
                string Test2      = txtAss5.Text;;
                string noTask     = "0";
                string finalMark  = txtTotal.Text;
                string csid       = "" + des_json.CSID;
                string compFormat = "" + txt_compformat.Items[txt_compformat.SelectedIndex];

                Debug.WriteLine("acadyer " + acadYr + " compFormat : " + compFormat);



                var url = MobileConfig.GetWebAddress(campus) + string.
                          Format("DataFinder.aspx?dataFormat=courseworksettingsEdit&acad={0}&semester={1}&course_id={2}" +
                                 "&prog_id={3}&intake={4}&sess={5}&cyear={6}&assn_1={7}&assn_2={8}&assn_3={9}" +
                                 "&test_1={10}&test_2={11}&noTasks={12}&finalMark={13}&CSID={14}&empcode={15}" +
                                 "&compFormat={16}", acadYr, sem, course_id, prog_id, intake, sess, cyear
                                 , assn1, assn2, assn3, Test1, Test2, noTask, finalMark, csid, lecture_id, compFormat);

                //await DisplayAlert("","POST : " + url,"OK");

                var response = await _client.PostAsync(url, null);

                var responseContent = await response.Content.ReadAsStringAsync();

                // set the server reply a message to the Display Alert
                await DisplayAlert("", "" + responseContent, "Ok");
            }

            else
            {
                await DisplayAlert("No internet Connection", "sorry, please first connect to the internet.", "Ok");
            }
        }
コード例 #12
0
        protected async Task RefreshResults()
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    string stream = txt_stream.SelectedItem.ToString();
                    //await DisplayAlert("CSID ", "CSID="+CSID, "OK");
                    try
                    {
                        App_activity_indicator.IsVisible = true;
                        App_activity_indicator.IsRunning = true;
                        string webaddress = MobileConfig.GetWebAddress(Application.Current.Properties["campus"].ToString()) + string.
                                            Format("DataFinder.aspx?dataFormat=courseworkresults&CSID={0}&stream={1}", MobileConfig.get_coursework_settings_id(), stream);
                        var content = await _client.GetStringAsync(webaddress);

                        //await DisplayAlert("Content", "CSID=" + MobileConfig.get_coursework_settings_id(), "OK");
                        if (content != "[]")
                        {
                            MobileConfig.save_coursework_results_sheet(content);
                            App_activity_indicator.IsRunning = false;
                            DisplayResults();
                        }
                        else
                        {
                            await DisplayAlert("Content Error! ", "No Results Found", "OK");
                        }
                        App_activity_indicator.IsVisible = false;
                        App_activity_indicator.IsRunning = false;
                        DisplayResults();
                    }
                    catch (Exception ex)
                    {
                        await DisplayAlert("General Error! ", ex.Message, "OK");

                        App_activity_indicator.IsVisible = false;
                        App_activity_indicator.IsRunning = false;
                    }
                }
                else
                {
                    await DisplayAlert("Error! ", "No Internet Connection", "OK");
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                await DisplayAlert("Final Error! ", e.Message, "OK");

                DisplayResults();
            }
            DisplayResults();
        }
コード例 #13
0
        private async void onViewResultsSheet(object sender, EventArgs e)
        {
            // retrieving data saved locally and formatting it to JSON object.
            string saved_data = MobileConfig.get_exam_results().Replace("[", "").Replace("]", "");

            //deserializing JSON object.
            Debug.WriteLine("DATA : " + saved_data);
            var    des_json        = JsonConvert.DeserializeObject <Model.Examresultssettings>(saved_data);
            string lecturerID      = des_json.lecturerID;
            int    exam_settingsID = des_json.examSettingsID;

            MobileConfig.save_exam_settings_id("" + exam_settingsID);
            await Navigation.PushAsync(new ExamViewSheet(headerText));
        }
コード例 #14
0
        void setExamresultsSettings()
        {
            // retrieving data saved locally and formatting it to JSON object.
            string saved_data = MobileConfig.get_exam_results();

            //deserializing JSON object.
            Debug.WriteLine("DATA : " + saved_data);
            var des_json = JsonConvert.DeserializeObject <Model.Examresultssettings>(saved_data);

            int mark1     = des_json.maxMark1;
            int mark2     = des_json.maxMark2;
            int mark3     = des_json.maxMark3;
            int mark4     = des_json.maxMark4;
            int mark5     = des_json.maxMark5;
            int mark6     = des_json.maxMark6;
            int mark7     = des_json.maxMark7;
            int mark8     = des_json.maxMark8;
            int mark9     = des_json.maxMark9;
            int mark10    = des_json.maxMark10;
            int total     = des_json.TotalMaxMark;
            int cwk_ratio = des_json.cwRatio;
            int examratio = des_json.examRatio;


            //setting data into entries
            txtAss1.Text      = "" + mark1;
            txtAss2.Text      = "" + mark2;
            txtAss3.Text      = "" + mark3;
            txtAss4.Text      = "" + mark4;
            txtAss5.Text      = "" + mark5;
            txtAss6.Text      = "" + mark6;
            txtAss7.Text      = "" + mark7;
            txtAss8.Text      = "" + mark8;
            txtAss9.Text      = "" + mark9;
            txtAss10.Text     = "" + mark10;
            txtTotal.Text     = "" + total;
            txtCWPercent.Text = "" + cwk_ratio;
            txtEXPercent.Text = "" + examratio;
            headerText        = string.Format("EXAM MARKSHEET FOR {0} {1} {2}", des_json.progname, des_json.cyear, des_json.studSession, des_json.courseName);
        }
コード例 #15
0
ファイル: MobileConfigControl.cs プロジェクト: eddaly/elvis
    //Apply config to quality settings.
    public static void ApplyConfig(MobileConfig mConf)
    {
        //Quality Settings. (Deprecated)
        //------------------------------------------------------
        /*
        QualitySettings.pixelLightCount = mConf.pixelLightCount;
        QualitySettings.anisotropicFiltering = mConf.anisotropicFiltering;
        QualitySettings.antiAliasing = mConf.antiAliasing;
        QualitySettings.blendWeights = mConf.blendWeights;
        QualitySettings.masterTextureLimit = mConf.masterTextureLimit;
        QualitySettings.maximumLODLevel = mConf.maximumLODLevel;
        QualitySettings.lodBias = mConf.lodBias;
        QualitySettings.particleRaycastBudget = mConf.particleRaycastBudget;
        QualitySettings.vSyncCount = mConf.vSyncCount;
        QualitySettings.softVegetation = mConf.softVegetation;
        QualitySettings.shadowDistance = mConf.shadowDistance;
        QualitySettings.shadowCascades = mConf.shadowCascades;
        QualitySettings.maxQueuedFrames = mConf.maxQueuedFrames;

        MobileGame.SetLightShadows(LightShadows.None);
        */
    }
コード例 #16
0
        public void setCourseWorkSettings()
        {
            try
            {
                // retrieving data saved locally and formatting it to JSON object.
                string saved_data = MobileConfig.get_course_work_settings_json().Replace("[", "").Replace("]", "");
                //deserializing JSON object.
                // Debug.WriteLine("DATA : " + saved_data);
                //DisplayAlert("", "" + saved_data, "Ok");
                var des_json = JsonConvert.DeserializeObject <Model.CourseworkSettings>(saved_data);
                int cw1      = des_json.cs_maxmark_1;
                int cw2      = des_json.cs_maxmark_2;
                int cw3      = des_json.cs_maxmark_3;
                int cw4      = des_json.cs_maxmark_4;
                int cw5      = des_json.cs_maxmark_5;
                int cyear    = des_json.cs_year;
                CSID       = des_json.CSID;
                headerText = string.Format("COURSEWORK MARKSHEET FOR \n{0} {1} {2}", des_json.progname, des_json.cs_year, des_json.cs_session, des_json.cs_courseID);
                int total = des_json.finalMark;
                txt_compformat.SelectedItem = des_json.compFormat;
                MobileConfig.set_coursework_compForm(des_json.compFormat);

                //setting data into entries
                txtAss1.Text  = "" + cw1;
                txtAss2.Text  = "" + cw2;
                txtAss3.Text  = "" + cw3;
                txtAss4.Text  = "" + cw4;
                txtAss5.Text  = "" + cw5;
                txtAss6.Text  = "0";
                txtTotal.Text = "" + total;
            }
            catch (Exception ex)
            {
                DisplayAlert("IUIU Mobile", "Error :  " + ex, "OK");
            }
        }
コード例 #17
0
        public MobileConfig GetLanguageConfig(int productSetId, string language, MobileConfig mobile, bool isLite = false)
        {
            SqlConnection con = null;
            SqlDataReader reader;

            try
            {
                con = Connect();
                SqlCommand cmd = new SqlCommand("knsp_smmx_language_config_get", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@productset_id", productSetId);
                cmd.Parameters.AddWithValue("@language", string.IsNullOrEmpty(language) ? "en" : language);

                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    bool lite = GetInt(reader, "lite") == 1;

                    if (isLite && !lite)
                    {
                        continue;
                    }
                    string configName  = GetString(reader, "config_name").ToLower();
                    string configValue = GetString(reader, "config_value");

                    switch (configName)
                    {
                    case "application_name": mobile.ApplicationName = configValue; break;

                    case "owner_name": mobile.OwnerName = configValue; break;

                    case "url_background": mobile.UrlBackground = configValue; break;

                    case "url_cardholder_agreement": mobile.UrlCardholderAgreement = configValue; break;

                    case "url_disclaimer": mobile.UrlDisclaimer = configValue; break;

                    case "url_eula": mobile.UrlEula = configValue; break;

                    case "url_faq": mobile.UrlFaq = configValue; break;

                    case "url_header_primary_background": mobile.UrlHeaderPrimaryBackground = configValue; break;

                    case "url_issuer_statement": mobile.UrlIssuerStatement = configValue; break;

                    case "url_online_security": mobile.UrlOnlineSecurity = configValue; break;

                    case "url_privacy_policy": mobile.UrlPrivacyPolicy = configValue; break;

                    case "url_splash": mobile.UrlSplash = configValue; break;

                    case "url_splashlogo": mobile.UrlSplashlogo = configValue; break;

                    case "url_terms_conditions": mobile.UrlTermsConditions = configValue; break;

                    case "url_login_header_background": mobile.UrlLoginHeaderBackground = configValue; break;

                    case "customer_support_number": mobile.CustomerSupportNumber = configValue; break;

                    case "url_login_header_logo": mobile.UrlLoginHeaderLogo = configValue; break;

                    case "dda_prefix": mobile.SetDdaPrefix(configValue); break;

                    case "url_direct_deposit_limit": mobile.ReloadDirectDepositLimitUrl = configValue; break;

                    case "text_direct_deposit_limit": mobile.ReloadDirectDepositLimitText = configValue; break;

                    case "url_max_balance": mobile.MaxBalanceUrl = configValue; break;

                    case "text_max_balance": mobile.MaxBalanceText = configValue; break;

                    case "text_available_balance": mobile.AvailableBalanceText = configValue; break;

                    default: break;
                    }
                }
                reader.NextResult();
                while (reader.Read())
                {
                    mobile.MultiLanguage = GetInt(reader, "lang") > 1 ? 1 : 0;
                    mobile.SetLanguageSetId(GetInt(reader, "languageset_id"));
                    break;
                }
            }
            catch (Exception ex)
            {
                //Logger.Instance.Error(this, "GetLanguageConfig", ex);
            }
            finally
            {
                Disconnect(con);
            }
            return(mobile);
        }
コード例 #18
0
 void Search()
 {
     try
     {
         var n = JsonConvert.DeserializeObject <List <Model.CourseworkViewResultsModel> >(MobileConfig.get_exam_results_sheet());
         List <Model.CourseworkViewResultsModel> coursework_data = new List <Model.CourseworkViewResultsModel>(n);
         string searchText = txtSearch.Text;
         List <Model.CourseworkViewResultsModel> filteredList = coursework_data;
         filteredList = coursework_data.Where(c => c.stud_name.Contains(searchText.ToUpper()) || c.stud_reg_no.Contains(searchText.ToUpper())).ToList();
         lv_view_students.ItemsSource = filteredList;
     }
     catch (Exception)
     {
         //lv_view_students.ItemsSource = null;
         DisplayAlert("Display Error ", "Error! Try again", "OK");
     }
 }
コード例 #19
0
 void DisplayResults()
 {
     try
     {
         //DisplayAlert("Stored Data", MobileConfig.get_exam_results_sheet(), "OK");
         var n = JsonConvert.DeserializeObject <List <Model.ExamViewResultsModel> >(MobileConfig.get_exam_results_sheet());
         List <Model.ExamViewResultsModel> exams_data = new List <Model.ExamViewResultsModel>(n);
         //DisplayAlert("Stored Data", ""+n.Count, "OK");
         lv_view_students.ItemsSource = exams_data;
     }
     catch (Exception)
     {
     }
 }
コード例 #20
0
 void DisplayResults()
 {
     try
     {
         var n = JsonConvert.DeserializeObject <List <Model.CourseworkViewResultsModel> >(MobileConfig.get_coursework_results_sheet());
         List <Model.CourseworkViewResultsModel> coursework_data = new List <Model.CourseworkViewResultsModel>(n);
         //DisplayAlert("Stored Data","No Records: "+ coursework_data.Count, "OK");
         lv_view_students.ItemsSource = coursework_data;
     }
     catch (Exception ex)
     {
         DisplayAlert("Stored Data", "Error! : " + ex.Message, "OK");
     }
 }
コード例 #21
0
ファイル: MobileConfigControl.cs プロジェクト: eddaly/elvis
 //Saves a given config file with a given name
 private static void SaveConfigFile(MobileConfig mConf, string fileName)
 {
 }
コード例 #22
0
 public EbMasterConnectionsConfig(EbConnectionsConfig confs)
 {
     this.EmailConfigs = confs.EmailConfigs;
     this.SMSConfigs   = confs.SMSConfigs;
     this.MobileConfig = confs.MobileConfig;
 }
コード例 #23
0
ファイル: MobileConfigControl.cs プロジェクト: eddaly/elvis
 //Looad and apply config, null will just create the default.
 public static void InitialiseConfig(string filename)
 {
     currentConfig = LoadConfigFile(filename);
     ApplyConfig(currentConfig);
 }
コード例 #24
0
        public MobileConfig GetMobileCodfings(int productSetId, string language = "en", bool isLite = false)
        {
            SqlConnection con    = null;
            SqlDataReader reader = null;
            MobileConfig  mobile = new MobileConfig();

            mobile.ProductSetId = productSetId;
            int parseInt;

            try
            {
                con = Connect();
                SqlCommand cmd = new SqlCommand("knsp_smmx_mobile_config_get", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@productset_id", productSetId);

                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    try
                    {
                        bool lite = GetInt(reader, "lite") == 1;
                        if (isLite && !lite)
                        {
                            continue;
                        }
                        string configName  = GetString(reader, "config_name").ToLower();
                        string configValue = GetString(reader, "config_value");

                        if (!Int32.TryParse(configValue, out parseInt))
                        {
                            if (!string.IsNullOrEmpty(configValue) && configValue.ToLower().Equals("true"))
                            {
                                configValue = "1";
                            }
                            else if (!string.IsNullOrEmpty(configValue) && configValue.ToLower().Equals("false"))
                            {
                                configValue = "0";
                            }
                            configValue = string.IsNullOrEmpty(configValue) ? "0" : configValue;
                        }
                        switch (configName)
                        {
                        case "access_counpons": mobile.AccessCounpons = configValue.Equals("1"); break;

                        case "application_name": mobile.ApplicationName = configValue; break;

                        case "color_avatar_ring": mobile.ColorAvatarRing = configValue; break;

                        case "color_background_text": mobile.ColorBackgroundText = configValue; break;

                        case "color_button_primary_background": mobile.ColorButtonPrimaryBackground = configValue; break;

                        case "color_button_primary_text": mobile.ColorButtonPrimaryText = configValue; break;

                        case "color_header_primary_icon": mobile.ColorHeaderPrimaryIcon = configValue; break;

                        case "color_header_primary_text": mobile.ColorHeaderPrimaryText = configValue; break;

                        case "color_login_banner_background": mobile.ColorLoginBannerBackground = configValue; break;

                        case "color_login_banner_primary_text": mobile.ColorLoginBannerPrimaryText = configValue; break;

                        case "color_login_banner_secondary_text": mobile.ColorLoginBannerSecondaryText = configValue; break;

                        case "color_login_hamburger": mobile.ColorLoginHamburger = configValue; break;

                        case "color_login_menu_background": mobile.ColorLoginMenuBackground = configValue; break;

                        case "color_login_menu_text": mobile.ColorLoginMenuText = configValue; break;

                        case "color_main_hamburger": mobile.ColorMainHamburger = configValue; break;

                        case "color_main_menu_background": mobile.ColorMainMenuBackground = configValue; break;

                        case "color_main_menu_text": mobile.ColorMainMenuText = configValue; break;

                        case "color_popup_background": mobile.ColorPopupBackground = configValue; break;

                        case "color_popup_button_background": mobile.ColorPopupButtonBackground = configValue; break;

                        case "color_popup_button_text": mobile.ColorPopupButtonText = configValue; break;

                        case "color_popup_text": mobile.ColorPopupText = configValue; break;

                        case "color_primary_overlay": mobile.ColorPrimaryOverlay = configValue; break;

                        case "color_primary_overlay_primary_text": mobile.ColorPrimaryOverlayPrimaryText = configValue; break;

                        case "color_primary_overlay_secondary_text": mobile.ColorPrimaryOverlaySecondaryText = configValue; break;

                        case "color_secondary_overlay": mobile.ColorSecondaryOverlay = configValue; break;

                        case "color_secondary_overlay_text": mobile.ColorSecondaryOverlaytext = configValue; break;

                        case "color_splashbackground": mobile.ColorSplashBackground = configValue; break;

                        case "color_textbox_primary_background": mobile.ColorTextboxPrimaryBackground = configValue; break;

                        case "customer_support_number": mobile.CustomerSupportNumber = configValue; break;

                        case "enrollmentportal": mobile.EnrollmentPortal = configValue; break;

                        case "enrollmentportalt2p": mobile.EnrollmentPortalTemp2Perm = configValue; break;

                        case "enrollmentportald2p": mobile.EnrollmentPortalDirect2Perm = configValue; break;

                        case "password_regex": mobile.PasswordRegex = configValue; break;

                        case "username_regex": mobile.UserNameRegex = configValue; break;

                        case "cfpb_compliance": mobile.CFPBCompliance = configValue.Equals("1"); break;

                        case "ingo": mobile.Ingo = configValue.Equals("1"); break;

                        case "owner_logo": mobile.OwnerLogo = configValue; break;

                        case "owner_name": mobile.OwnerName = configValue; break;

                        case "url_background": mobile.UrlBackground = configValue; break;

                        case "url_cardholder_agreement": mobile.UrlCardholderAgreement = configValue; break;

                        case "url_disclaimer": mobile.UrlDisclaimer = configValue; break;

                        case "url_eula": mobile.UrlEula = configValue; break;

                        case "url_faq": mobile.UrlFaq = configValue; break;

                        case "url_header_primary_background": mobile.UrlHeaderPrimaryBackground = configValue; break;

                        case "url_issuer_statement": mobile.UrlIssuerStatement = configValue; break;

                        case "url_online_security": mobile.UrlOnlineSecurity = configValue; break;

                        case "url_privacy_policy": mobile.UrlPrivacyPolicy = configValue; break;

                        case "url_splash": mobile.UrlSplash = configValue; break;

                        case "url_splashlogo": mobile.UrlSplashlogo = configValue; break;

                        case "url_terms_conditions": mobile.UrlTermsConditions = configValue; break;

                        case "viamericas": mobile.Viamericas = configValue.Equals("1"); break;

                        case "url_login_header_background": mobile.UrlLoginHeaderBackground = configValue; break;

                        case "url_login_header_logo": mobile.UrlLoginHeaderLogo = configValue; break;

                        case "dda_prefix": mobile.SetDdaPrefix(configValue); break;

                        case "color_textbox_primary_text": mobile.ColorTextboxPrimaryText = configValue; break;

                        case "color_textbox_hint_text": mobile.ColorTextboxHintText = configValue; break;

                        case "forgot_password_url": mobile.ForgotPasswordUrl = configValue; break;

                        case "register_info_type": mobile.RegisterInfoType = Convert.ToInt32(configValue); break;

                        case "locator_moneypass": mobile.LocatorMoneypass = Convert.ToInt32(configValue); break;

                        case "locator_preset_rapid": mobile.LocatorPresetRapid = Convert.ToInt32(configValue); break;

                        case "transfer_c2c": mobile.TransferC2C = Convert.ToInt32(configValue); break;

                        case "locator_moneygram": mobile.LocatorMoneygram = Convert.ToInt32(configValue); break;

                        case "locator_moneygram_url": mobile.LocatorMoneygramUrl = configValue; break;

                        case "forgot_password_type": mobile.ForgotPasswordType = Convert.ToInt32(configValue); break;

                        case "reload_moneygram": mobile.ReloadMoneygram = Convert.ToInt32(configValue); break;

                        case "reload_visa_readylink": mobile.ReloadVisaReadyLink = Convert.ToInt32(configValue); break;

                        case "reload_cashpass_retailer": mobile.ReloadCashpassRetailer = Convert.ToInt32(configValue); break;

                        case "reload_western_union": mobile.ReloadWesterUnion = Convert.ToInt32(configValue); break;

                        case "reload_directdeposit": mobile.ReloadDirectDeposit = Convert.ToInt32(configValue); break;

                        case "reload_greendot": mobile.ReloadGreenDot = Convert.ToInt32(configValue); break;

                        case "reload_banktransfer": mobile.ReloadBankTransfer = Convert.ToInt32(configValue); break;

                        case "locator_cashpass": mobile.LocatorCashpass = Convert.ToInt32(configValue); break;

                        case "locator_western_union": mobile.LocatorWesterUnion = Convert.ToInt32(configValue); break;

                        case "locator_visa_readylink": mobile.LocatorVisaReadylink = Convert.ToInt32(configValue); break;

                        case "locator_western_union_url": mobile.LocatorWesterUnionUrl = configValue; break;

                        case "login_option": mobile.LoginOption = Convert.ToInt32(configValue); break;

                        case "bank_fund": mobile.BankFunding = Convert.ToInt32(configValue); break;

                        case "multi_language": mobile.MultiLanguage = Convert.ToInt32(configValue); break;

                        case "bank_name": mobile.BankName = configValue; break;

                        case "locator_atm": mobile.LocatorAtm = Convert.ToInt32(configValue); break;

                        case "budget_tool": mobile.BudgetTool = Convert.ToInt32(configValue); break;

                        case "locator_branch": mobile.LocatorBranch = Convert.ToInt32(configValue); break;

                        case "reload_swipe": mobile.ReloadSwipe = Convert.ToInt32(configValue); break;

                        case "rewards": mobile.Rewards = Convert.ToInt32(configValue); break;

                        case "login_option_pin": mobile.LoginOptionPin = Convert.ToInt32(configValue); break;

                        case "reload_government": mobile.GovernmentLoad = Convert.ToInt32(configValue); break;

                        case "forgot_username": mobile.ForgotUsername = Convert.ToInt32(configValue); break;

                        case "change_email": mobile.ChangeEmail = Convert.ToInt32(configValue); break;

                        case "sole_bank_info": mobile.SetSoleBankInfo(configValue); break;

                        case "reload_recharge_card": mobile.ReloadRechargeCard = Convert.ToInt32(configValue); break;

                        case "locator_speedycash_atm": mobile.LocatorSpeedycashAtm = Convert.ToInt32(configValue); break;

                        case "locator_speedycash_branch": mobile.LocatorSpeedycashBranch = Convert.ToInt32(configValue); break;

                        case "reload_banktransfer_text": mobile.ReloadBankTransferText = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "reload_banktransfer_url": mobile.ReloadBankTransferUrl = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "owner_routing_number": mobile.RountingNumber = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "reload_directdeposit_text": mobile.ReloadDirectDepositText = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "reload_directdeposit_url": mobile.ReloadDirectDepositUrl = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "reload_directdeposit_address": mobile.ReloadDirectDepositAddress = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "reload_directdeposit_phone": mobile.ReloadDirectDepositPhone = configValue.Equals("0") ? string.Empty : configValue; break;

                        case "budget_primary_text_color": mobile.ColorBudgetPrimaryText = configValue; break;

                        case "budget_title_text_color": mobile.ColorBudgetTitleText = configValue; break;

                        case "budget_progress_bar_color": mobile.ColorBudgetProgressbar = configValue; break;

                        case "budget_savingprogress_bar_color": mobile.ColorBudgetSavingProgressbar = configValue; break;

                        case "budget_savineprogress_bar_light_color": mobile.ColorBudgetSavingProgressbarLight = configValue; break;

                        case "budget_alert_text_color": mobile.ColorBudgetAlertText = configValue; break;

                        case "budget_overlay_color": mobile.ColorBudgetOverlay = configValue; break;

                        default: break;
                        }
                    }
                    catch (Exception ex)
                    {
                        //Logger.Instance.Error(this, "GetMobileCodfings", ex);
                    }
                }

                mobile          = GetLanguageConfig(productSetId, language, mobile);
                mobile.Popovers = GetPopover(productSetId, mobile.GetLanguageSetId());
                return(mobile);
            }
            catch (Exception ex)
            {
                //Logger.Instance.Error(this, "GetMobileCodfings", ex);
                return(null);
            }
            finally
            {
                CloseReader(reader);
                Disconnect(con);
            }
        }