Example #1
1
 public static IDataReader GetActivePolls(Guid siteGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Polls_SelectActive", 2);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@CurrentTime", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow);
     return sph.ExecuteReader();
 }
Example #2
0
        public static IDataReader ForumThreadGetPost(int postId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ForumPosts_SelectOne", 1);

            sph.DefineSqlParameter("@PostID", SqlDbType.Int, ParameterDirection.Input, postId);
            return(sph.ExecuteReader());
        }
Example #3
0
        public static IDataReader GetThreadsForSiteMap(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ForumThreads_SelectForSiteMap", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(sph.ExecuteReader());
        }
Example #4
0
        public static IDataReader GetForumSubscription(Guid subGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ForumSubscriptions_SelectOne", 1);

            sph.DefineSqlParameter("@SubGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, subGuid);
            return(sph.ExecuteReader());
        }
Example #5
0
        /// <summary>
        /// Gets an IDataReader with one row from the mp_ContentRating table.
        /// </summary>
        /// <param name="contentGuid"> contentGuid </param>
        public static IDataReader GetStatsByContent(Guid contentGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentRating_GetStatsByContent", 1);

            sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
            return(sph.ExecuteReader());
        }
Example #6
0
        public static IDataReader SelectBySite(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_SelectBySite", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(sph.ExecuteReader());
        }
Example #7
0
        public static IDataReader ForumThreadGetPostsReverseSorted(int threadId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ForumPosts_SelectAllByThreadRevereSorted", 1);

            sph.DefineSqlParameter("@ThreadID", SqlDbType.Int, ParameterDirection.Input, threadId);
            return(sph.ExecuteReader());
        }
Example #8
0
        /// <summary>
        /// Gets an IDataReader with all rows in the mp_Letter table.
        /// </summary>
        public static IDataReader GetAll(Guid letterInfoGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Letter_SelectAll", 1);

            sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
            return(sph.ExecuteReader());
        }
Example #9
0
        public static IDataReader SelectByUser(Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserPages_SelectByUser", 1);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            return(sph.ExecuteReader());
        }
Example #10
0
 /// <summary>
 /// Gets an IDataReader with one row from the mp_GeoZone table.
 /// </summary>
 /// <param name="guid"> guid </param>
 public static IDataReader GetByCode(Guid countryGuid, string code)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GeoZone_SelectByCode", 2);
     sph.DefineSqlParameter("@CountryGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, countryGuid);
     sph.DefineSqlParameter("@Code", SqlDbType.NVarChar, 255, ParameterDirection.Input, code);
     return sph.ExecuteReader();
 }
Example #11
0
 /// <summary>
 /// Gets an IDataReader with one row from the mp_SurveyQuestionAnswers table.
 /// </summary>
 /// <param name="answerGuid"> answerGuid </param>
 public static IDataReader GetOne(Guid responseGuid, Guid questionGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SurveyQuestionAnswers_SelectOne", 2);
     sph.DefineSqlParameter("@ResponseGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, responseGuid);
     sph.DefineSqlParameter("@QuestionGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, questionGuid);
     return sph.ExecuteReader();
 }
Example #12
0
 public static IDataReader Find(string loginProvider, string providerKey)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserLogins_Find", 2);
     sph.DefineSqlParameter("@LoginProvider", SqlDbType.NVarChar, 128, ParameterDirection.Input, loginProvider);
     sph.DefineSqlParameter("@ProviderKey", SqlDbType.NVarChar, 128, ParameterDirection.Input, providerKey);
     return sph.ExecuteReader();
 }
 /// <summary>
 /// Gets an IDataReader with all rows in the mp_Currency table.
 /// </summary>
 public static IDataReader GetSpecificSettingAllModulesWithTheDefinition(string srcPath, string settingName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_ModulePagePath_SelectByControlSrcPathSnippet", 2);
     sph.DefineSqlParameter("@FeaturePath", SqlDbType.UniqueIdentifier, ParameterDirection.Input, srcPath);
     sph.DefineSqlParameter("@SettingName", SqlDbType.NVarChar, ParameterDirection.Input, settingName);
     return sph.ExecuteReader();
 }
        public static IDataReader Get(int projectId, int blockId, int workId, int groupId, int itemId, int subItemId)
        {
            StringBuilder sb = new StringBuilder();
            string prefix = DBHelper.Instance.TablePrefix;

            sb.Append("SELECT s.IdProyecto ProjectId, ");
            sb.Append("s.IdBloque BlockId, ");
            sb.Append("s.IdObra WorkId, ");
            sb.Append("s.IdGrupo GroupId, ");
            sb.Append("s.IdItem ItemId, ");
            sb.Append("s.Id SubItemId, ");
            sb.Append("s.Nombre Name,");
            sb.Append("s.Cantidad Quantity ");
            sb.AppendFormat("FROM {0}SubItem s ", prefix);
            sb.AppendFormat("WHERE s.IdProyecto={0} ", projectId);
            sb.AppendFormat("AND s.IdBloque={0} ", blockId);
            sb.AppendFormat("AND s.IdObra={0} ", workId);
            sb.AppendFormat("AND s.IdGrupo={0} ", groupId);
            sb.AppendFormat("AND s.IdItem={0} ", itemId);
            sb.AppendFormat("AND s.Id={0} ", subItemId);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
Example #15
0
        public static IDataReader GetAllByPage(Guid pageQuestionGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SurveyQuestions_SelectAllByPage", 1);
            sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pageQuestionGuid);

            return sph.ExecuteReader();
        }
Example #16
0
        /// <summary>
        /// Gets a page of data from the mp_RedirectList table.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static IDataReader GetPage(
            int siteId,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows = GetCount(siteId);

            if (pageSize > 0)
            {
                totalPages = totalRows / pageSize;
            }

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RedirectList_SelectPage", 3);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return(sph.ExecuteReader());
        }
Example #17
0
        /// <summary>
        /// Gets an IDataReader with all incomplete tasks in the mp_TaskQueue table.
        /// </summary>
        /// <param name="siteGuid"> guid </param>
        public static IDataReader GetUnfinished(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_TaskQueue_SelectIncompleteBySite", 1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            return(sph.ExecuteReader());
        }
Example #18
0
        /// <summary>
        /// Gets a page of data from the mp_TaskQueue table.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        public static IDataReader GetPageUnfinished(
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows
                = GetCountUnfinished();

            if (pageSize > 0)
            {
                totalPages = totalRows / pageSize;
            }

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_TaskQueue_SelectPageIncomplete", 2);

            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return(sph.ExecuteReader());
        }
