Beispiel #1
0
        public List <ListManagementInfo> GetEntriesByNameParentKeyAndPortalID(string ListName, string ParentKey, int PortalID, string Culture)
        {
            SqlDataReader reader = null;

            try
            {
                SQLHandler SQLH = new SQLHandler();
                List <KeyValuePair <string, object> > ParamCollInput = new List <KeyValuePair <string, object> >();
                ParamCollInput.Add(new KeyValuePair <string, object>("@ListName", ListName));
                ParamCollInput.Add(new KeyValuePair <string, object>("@ParentKey", ParentKey));
                ParamCollInput.Add(new KeyValuePair <string, object>("@PortalID", PortalID));
                ParamCollInput.Add(new KeyValuePair <string, object>("@Culture", Culture));



                reader = SQLH.ExecuteAsDataReader("[dbo].[sp_GetListEntriesByNameParentKeyAndPortalID]", ParamCollInput);
                List <ListManagementInfo> lstList = new List <ListManagementInfo>();

                while (reader.Read())
                {
                    ListManagementInfo objList = new ListManagementInfo();
                    objList.ParentID     = int.Parse(reader["ParentID"].ToString());
                    objList.Level        = int.Parse(reader["Level"].ToString());
                    objList.DefinitionID = int.Parse(reader["DefinitionID"].ToString());
                    objList.PortalID     = int.Parse(reader["PortalID"].ToString());
                    lstList.Add(objList);
                }
                return(lstList);;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
        /// <summary>
        /// Connects to a database and returns list entry detais by list name, value and entryID.
        /// </summary>
        /// <param name="ListName">List name.</param>
        /// <param name="Value">Value</param>
        /// <param name="EntryID">List entryID.</param>
        /// <param name="Culture">Current culture name</param>
        /// <returns>returns list detais</returns>
        public ListManagementInfo GetListEntryDetails(string ListName, string Value, int EntryID, string Culture)
        {
            SqlDataReader reader = null;

            try
            {
                SQLHandler SQLH = new SQLHandler();
                List <KeyValuePair <string, object> > ParamCollInput = new List <KeyValuePair <string, object> >();
                ParamCollInput.Add(new KeyValuePair <string, object>("@ListName", ListName));
                ParamCollInput.Add(new KeyValuePair <string, object>("@Value", Value));
                ParamCollInput.Add(new KeyValuePair <string, object>("@EntryID", EntryID));
                ParamCollInput.Add(new KeyValuePair <string, object>("@Culture", Culture));


                reader = SQLH.ExecuteAsDataReader("[dbo].[sp_GetListEntrybyNameValueAndEntryID]", ParamCollInput);
                ListManagementInfo objList = new ListManagementInfo();

                while (reader.Read())
                {
                    objList.ListName      = reader["ListName"].ToString();
                    objList.Value         = reader["Value"].ToString();
                    objList.CurrencyCode  = reader["CurrencyCode"].ToString();
                    objList.DisplayLocale = reader["DisplayLocale"].ToString();
                    objList.IsActive      = bool.Parse(reader["IsActive"].ToString());
                    objList.Text          = reader["Text"].ToString();
                }
                return(objList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
 /// <summary>
 /// Connects to database and returns entries by list name , parentkey, portalID and culture.
 /// </summary>
 /// <param name="ListName">List name.</param>
 /// <param name="ParentKey">Parent list key.</param>
 /// <param name="PortalID">Portal ID.</param>
 /// <param name="Culture">Current culture.</param>
 /// <returns>Returns list of  ListManagementInfo object containing the details</returns>
 public List<ListManagementInfo> GetEntriesByNameParentKeyAndPortalID(string ListName, string ParentKey, int PortalID, string Culture)
 {
     SqlDataReader reader = null;
     try
     {
         SQLHandler SQLH = new SQLHandler();
         List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
         ParamCollInput.Add(new KeyValuePair<string, object>("@ListName", ListName));
         ParamCollInput.Add(new KeyValuePair<string, object>("@ParentKey", ParentKey));
         ParamCollInput.Add(new KeyValuePair<string, object>("@PortalID", PortalID));
         ParamCollInput.Add(new KeyValuePair<string, object>("@Culture", Culture));
         reader = SQLH.ExecuteAsDataReader("[dbo].[sp_GetListEntriesByNameParentKeyAndPortalID]", ParamCollInput);
         List<ListManagementInfo> lstList = new List<ListManagementInfo>();
         while (reader.Read())
         {
             ListManagementInfo objList = new ListManagementInfo();
             objList.ParentID = int.Parse(reader["ParentID"].ToString());
             objList.Level = int.Parse(reader["Level"].ToString());
             objList.DefinitionID = int.Parse(reader["DefinitionID"].ToString());
             objList.PortalID = int.Parse(reader["PortalID"].ToString());
             lstList.Add(objList);
         }
         return lstList; ;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         if (reader != null)
         {
             reader.Close();
         }
     }
 }
        /// <summary>
        /// Connects to a database and returns list entry detais by list name, value and entryID.
        /// </summary>
        /// <param name="ListName">List name.</param>
        /// <param name="Value">Value</param>
        /// <param name="EntryID">List entryID.</param>
        /// <param name="Culture">Current culture name</param>
        /// <returns>returns list detais</returns>
        public ListManagementInfo GetListEntryDetails(string ListName, string Value, int EntryID, string Culture)
        {
            SqlDataReader reader = null;
            try
            {

                SQLHandler SQLH = new SQLHandler();
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                ParamCollInput.Add(new KeyValuePair<string, object>("@ListName", ListName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Value", Value));
                ParamCollInput.Add(new KeyValuePair<string, object>("@EntryID", EntryID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Culture", Culture));


                reader = SQLH.ExecuteAsDataReader("[dbo].[sp_GetListEntrybyNameValueAndEntryID]", ParamCollInput);
                ListManagementInfo objList = new ListManagementInfo();

                while (reader.Read())
                {

                    objList.ListName = reader["ListName"].ToString();
                    objList.Value = reader["Value"].ToString();
                    objList.CurrencyCode = reader["CurrencyCode"].ToString();
                    objList.DisplayLocale = reader["DisplayLocale"].ToString();
                    objList.IsActive = bool.Parse(reader["IsActive"].ToString());
                    objList.Text = reader["Text"].ToString();

                }
                return objList;
            }
            catch (Exception ex)
            {

                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

        }