// Modified from original viziapps code with the additional checks so only valid ones are added to the ComboBox. private bool InitAppsList(Hashtable State, RadComboBox AppsList) { Util util = new Util(); try { if (AppsList == null) return false; // string sql = "SELECT DISTINCT application_name FROM applications WHERE customer_id='" + State["CustomerID"].ToString() + "' ORDER BY application_name"; //Get only native Apps to load onto this ComboBox. string sql = "SELECT DISTINCT application_name,application_id FROM applications WHERE customer_id='" + State["CustomerID"].ToString() + "' AND application_type <> 'web'" + " ORDER BY application_name"; DB db = new DB(); DataRow[] rows = db.ViziAppsExecuteSql(State, sql); AppsList.Items.Clear(); foreach (DataRow row in rows) { string app_name = row["application_name"].ToString(); string application_id = row["application_id"].ToString(); BillingUtil billingutil = new BillingUtil(); //Inserting only Apps which meet all these criteria. if ((billingutil.IsAppStoreSubmissionPaid(State, app_name) == false) && // + never submitted for App preparation as yet. (billingutil.IsAppPaid(State, app_name) == false) && // + not yet paid for anything (util.IsFreeProductionValid(State, application_id) == true) && // + completed the Production Form Submission (billingutil.IsAppCancelled(State, app_name) == false)) // + never cancelled any service. { AppsList.Items.Add(new RadComboBoxItem(app_name, app_name)); } } if (AppsList.IsEmpty) return false; AppsList.Items.Insert(0, new RadComboBoxItem("Select App ->", "Select App ->")); AppsList.Items[0].Selected = true; return true; } catch (Exception ex) { util.ProcessMainExceptions(State, Response, ex); } return false; }
// Modified from original viziapps code with the Additional Branded check so only valid ones are added to the ComboBox. private bool InitAppsList(Hashtable State, RadComboBox AppsList) { Util util = new Util(); BillingUtil billingutil = new BillingUtil(); try { if (AppsList == null) return false; //string sql = "SELECT DISTINCT application_name FROM applications WHERE customer_id='" + State["CustomerID"].ToString() + "' ORDER BY application_name"; string sql = "SELECT DISTINCT application_name,application_type FROM applications WHERE customer_id='" + State["CustomerID"].ToString() + "' ORDER BY application_name"; DB db = new DB(); DataRow[] rows = db.ViziAppsExecuteSql(State, sql); AppsList.Items.Clear(); foreach (DataRow row in rows) { string app_name = row["application_name"].ToString(); string app_type = row["application_type"].ToString(); //For native-hybrid apps do the branded check here inserting only Apps that have paid for branding. if (app_type.Contains("native") || app_type.Contains("hybrid")) { //Inserting only Apps which meet all these criteria. if ((billingutil.IsAppStoreSubmissionPaid(State, app_name) == true) && // + Submitted for App preparation. (billingutil.IsAppPaid(State, app_name) == false)) // + not yet paid for any service { AppsList.Items.Add(new RadComboBoxItem(app_name, app_name)); } } else { //Inserting only Apps which meet all these criteria. if (billingutil.IsAppPaid(State, app_name) == false) // not yet paid for any service AppsList.Items.Add(new RadComboBoxItem(app_name, app_name)); } } if (AppsList.IsEmpty) return false; AppsList.Items.Insert(0, new RadComboBoxItem("Select App ->", "Select App ->")); AppsList.Items[0].Selected = true; return true; } catch (Exception ex) { util.ProcessMainExceptions(State, Response, ex); } return false; }