Example #19
0
        /// <summary>
        /// Gets an IDataReader with rows from the mp_AuthorizeNetLog table.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public static IDataReader GetByCart(Guid cartGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_AuthorizeNetLog_SelectByCart", 1);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            return(sph.ExecuteReader());
        }
Example #20
0
        /// <summary>
        /// Gets a page of data from the mp_ContentHistory table.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static IDataReader GetPage(
            Guid contentGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows = GetCount(contentGuid);

            if (pageSize > 0)
            {
                totalPages = totalRows / pageSize;
            }

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentHistory_SelectPage", 3);

            sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return(sph.ExecuteReader());
        }
Example #21
0
        /// <summary>
        /// Gets an IDataReader with rows from the mp_Comments table.
        /// </summary>
        /// <param name="guid"> guid </param>
        public static IDataReader GetByParentDesc(Guid parentGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Comments_SelectByParentDesc", 1);

            sph.DefineSqlParameter("@ParentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, parentGuid);
            return(sph.ExecuteReader());
        }
Example #22
0
        public static IDataReader GetHtmlForMetaWeblogApi(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_HtmlContent_SelectForMetaWeblogApi", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(sph.ExecuteReader());
        }
Example #23
0
        public static IDataReader GetHtmlContent(int moduleId, int itemId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_HtmlContent_SelectOne", 1);

            sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
            return(sph.ExecuteReader());
        }
Example #24
0
        public static IDataReader PageModuleGetReaderByPage(int pageId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_PageModule_SelectByPage", 1);

            sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, pageId);
            return(sph.ExecuteReader());
        }
Example #25
0
        public static IDataReader GetSite(string hostName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Sites_SelectOneByHost", 1);

            sph.DefineSqlParameter("@HostName", SqlDbType.NVarChar, 50, ParameterDirection.Input, hostName);
            return(sph.ExecuteReader());
        }
Example #26
0
        public static IDataReader GetModule(int moduleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Modules_SelectOne", 1);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            return(sph.ExecuteReader());
        }
Example #27
0
        public static IDataReader GetPageListForAdmin(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Pages_SelectList", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(sph.ExecuteReader());
        }
