Пример #1
0
        private void RefreshNumeratorFields()
        {
            RadDropDownList cmbNumerator = new RadDropDownList();

            // retrieve the list of Indicators


            try
            {
                modGlobal.gv_sql = string.Format("Select * from vuNumeratorFields where IndicatorID = {0} order by sortorder",
                                                 Support.GetItemData(cmbIndicators, cmbIndicators.SelectedIndex));
                modGlobal.gv_sql = modGlobal.gv_sql + " order by title ";
                //LDW modGlobal.gv_rs = modGlobal.gv_cn.OpenResultset(modGlobal.gv_sql, RDO.ResultsetTypeConstants.rdOpenStatic);
                const string sqlTableName1 = "vuNumeratorFields";
                modGlobal.gv_rs = DALcop.DalConnectDataSet(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql, sqlTableName1, modGlobal.gv_rs);

                cmbNumerator.Dispose();
                //LDW while (!modGlobal.gv_rs.EOF)
                foreach (DataRow myRow1 in modGlobal.gv_rs.Tables[sqlTableName1].Rows)
                {
                    cmbNumerator.Items.Add(new ListBoxItem(myRow1.Field <string>("Title") + "(" +
                                                           myRow1.Field <string>("SubGroupID") + ")", myRow1.Field <int>("SubGroupID")).ToString());
                    //LDW modGlobal.gv_rs.MoveNext();
                }
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }