public static qPtl_InvitationTemplate GetTemplateByScopeID(int scope_id)
        {
            var template = new qPtl_InvitationTemplate();

            template.container.Select(new DbQuery
            {
                Where      = "Available = 'Yes' AND MarkAsDelete = 0 AND ScopeID = @ScopeID",
                Parameters = new SqlQueryParameter[] { new SqlQueryParameter("@ScopeID", scope_id) }
            });

            return(template);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            hplRefreshBottom.NavigateUrl = Request.Url.ToString();
            hplRefreshTop.NavigateUrl = Request.Url.ToString();

            // load styles for this project
            string css_text_file = string.Empty;
            if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["CmsTextCSS"]))
                css_text_file = Convert.ToString(ConfigurationManager.AppSettings["CmsTextCSS"]);

            reHeader.CssFiles.Add(css_text_file);
            reFooter.CssFiles.Add(css_text_file);

            qPtl_InvitationTemplate template = new qPtl_InvitationTemplate(Convert.ToInt32(Context.Items["ScopeID"]));

            if (template != null)
            {
                if (template.InvitationTemplateID > 0)
                {
                    reHeader.Content = template.Header;
                    reFooter.Content = template.Footer;
                }
            }

            // configure print link
            string baseURL = ConfigurationManager.AppSettings["returnURL"];
            string rawURL = string.Empty;

            rawURL = baseURL + "/qDbs/print/print-individual-invitations.aspx?invitationID=-1";      // example invitation

            string passURL = Server.UrlEncode(rawURL);
            string timeStamp = Convert.ToString(DateTime.Now.Month) + "-" + Convert.ToString(DateTime.Now.Day) + "-" + Convert.ToString(DateTime.Now.Year);
            hplPrint.NavigateUrl = "~/qDbs/GeneratePDF.aspx?PageOrientation=landscape&htmlSource=" + passURL + "&mode=read&pdfOutput=example_invitation_UserID_" + Context.Items["UserID"] + "_" + timeStamp + ".pdf";
            hplPrint.Target = "_blank";
        }
    }
        public static qPtl_InvitationTemplate GetTemplateByScopeID(int scope_id)
        {
            var template = new qPtl_InvitationTemplate();

            template.container.Select(new DbQuery
            {
                Where = "Available = 'Yes' AND MarkAsDelete = 0 AND ScopeID = @ScopeID",
                Parameters = new SqlQueryParameter[] { new SqlQueryParameter("@ScopeID", scope_id) }
            });

            return template;
        }