Example #28
0
        /// <summary>
        /// Gets an IDataReader with one row from the mp_RedirectList table.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public static IDataReader GetOne(Guid rowGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RedirectList_SelectOne", 1);

            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            return(sph.ExecuteReader());
        }
        /// <summary>
        /// Gets an IDataReader with one row from the ws_GoogleCheckoutLog table.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public static IDataReader GetMostRecentByOrder(string googleOrderId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GoogleCheckoutLog_SelectMostRecentByOrder", 1);

            sph.DefineSqlParameter("@OrderNumber", SqlDbType.NVarChar, 50, ParameterDirection.Input, googleOrderId);
            return(sph.ExecuteReader());
        }
Example #30
0
        public static IDataReader GetWebPart(Guid webPartId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_SelectOne", 1);

            sph.DefineSqlParameter("@WebPartID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, webPartId);
            return(sph.ExecuteReader());
        }
Example #31
0
        /// <summary>
        /// Gets an IDataReader with all rows in the mp_GeoZone table.
        /// </summary>
        public static IDataReader GetByCountry(Guid countryGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GeoZone_SelectByCountry", 1);

            sph.DefineSqlParameter("@CountryGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, countryGuid);
            return(sph.ExecuteReader());
        }
Example #32
0
        public static IDataReader GetByModule(Guid moduleGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Category_SelectByModule", 1);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            return(sph.ExecuteReader());
        }
Example #33
0
        public static IDataReader GetHistoryFile(int id)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SharedFilesHistory_SelectOne", 1);

            sph.DefineSqlParameter("@ID", SqlDbType.Int, ParameterDirection.Input, id);
            return(sph.ExecuteReader());
        }
Example #34
0
        /// <summary>
        /// Gets an IDataReader with one row from the mp_PayPalLog table.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public static IDataReader GetSetExpressCheckout(string token)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_PayPalLog_SelectSetExpressCheckoutByToken", 1);

            sph.DefineSqlParameter("@Token", SqlDbType.NVarChar, 50, ParameterDirection.Input, token);
            return(sph.ExecuteReader());
        }
Example #35
0
        public static IDataReader GetSharedFileFolder(int folderId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SharedFileFolders_SelectOne", 1);

            sph.DefineSqlParameter("@FolderID", SqlDbType.Int, ParameterDirection.Input, folderId);
            return(sph.ExecuteReader());
        }
Example #36
0
 public static IDataReader GetByName(int siteId, string roleName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_SelectOneByName", 2);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@RoleName", SqlDbType.NVarChar, 50, ParameterDirection.Input, roleName);
     return sph.ExecuteReader();
 }
Example #37
0
        public static IDataReader GetBySite(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteFolders_SelectBySite", 1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            return(sph.ExecuteReader());
        }
Example #38
0
        public static IDataReader GetGlobalContent(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Modules_SelectGlobalContent", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(sph.ExecuteReader());
        }
        public static IDataReader Get(int projectId, int blockId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT Nombre Name ");
            sb.AppendFormat("FROM {0}Bloque ", DBHelper.Instance.TablePrefix);
            sb.AppendFormat("WHERE IdProyecto={0} AND Id={1}", projectId, blockId);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        //public static IDataReader Get(int projectId, int blockId, int workId, int groupId)
        //{
        //    string prefix = DBHelper.Instance.TablePrefix;
        //    StringBuilder sb = new StringBuilder();
        //    sb.Append("SELECT g.Id GroupId,");
        //    sb.Append("l.Nombre Name ");
        //    sb.AppendFormat("FROM {0}Grupo g INNER JOIN {0}ListaGrupo l ON g.IdListaGrupo=l.Id ", prefix);
        //    sb.AppendFormat("WHERE g.IdProyecto={0} ", projectId);
        //    sb.AppendFormat("AND g.IdBloque={0} ", blockId);
        //    sb.AppendFormat("AND g.IdObra={0} ", workId);
        //    sb.AppendFormat("AND g.Id={0}", groupId);
        //    SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);
        //    return sph.ExecuteReader();
        //}
        public static IDataReader GetAll()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT * ");
            sb.AppendFormat("FROM uListaGrupo ");
            sb.Append("ORDER BY Nombre");

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader GetAll(int projectId, int blockId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT Id AS WorkId,");
            sb.Append("Nombre AS Name ");
            sb.AppendFormat("FROM {0}Obra ", DBHelper.Instance.TablePrefix);
            sb.AppendFormat("WHERE IdProyecto={0} AND ", projectId);
            sb.AppendFormat("IdBloque={0} ", blockId);
            sb.Append("ORDER BY Nombre");

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader GetAll()
        {
            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString,
                "SELECT Id AS ProjectId," +
                "Nombre AS Name," +
                "FechaCreacion AS DateCreated," +
                "FechaModificacion AS DateModified," +
                "Usuario AS CreatedBy," +
                "UsuarioModificador AS ModifiedBy " +
                "FROM uProyecto " +
                "ORDER BY Nombre",
                CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader GetAll(int projectId, int blockId, int workId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT g.Id AS GroupId,");
            sb.Append("l.Nombre AS Name ");
            sb.AppendFormat("FROM {0}Grupo g INNER JOIN {0}ListaGrupo l ON g.IdListaGrupo=l.Id ", DBHelper.Instance.TablePrefix);
            sb.AppendFormat("WHERE g.IdProyecto={0} AND ", projectId);
            sb.AppendFormat("g.IdBloque={0} AND ", blockId);
            sb.AppendFormat("g.IdObra={0} ", workId);
            sb.Append("ORDER BY l.Nombre");

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader Get(int projectId)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT Id AS ProjectId,");
            sb.Append("Nombre AS Name,");
            sb.Append("FechaCreacion AS DateCreated,");
            sb.Append("FechaModificacion AS DateModified,");
            sb.Append("Usuario AS CreatedBy,");
            sb.Append("UsuarioModificador AS ModifiedBy ");
            sb.AppendFormat("FROM {0}Proyecto ", DBHelper.Instance.TablePrefix);
            sb.AppendFormat("WHERE Id={0}", projectId);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader Get(int projectId, int blockId, int workId, int groupId, int itemId)
        {
            string prefix = DBHelper.Instance.TablePrefix;
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT i.Id ItemId,");
            sb.Append("l.Nombre Name ");
            sb.AppendFormat("FROM {0}Item i INNER JOIN {0}ListaItem l ON i.IdListaItem=l.Id ", prefix);
            sb.AppendFormat("WHERE i.IdProyecto={0} ", projectId);
            sb.AppendFormat("AND i.IdBloque={0} ", blockId);
            sb.AppendFormat("AND i.IdObra={0} ", workId);
            sb.AppendFormat("AND i.IdGrupo={0} ", groupId);
            sb.AppendFormat("AND i.Id={0}", itemId);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
        public static IDataReader Get(int projectId, int blockId, int workId, int groupId, int itemId, int subItemId, string currencyCode)
        {
            StringBuilder sb = new StringBuilder();
            string prefix = DBHelper.Instance.TablePrefix;

            sb.Append("SELECT s.IdProyecto ProjectId, ");
            sb.Append("s.IdBloque BlockId, ");
            sb.Append("s.IdObra WorkId, ");
            sb.Append("s.IdGrupo GroupId, ");
            sb.Append("s.IdItem ItemId, ");
            sb.Append("s.Id SubItemId, ");
            sb.Append("s.Nombre Name, ");
            sb.Append("l.Unidad Unit, ");
            sb.Append("s.Cantidad Quantity, ");

            if (currencyCode.Contains("$us"))
            {
                sb.Append("l.PrecioSus UnitPrice, ");
                sb.Append("l.PrecioSus*s.Cantidad TotalPrice ");
            }
            else
            {
                sb.Append("l.PrecioBs UnitPrice, ");
                sb.Append("l.PrecioBs*s.Cantidad TotalPrice ");
            }

            sb.AppendFormat("FROM {0}SubItem s INNER JOIN ", prefix);
            sb.AppendFormat("({0}Item i INNER JOIN {0}ListaItem l ON i.IdListaItem=l.Id) ", prefix);
            sb.AppendFormat("ON (s.IdProyecto=i.IdProyecto AND s.IdBloque=i.IdBloque AND s.IdObra=i.IdObra AND s.IdGrupo=i.IdGrupo AND s.IdItem=i.Id) ");
            sb.AppendFormat("WHERE s.IdProyecto={0} ", projectId);
            sb.AppendFormat("AND s.IdBloque={0} ", blockId);
            sb.AppendFormat("AND s.IdObra={0} ", workId);
            sb.AppendFormat("AND s.IdGrupo={0} ", groupId);
            sb.AppendFormat("AND s.IdItem={0} ", itemId);
            sb.AppendFormat("AND s.Id={0} ", subItemId);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);

            return sph.ExecuteReader();
        }
 public static IDataReader GetWorkInProgress(Guid moduleGuid, string status)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflow_SelectWorkInProgressByStatus", 2);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 20, ParameterDirection.Input, status);
     return sph.ExecuteReader();
 }
        public static IDataReader GetPage(
            Guid siteGuid,
            string status,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows = GetCount(siteGuid, status);

            if (pageSize > 0) totalPages = totalRows / pageSize;

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflow_SelectPage", 4);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, ParameterDirection.Input, status);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return sph.ExecuteReader();
        }
 public static IDataReader GetPageInfoForPage(
     Guid siteGuid,
     string status,
     int pageNumber,
     int pageSize)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflow_SelectPageInfoForPage", 4);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, ParameterDirection.Input, status);
     sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
     sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
     return sph.ExecuteReader();
 }
        /// <summary>
        /// Gets a page of data from the ws_GoogleCheckoutLog table.
        /// </summary>
        /// <param name="storeGuid">The storeGuid</param>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static IDataReader GetPageByStore(
            Guid storeGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            int totalRows
                = GetCountByStore(storeGuid);

            if (pageSize > 0) totalPages = totalRows / pageSize;

            if (totalRows <= pageSize)
            {
                totalPages = 1;
            }
            else
            {
                int remainder;
                Math.DivRem(totalRows, pageSize, out remainder);
                if (remainder > 0)
                {
                    totalPages += 1;
                }
            }

            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GoogleCheckoutLog_SelectPage", 3);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
            sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
            return sph.ExecuteReader();
        }
        public static Guid GetDraftSubmitter(Guid contentWorkflowGuid)
        {
            Guid result = Guid.Empty;
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflowAuditHistory_GetDraftSubmitter", 1);
            sph.DefineSqlParameter("@ContentWorkflowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentWorkflowGuid);
            using (IDataReader reader = sph.ExecuteReader())
            {
                if (reader.Read())
                {
                    result = new Guid(reader[0].ToString());
                }
            }

            return result;
        }
 /// <summary>
 /// Gets an IDataReader with one row from the ws_GoogleCheckoutLog table.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 public static IDataReader GetMostRecentByOrder(string googleOrderId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GoogleCheckoutLog_SelectMostRecentByOrder", 1);
     sph.DefineSqlParameter("@OrderNumber", SqlDbType.NVarChar, 50, ParameterDirection.Input, googleOrderId);
     return sph.ExecuteReader();
 }
 /// <summary>
 /// Gets an IDataReader with one row from the mp_GoogleCheckoutLog table.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 public static IDataReader GetOne(Guid rowGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GoogleCheckoutLog_SelectOne", 1);
     sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
     return sph.ExecuteReader();
 }
Example #54
0
 /// <summary>
 /// Gets an IDataReader with rows from the mp_FileAttachment table.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 public static IDataReader SelectBySpecial2(Guid specialGuid2)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_FileAttachment_SelectBySpecial2", 1);
     sph.DefineSqlParameter("@SpecialGuid2", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid2);
     return sph.ExecuteReader();
 }
Example #55
0
 public static IDataReader GetPoll(Guid pollGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Polls_SelectOne", 1);
     sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
     return sph.ExecuteReader();
 }
Example #56
0
 public static IDataReader GetPollByModuleID(int moduleID)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Polls_SelectOneByModuleID", 1);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleID);
     return sph.ExecuteReader();
 }
Example #57
0
 public static IDataReader GetByModule(Guid moduleGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Tag_SelectByModule", 1);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     return sph.ExecuteReader();
 }
Example #58
0
 /// <summary>
 /// Gets an IDataReader with rows from the mp_EmailSendQueue table where DateToSend >= CurrentTime.
 /// </summary>
 /// <param name="currentTime"> currentTime </param>
 public static IDataReader GetEmailToSend(DateTime currentTime)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_EmailSendQueue_SelectForSending", 1);
     sph.DefineSqlParameter("@CurrentTime", SqlDbType.DateTime, ParameterDirection.Input, currentTime);
     return sph.ExecuteReader();
 }
Example #59
0
 public static IDataReader GetFullfillDownloadTermsPage(
     Guid storeGuid,
     int pageNumber,
     int pageSize)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_FullfillDownloadTerms_SelectPage", 3);
     sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
     sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
     sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
     return sph.ExecuteReader();
 }
Example #60
0
 public static IDataReader GetAll(Guid storeGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_FullfillDownloadTerms_SelectAll", 1);
     sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
     return sph.ExecuteReader();
 }