protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId))
            {
                return;
            }

            SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId);

            if (shipper == null)
            {
                return;
            }

            this.litStoreName = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreName");

            this.litStoreOwnerName = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreOwnerName");

            this.litStoreAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreAddress");

            this.SupplierADImg = (System.Web.UI.WebControls.Image) this.FindControl("SupplierADImg");

            this.litStoreName.Text = string.IsNullOrWhiteSpace(shipper.ShopName) ? shipper.SupplierName : shipper.ShopName; //shipper.SupplierName;

            this.litStoreOwnerName.Text = shipper.ShopOwner;

            this.litStoreAddress.Text = RegionHelper.GetFullRegion(shipper.County, "");

            if (!string.IsNullOrWhiteSpace(shipper.PCImage))
            {
                this.SupplierADImg.ImageUrl = shipper.PCImage;
            }
        }
Example #2
0
 private void LlamoSQL_Literal(string mySQL, System.Web.UI.WebControls.Literal LiteralAux)
 {
     try
     {
         ///////////  Aqui llama al SQL
         ShowQuery(mySQL);
         var mydatareader = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(mySQL);
         if (mydatareader.Read())
         {
             LiteralAux.Text = mydatareader.GetString(0);
         }
         else
         {
             LiteralAux.Text = "";
         }
     }
     catch (Exception ex) // error
     {
         ShowQuery(mySQL);
         if (IsEditable)                      // si es administrador muestra el mensaje
         {
             LiteralException.Visible = true; // prende el literal de Excepcion para mostrarlo
             LiteralException.Text    = LiteralException.Text + "<br />La query es : " + mySQL + "<br />";
         }
         Excepcion(ex);
     }
 }
Example #3
0
 protected override void AttachChildControls()
 {
     this.litJSApi          = (System.Web.UI.WebControls.Literal) this.FindControl("litJSApi");
     this.litSitesList      = (System.Web.UI.WebControls.Literal) this.FindControl("litSitesList");
     this.litSitesList.Text = RegisterSitesScript();
     litJSApi.Text          = GetJSApiScript();
 }
Example #4
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId))
            {
                base.GotoResourceNotFound();
                return;
            }

            SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId);

            if (shipper == null)
            {
                base.GotoResourceNotFound();
                return;
            }

            this.rptProducts         = (ThemedTemplatedRepeater)this.FindControl("rptProducts");
            this.hotSale             = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale");//销售排行
            this.pager               = (Pager)this.FindControl("pager");
            this.litSearchResultPage = (System.Web.UI.WebControls.Literal) this.FindControl("litSearchResultPage");


            if (!this.Page.IsPostBack)
            {
                this.BindSearch();
            }
        }
Example #5
0
        private void GetSimulatorResult(string moneda, string monto)
        {
            SimuladoresServiceClient          simServiceClient           = new SimuladoresServiceClient();
            SimulacionDPFIncrementalPeticion  simDPFIncrementalPeticion  = new SimulacionDPFIncrementalPeticion();
            SimulacionDPFIncrementalRespuesta simDPFIncrementalRespuesta = new SimulacionDPFIncrementalRespuesta();

            simDPFIncrementalPeticion.Usuario  = System.Configuration.ConfigurationManager.AppSettings["SimuladoresUsuario"];
            simDPFIncrementalPeticion.Password = System.Configuration.ConfigurationManager.AppSettings["SimuladoresContrasena"];
            simDPFIncrementalPeticion.Moneda   = Int32.Parse(moneda);
            simDPFIncrementalPeticion.Monto    = Decimal.Parse(monto);

            simDPFIncrementalRespuesta = simServiceClient.SimularDPFIncremental(simDPFIncrementalPeticion);

            EmisionDPFIncrementalInfo[] emisiones = simDPFIncrementalRespuesta.Emisiones;
            string totalInteresGanado             = simDPFIncrementalRespuesta.TotalInteresGanado.ToString("N");

            ltrMessage.Text = this.GetFormatedResult(emisiones, totalInteresGanado);

            if (simDPFIncrementalRespuesta.Resultado != 0)
            {
                System.Web.UI.WebControls.Literal resultMessage = new System.Web.UI.WebControls.Literal();
                resultMessage.Text = "<p>" + simDPFIncrementalRespuesta.MensajeResultado + "</p>";

                this.Controls.Clear();
                this.Controls.Add(resultMessage);
            }
        }
Example #6
0
        private void SetRowValue(System.Web.UI.WebControls.Literal status)
        {
            switch (status.Text)
            {
            case "0":
                status.Text = "未认领";
                break;

            case "4":
                status.Text = "已认领";
                break;

            case "1":
                status.Text = "已申报";
                break;

            case "2":
                status.Text = "申报成功";
                break;

            case "3":
                status.Text = "申报失败";
                break;

            case "5":
                status.Text = "异常处理";
                break;
            }
        }
Example #7
0
        /// <summary>
        /// this method does something awesome
        /// </summary>
        void RenderCodeLiteral(string Query, System.Web.UI.WebControls.Literal LiteralAux)
        {
            if (Settings.Contains(Query))
            {
                var mySQL = ReemplazoTags(Query);
                if (mySQL.Trim() != "")
                {
                    var myDefaultValues = GetDefaultValues(mySQL);
                    //Reemplazar lo que tenemos:
                    mySQL = ReemplazoKeys(mySQL, myDefaultValues);
                    //Reemplazar lo que NO tenemos:
                    mySQL = ReemplazoDefaultValue(mySQL, myDefaultValues);
                    // Llamo al SQL
                    LlamoSQL_Literal(mySQL, LiteralAux);
                }
                else
                {
                    AvisoNoHaySqlQuery(Query);
                }
            }

            else
            {
                AvisoNoHaySqlQuery(Query);
            }
        }
Example #8
0
 //- @InstantiateIn -//
 public void InstantiateIn(System.Web.UI.Control container)
 {
     System.Web.UI.WebControls.Literal literal = new System.Web.UI.WebControls.Literal();
     literal.DataBinding += new EventHandler(delegate(Object sender, EventArgs ea)
     {
         IDataItemContainer item = (IDataItemContainer)container;
         String url       = DataBinder.Eval(item.DataItem, "Url").ToString();
         String monthText = DataBinder.Eval(item.DataItem, "MonthText").ToString();
         String year      = DataBinder.Eval(item.DataItem, "Year").ToString();
         String count     = DataBinder.Eval(item.DataItem, "Count").ToString();
         //+
         String template;
         if (showEntryCount)
         {
             template = @"<li><a href=""{Url}"">{MonthText} {Year} ({Count})</a></li>";
         }
         else
         {
             template = @"<li><a href=""{Url}"">{MonthText} {Year}</a></li>";
         }
         //+
         literal.Text = template
                        .Replace("{Url}", url)
                        .Replace("{MonthText}", monthText)
                        .Replace("{Year}", year)
                        .Replace("{Count}", count);
     });
     container.Controls.Add(literal);
 }
 protected void auto_RetrieveAutoCompleterItems(object sender, AutoCompleter.RetrieveAutoCompleterItemsEventArgs e)
 {
     if (e.Query.Trim() == string.Empty)
     {
         return;
     }
     foreach (QuizItem idx in QuizItem.Search(e.Query))
     {
         AutoCompleterItem a = new AutoCompleterItem();
         System.Web.UI.WebControls.Literal lit = new System.Web.UI.WebControls.Literal();
         string tmpHeader = idx.Header;
         foreach (string idxStr in e.Query.Split(' '))
         {
             int index = tmpHeader.IndexOf(idxStr, StringComparison.InvariantCultureIgnoreCase);
             if (index != -1)
             {
                 tmpHeader = tmpHeader.Insert(index + idxStr.Length, "</span>");
                 tmpHeader = tmpHeader.Insert(index, "<span class=\"found\">");
             }
         }
         lit.Text = string.Format("<a href=\"{0}\">{1}</a>", idx.Url, tmpHeader);
         a.Controls.Add(lit);
         e.Controls.Add(a);
     }
 }
Example #10
0
        private void RenderTitlePorletInDiv()
        {
            // Create div portlet header
            PSCPanel divHeader = new PSCPanel();

            divHeader.CssClass = "psc-divPortlet-Header";
            Controls.AddAt(0, divHeader);

            //Title Porlet
            System.Web.UI.WebControls.Literal lblTitle = new System.Web.UI.WebControls.Literal();
            lblTitle.Text = string.Format("<span>{0}</span>", Portlet.PortletInstance.Portlet.Name);
            divHeader.Controls.Add(lblTitle);

            //Button Edit
            LiteralControl btnEdit = new LiteralControl();

            btnEdit.Text = string.Format("<img src='{0}' onclick=\"{1}\" title='Hiệu chỉnh Dữ liệu' class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditData.png", string.Format("PortletEditData('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet");
            divHeader.Controls.Add(btnEdit);

            //Button giao dien
            LiteralControl btnEditApperance = new LiteralControl();

            btnEditApperance.Text = string.Format("<img src='{0}' onclick=\"{1}\" title='Hiệu chỉnh CSS' class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditApperance.png", string.Format("PortletEditCSS('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet CSS");
            divHeader.Controls.Add(btnEditApperance);


            // Button Delete
            LiteralControl btnDelete = new LiteralControl();

            btnDelete.Text = string.Format("<img src='{0}' onclick=\"{1}\" title='Xóa Porlet' class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletDelete.png", string.Format("PortletRemove('{0}','{1}');", Portlet.PortletInstance.Id, Portlet.PortletInstance.Name), "ButtonImage", "Remove Portlet");
            divHeader.Controls.Add(btnDelete);
        }
Example #11
0
        private void GetSimulatorResult(string moneda, string monto, string plazo)
        {
            SimuladoresServiceClient simServiceClient = new SimuladoresServiceClient();
            SimulacionDPFPeticion    simDPFPeticion   = new SimulacionDPFPeticion();
            SimulacionDPFRespuesta   simDPFRespuesta  = new SimulacionDPFRespuesta();

            simDPFPeticion.Usuario     = System.Configuration.ConfigurationManager.AppSettings["SimuladoresUsuario"];
            simDPFPeticion.Password    = System.Configuration.ConfigurationManager.AppSettings["SimuladoresContrasena"];
            simDPFPeticion.Moneda      = Int32.Parse(moneda);
            simDPFPeticion.Monto       = Decimal.Parse(monto);
            simDPFPeticion.PlazoEnDias = Int32.Parse(plazo);

            simDPFRespuesta = simServiceClient.SimularDPF(simDPFPeticion);

            decimal interes            = simDPFRespuesta.Interes;
            decimal iva                = simDPFRespuesta.Iva;
            decimal montoInteresConNit = simDPFRespuesta.MontoInteresConNit;
            decimal montoInteresSinNit = simDPFRespuesta.MontoInteresSinNit;
            decimal montoRetencionIva  = simDPFRespuesta.MontoRetencionIva;

            ltrMessage.Text = this.GetFormatedResult(interes, iva, montoInteresConNit, montoInteresSinNit, montoRetencionIva);

            if (simDPFRespuesta.Resultado != 0)
            {
                System.Web.UI.WebControls.Literal resultMessage = new System.Web.UI.WebControls.Literal();
                resultMessage.Text = "<p>" + simDPFRespuesta.MensajeResultado + "</p>";

                this.Controls.Clear();
                this.Controls.Add(resultMessage);
            }
        }
Example #12
0
 protected override void AttachChildControls()
 {
     this.rptHelps       = (ThemedTemplatedRepeater)this.FindControl("rptHelps");
     this.pager          = (Pager)this.FindControl("pager");
     this.lblCategory    = (System.Web.UI.WebControls.Label) this.FindControl("lblCategory");
     this.lblhelpName    = (System.Web.UI.WebControls.Label) this.FindControl("lblhelpName");
     this.lblhelpcontent = (System.Web.UI.WebControls.Literal) this.FindControl("lblhelpcontent");
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["helpid"]))
         {
             int helpid = 0;
             int.TryParse(this.Page.Request.QueryString["helpid"], out helpid);
             HelpInfo helpInfo = CommentBrowser.GetHelp(helpid);
             if (helpInfo != null)
             {
                 HelpCategoryInfo helpCategory = CommentBrowser.GetHelpCategory(helpInfo.CategoryId);
                 PageTitle.AddSiteNameTitle(helpInfo.Title);
                 this.lblCategory.Text    = helpCategory.Name;
                 this.lblhelpName.Text    = helpInfo.Title;
                 this.lblhelpcontent.Text = helpInfo.Content;
             }
         }
         this.BindList();
     }
 }
Example #13
0
        protected override void AttachChildControls()
        {
            this.serach_text    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_text");
            this.search_Subtext = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_Subtext");
            this.rptProducts    = (ThemedTemplatedRepeater)this.FindControl("rptProducts");

            this.pager               = (Pager)this.FindControl("pager");
            this.litProductCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCount");
            this.litSupplierDescribe = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierDescribe");

            if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId))
            {
                base.GotoResourceNotFound();
                return;
            }

            SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId);

            if (shipper == null)
            {
                base.GotoResourceNotFound();
                return;
            }
            else
            {
                litSupplierDescribe.Text = shipper.Description;
            }

            if (!this.Page.IsPostBack)
            {
                this.BindSearch();
            }
        }
Example #14
0
        private Literal AddLiteral(Control parent, string text)
        {
            Literal literal = new Literal();

            literal.Text = Server.HtmlEncode(text);
            parent.Controls.Add(literal);
            return(literal);
        }
Example #15
0
        public void dlstHSDeclare_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow)
            {
                System.Web.UI.WebControls.Literal lblDeclareStatus = (System.Web.UI.WebControls.Literal)e.Row.FindControl("litDeclareStatus");

                SetRowValue(lblDeclareStatus);
            }
        }
Example #16
0
        /// <summary>
        /// 生成微信配置
        /// </summary>
        private void InitWxConfig()
        {
            timestamp    = DateTime.Now.ToWeChatSecondFromDateTime().ToString();
            noncestr     = WeChatHelper.GetRandomString(16);
            url          = Request.Url.AbsoluteUri;
            jsapi_ticket = WeChatAppInfo.ticket;

            List <Dictionary <string, string> > sortList = new List <Dictionary <string, string> >()
            {
                new Dictionary <string, string>()
                {
                    { "key", "jsapi_ticket" }, { "value", jsapi_ticket }
                },
                new Dictionary <string, string>()
                {
                    { "key", "noncestr" }, { "value", noncestr }
                },
                new Dictionary <string, string>()
                {
                    { "key", "timestamp" }, { "value", timestamp }
                },
                new Dictionary <string, string>()
                {
                    { "key", "url" }, { "value", url }
                }
            };


            StringBuilder keyValueSB = new StringBuilder();

            foreach (Dictionary <string, string> item in sortList)
            {
                keyValueSB.AppendFormat("{0}={1}&", item["key"], item["value"]);
            }
            keyValueSB.Remove(keyValueSB.Length - 1, 1);
            string str = keyValueSB.ToString();

            hash = WeChatHelper.GetSHA1EnryptStr(str);

            System.Web.UI.WebControls.Literal wxConfig = new System.Web.UI.WebControls.Literal();
            wxConfig.Text = string.Format(@"
    <script src='/Resource/js/jquery-1.8.2.js'></script>
    <script src='/Resource/js/jweixin-1.0.0.js'></script>
<script defer='defer'>
wx.config({{
    debug: {0}, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
    appId: '{1}', // 必填,公众号的唯一标识
    timestamp: '{2}', // 必填,生成签名的时间戳
    nonceStr: '{3}', // 必填,生成签名的随机串
    signature: '{4}',// 必填,签名,见附录1
    jsApiList: [{5}] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
}});
</script>
", WeChatAppInfo.SDKDebugger, Common.WeChatAppInfo.AppID, timestamp, noncestr, hash, WeChatAppInfo.SDKjsApiList);

            Page.Header.Controls.AddAt(0, wxConfig);
        }
Example #17
0
        /// <summary>
        /// Upload a image file, show thumbnail and return the saved path
        /// </summary>
        /// <param name="ctrlFileUpload"></param>
        /// <returns></returns>
        public static string uploadImageFile(
            System.Web.UI.WebControls.FileUpload ctrlFileUpload,  // FileUpload Control
            System.Web.UI.WebControls.Literal litImagePreview,    // Show the upload image
            System.Web.UI.Page page)
        {
            bool   fileOK           = false;
            String fileExtension    = string.Empty;
            string uploadTempFolder = GetTempFolderPath();

            if (ctrlFileUpload.HasFile)
            {
                fileExtension = System.IO.Path.GetExtension(ctrlFileUpload.FileName).ToLower();
                String[] allowedExtensions = { ".jpg", ".png", ".bmp", ".jpeg" };
                for (int i = 0; i < allowedExtensions.Length; i++)
                {
                    if (fileExtension == allowedExtensions[i])
                    {
                        fileOK = true;
                        break;
                    }
                }
            }

            // Check file type
            if (!fileOK)
            {
                string strScript = string.Format("window.setTimeout(\"{0}\", 100);", "alert('仅支持上传图片格式的文件!');");
                page.ClientScript.RegisterClientScriptBlock(typeof(string), "uploadPurposeImage", strScript, true);
                return("");
            }

            // Check length, can't exceed 4M
            if (ctrlFileUpload.FileBytes.Length > 4 * 1024 * 1024)
            {
                string strScript = string.Format("window.setTimeout(\"{0}\", 100);", "alert('文件大小超过限制,请编辑后重试!');");
                page.ClientScript.RegisterClientScriptBlock(typeof(string), "uploadPurposeImage", strScript, true);
                return("");
            }

            try
            {
                string strFileName = Guid.NewGuid().ToString() + fileExtension;
                string strFilePath = uploadTempFolder + strFileName;
                ctrlFileUpload.SaveAs(strFilePath);
                string strScript = string.Format("window.setTimeout(\"{0}\", 100);", "alert('文件上传成功');");
                page.ClientScript.RegisterClientScriptBlock(typeof(string), "uploadPurposeImage", strScript, true);
                //litImagePreview.Text = string.Format("<img width=\"100\" height=\"100\" src=\"/temp/{0}\" />", strFileName);
                ShowThumbnail(litImagePreview, strFileName);
                return(strFilePath);
            }
            catch
            {
                string strScript = string.Format("window.setTimeout(\"{0}\", 100);", "alert('文件上传失败!请重试!');");
                page.ClientScript.RegisterClientScriptBlock(typeof(string), "uploadPurposeImage", strScript, true);
                return("");
            }
        }
Example #18
0
        protected override void AttachChildControls()
        {
            this.litAD = (System.Web.UI.WebControls.Literal) this.FindControl("litAD");
            IList <CouponInfo> couponList = CouponHelper.GetCouponsBySendType(5);

            if (couponList != null && couponList.Count > 0)
            {
                litAD.Text = "True";
            }
            PageTitle.AddSiteNameTitle("绑定手机号码");
        }
Example #19
0
        void BuildTagsControl(System.Web.UI.WebControls.Literal literalTags)
        {
            try
            {
                string        tagEntitiesJson = string.Empty;
                var           tagEntities     = new List <TagEntity>();
                StringBuilder list            = new StringBuilder();
                var           appDomain       = AppDomain.CurrentDomain;
                var           basePath        = appDomain.BaseDirectory;
                var           tags            = TagsSearch();
                var           jsonSerialiser  = new JavaScriptSerializer();
                var           tagsJson        = jsonSerialiser.Serialize(tags);
                var           path            = Path.Combine(basePath, HTMLTemplatePath);
                var           html            = System.IO.File.ReadAllText(path);

                html = html.Replace("($tags$)", tagsJson);

                if (!string.IsNullOrEmpty(Value))
                {
                    var tagList = jsonSerialiser.Deserialize <List <TagEntity> >(Value);
                    foreach (var tag in tagList)
                    {
                        var id = tag.id;
                        if (id != "0")
                        {
                            ID parsedId;
                            Sitecore.Data.ID.TryParse(id, out parsedId);
                            if (!Sitecore.Data.ID.IsNullOrEmpty(parsedId))
                            {
                                var item = Client.ContentDatabase.GetItem(parsedId);
                                if (item != null)
                                {
                                    var title = !string.IsNullOrWhiteSpace(item[TitleField]) ? item[TitleField] : item.Name;
                                    list.Append(string.Format("<li data-id='{0}'>{1}</li>", item.ID.ToString(), title));
                                    tagEntities.Add(new TagEntity {
                                        id = item.ID.ToString(), label = title
                                    });
                                }
                            }
                        }
                    }
                    tagEntitiesJson = jsonSerialiser.Serialize(tagEntities);
                }
                html = html.Replace("($avalilableTags$)", list.ToString());
                html = html.Replace("($jsonObject$)", string.IsNullOrEmpty(tagEntitiesJson) ? "[]" : HttpUtility.HtmlEncode(tagEntitiesJson));
                html = html.Replace("($inputid$)", InputId);
                //html = html.Replace("($controlId$)", this.InputId);
                literalTags.Text = html;
            }
            catch (Exception ex)
            {
                Log.Error("TagField - BuildTagsControl method caused an unhandled exception", ex, this);
            }
        }
Example #20
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            var videoPlayer = new System.Web.UI.WebControls.Literal();

            videoPlayer.Text = $"<video controls autoplay width='{Width}' height='{Height}'><source src='{_Source}' type='video/mp4'></video>";

            Controls.Clear();
            Controls.Add(videoPlayer);
        }
Example #21
0
        protected override void AttachChildControls()
        {
            string url = this.Page.Request.QueryString["returnUrl"];

            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"]))
            {
                this.Page.Response.Redirect(url);
            }
            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                this.Page.Response.Redirect("/Vshop/Login.aspx");
            }

            this.rptProducts     = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litProFavCount  = (System.Web.UI.WebControls.Literal) this.FindControl("litProFavCount");
            this.litSuppFavCount = (System.Web.UI.WebControls.Literal) this.FindControl("litSuppFavCount");
            this.txtTotal        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");

            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 8;
            }

            //
            ProductFavoriteQuery query = new ProductFavoriteQuery();

            query.PageIndex = pageIndex;
            query.PageSize  = pageSize;
            query.UserId    = member.UserId;
            query.GradeId   = member.GradeId;


            DbQueryResult dr = ProductBrowser.GetFavorites(query);

            this.rptProducts.DataSource = dr.Data;
            this.rptProducts.DataBind();

            this.litProFavCount.Text  = dr.TotalRecords.ToString();
            this.litSuppFavCount.Text = SupplierHelper.GetUserSupplierCollectCount(member.UserId).ToString();
            this.txtTotal.SetWhenIsNotNull(dr.TotalRecords.ToString());

            PageTitle.AddSiteNameTitle("我的收藏");
        }
Example #22
0
        protected override void OnLoad(EventArgs e)
        {
            var literalTags = new System.Web.UI.WebControls.Literal();

            if (!Sitecore.Context.ClientPage.IsEvent)
            {
                BuildTagsControl(literalTags);
                Controls.Add(literalTags);
            }
            else
            {
                /*This line to make sure to add new tag item only when the triggered event is save, this event it will be rasied by one of the following actions:
                 * 1) Click save from ribbon.
                 * 2) Shortcut cltr + save.
                 * 3) When you change the field and you go to other item without click save aciton, the dialog of "save itme changes" will appear
                 *  and ask you if you want to save the changes, then you click "Yes"*/
                var eventType      = Sitecore.Context.ClientPage.ClientRequest.Parameters;
                var tagEntities    = new List <TagEntity>();
                var jsonSerialiser = new JavaScriptSerializer();
                if (Context.Request.Form[string.Format("hdnJsonObject{0}", InputId)] != null)
                {
                    var tagList = jsonSerialiser.Deserialize <List <TagEntity> >(Context.Request.Form[string.Format("hdnJsonObject{0}", InputId)]);
                    if (eventType.Equals("contenteditor:save") || eventType.Contains("item:save"))
                    {
                        var createItemTasks = new List <Task>();
                        foreach (var tag in tagList)
                        {
                            if (tag.id == "0")
                            {
                                /* I created another task to create sitecore item, the reason behind that is when you create an item here in this place sitecore will take
                                 * you to the newly created item in the tree which is this is the default behavior for sitecore, but for this control if new tag added not already
                                 * exists in the tag repositroy, then i want to create that tage in the reop and get the newly tag item id, and save it in raw value of the field.*/
                                var contentDatabase = Client.ContentDatabase;
                                var task            = Task.Run(() => CreateItem(tag.label, contentDatabase));
                                task.Wait(1);
                                var item = task.Result;
                                tagList.First(p => p.label.Equals(tag.label)).id = item.ID.ToString();
                            }
                        }
                    }
                    var value = jsonSerialiser.Serialize(tagList) ?? "";
                    Sitecore.Context.ClientPage.Modified = (Value != value);
                    if (value != null && value != Value)
                    {
                        Value = value;
                    }
                }
            }
            base.OnLoad(e);
        }
Example #23
0
        /// <summary>
        /// Shows the message in default message container 'oo-messageContainer"
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="messageContent">Content of the message.</param>
        /// <param name="messageType">Type of the message.</param>
        public static void ShowMessage(this Page page, string messageContent, Global.Enum.MessageType messageType)
        {
            var pnlMessage = page.FindControlRecursive("pnlMessage") as System.Web.UI.WebControls.Panel;
            var liMessage  = new System.Web.UI.WebControls.Literal
            {
                Text =
                    @"<div id=""wNv-messageContainer"" class=""" + messageType.ToString().ToLower() +
                    @""" style=""display: inline-block; "">" + messageContent + @"</div>"
            };

            if (pnlMessage != null)
            {
                pnlMessage.Controls.Add(liMessage);
            }
        }
Example #24
0
        protected override void AttachChildControls()
        {
            this.litSitesList     = (System.Web.UI.WebControls.Literal) this.FindControl("litSitesList");
            this.rpthistorysearch = (WapTemplatedRepeater)this.FindControl("rpthistorysearch");

            this.litSitesList.Text = RegisterSitesScript();

            int userId = HiContext.Current.User.UserId;

            if (userId > 0)
            {
                this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.WAP, 6);
                this.rpthistorysearch.DataBind();
            }
        }
Example #25
0
        protected override void AttachChildControls()
        {
            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                this.Page.Response.Redirect("/WapShop/Login.aspx");
            }
            this.litPaymentBalance           = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentBalance");
            this.litBalanceDrawRequestAmount = (System.Web.UI.WebControls.Literal) this.FindControl("litBalanceDrawRequestAmount");
            if (litPaymentBalance != null)
            {
                this.litPaymentBalance.SetWhenIsNotNull(member.Balance.ToString("F2"));
            }
            BindDrawRecords();
        }
Example #26
0
        protected override void AttachChildControls()
        {
            this.serach_text    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_text");
            this.search_Subtext = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_Subtext");
            this.rptProducts    = (ThemedTemplatedRepeater)this.FindControl("rptProducts");

            this.pager               = (Pager)this.FindControl("pager");
            this.litProductCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCount");
            this.litSupplierDescribe = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierDescribe");


            if (!this.Page.IsPostBack)
            {
                this.BindSearch();
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();

            try
            {
                this.GetSimulatorInitialValues();
            }
            catch (Exception ex)
            {
                this.Controls.Clear();
                System.Web.UI.WebControls.Literal errorMessage = new System.Web.UI.WebControls.Literal();
                errorMessage.Text = ex.Message;
                this.Controls.Add(errorMessage);
            }
        }
Example #28
0
 //+
 //- @InstantiateIn -//
 public void InstantiateIn(System.Web.UI.Control container)
 {
     System.Web.UI.WebControls.Literal literal = new System.Web.UI.WebControls.Literal();
     literal.DataBinding += new EventHandler(delegate(Object sender, EventArgs ea)
     {
         IDataItemContainer item = (IDataItemContainer)container;
         String url   = DataBinder.Eval(item.DataItem, "Url").ToString();
         String title = DataBinder.Eval(item.DataItem, "Title").ToString();
         //+
         if (!String.IsNullOrEmpty(this.WebDomainName))
         {
             url = Themelia.Web.WebDomain.GetUrl(this.WebDomainName) + Themelia.Web.UrlCleaner.FixWebPathHead(url);
         }
         literal.Text = @"<li><a href=""{Url}"">{Title}</a></li>"
                        .Replace("{Url}", url)
                        .Replace("{Title}", title);
     });
     container.Controls.Add(literal);
 }
Example #29
0
        /// <summary>
        /// 生成微信配置
        /// </summary>
        private void InitWxConfig()
        {
            timestamp = DateTime.Now.ToWeChatSecondFromDateTime().ToString();
            noncestr = WeChatHelper.GetRandomString(16);
            url = Request.Url.AbsoluteUri;
            jsapi_ticket = WeChatAppInfo.ticket;

            List<Dictionary<string, string>> sortList = new List<Dictionary<string, string>>() {
                new Dictionary<string, string>(){{"key","jsapi_ticket"},{"value",jsapi_ticket}},
                new Dictionary<string, string>(){{"key","noncestr"},{"value",noncestr}},
                new Dictionary<string, string>(){{"key","timestamp"},{"value",timestamp}},
                new Dictionary<string, string>(){{"key","url"},{"value",url}}
            };

            StringBuilder keyValueSB = new StringBuilder();
            foreach (Dictionary<string, string> item in sortList)
            {
                keyValueSB.AppendFormat("{0}={1}&", item["key"], item["value"]);
            }
            keyValueSB.Remove(keyValueSB.Length - 1, 1);
            string str = keyValueSB.ToString();

            hash = WeChatHelper.GetSHA1EnryptStr(str);

            System.Web.UI.WebControls.Literal wxConfig = new System.Web.UI.WebControls.Literal();
            wxConfig.Text=string.Format(@"
            <script src='/Resource/js/jquery-1.8.2.js'></script>
            <script src='/Resource/js/jweixin-1.0.0.js'></script>
            <script defer='defer'>
            wx.config({{
            debug: {0}, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
            appId: '{1}', // 必填,公众号的唯一标识
            timestamp: '{2}', // 必填,生成签名的时间戳
            nonceStr: '{3}', // 必填,生成签名的随机串
            signature: '{4}',// 必填,签名,见附录1
            jsApiList: [{5}] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
            }});
            </script>
            ",WeChatAppInfo.SDKDebugger, Common.WeChatAppInfo.AppID, timestamp, noncestr, hash,WeChatAppInfo.SDKjsApiList);

            Page.Header.Controls.AddAt(0,wxConfig);
        }
Example #30
0
 //- #OnPreRender -//
 protected override void OnPreRender(EventArgs e)
 {
     if (Visibility == Visibility.ClientHidden)
     {
         throw new InvalidOperationException(String.Format(Resource.Control_ClientHiddenNotCompatible, "Nalarium.Web.Controls.HiddenField"));
     }
     if (Visibility != Visibility.ServerHidden)
     {
         System.Web.UI.WebControls.Literal literal = new System.Web.UI.WebControls.Literal
         {
             Text = String.Format("<input name=\"{0}\" id=\"{1}\" type=\"hidden\" value=\"{2}\" />", UniqueID, ClientID, Value)
         };
         Controls.Add(literal);
     }
     //+ state
     if (!Form.SurpressState && Http.Method == HttpVerbs.Get)
     {
         StateTracker.Set(StateEntryType.ControlId, ID, UniqueID);
     }
     //+
     base.OnPreRender(e);
 }
Example #31
0
        public long GetCustomerNum(System.Web.UI.WebControls.Literal Message)
        {
            long CustomerNum = 0;

            try {
                Message.Text = "";
                if (HttpContext.Current.Session["CustomerNum"] == null)
                {
                    return(0);
                }
                Int64.TryParse(HttpContext.Current.Session["CustomerNum"].ToString(), out CustomerNum);
                if (CustomerNum != 0)
                {
                    Message.Text = "LoggedIn";
                }
            }
            catch (Exception ex) {
                Logger.LogError(ex);
                return(CustomerNum);
            }
            return(CustomerNum);
        }
Example #32
0
 protected override void AttachChildControls()
 {
     this.litUserName        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName");
     this.lblBanlance        = (FormatedMoneyLabel)this.FindControl("lblBanlance");
     this.txtAmount          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAmount");
     this.txtBankName        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtBankName");
     this.txtAccountName     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAccountName");
     this.txtMerchantCode    = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMerchantCode");
     this.txtRemark          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtRemark");
     this.txtTradePassword   = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTradePassword");
     this.btnDrawNext        = ButtonManager.Create(this.FindControl("btnDrawNext"));
     this.btnDrawNext.Click += new System.EventHandler(this.btnDrawNext_Click);
     PageTitle.AddSiteNameTitle("申请提现", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         Member member = Users.GetUser(HiContext.Current.User.UserId, false) as Member;
         if (!member.IsOpenBalance)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + string.Format("/user/OpenBalance.aspx?ReturnUrl={0}", System.Web.HttpContext.Current.Request.Url));
         }
         this.litUserName.Text  = HiContext.Current.User.Username;
         this.lblBanlance.Money = member.Balance - member.RequestBalance;
     }
 }
Example #33
0
 public Payment(System.Web.UI.Page _Page, System.Web.UI.WebControls.Literal _txtEncrypted, ShoppingCart _shc)
 {
     this.__Page = _Page;
     this.__txtEncrypted = _txtEncrypted;
     this.shc = _shc;
 }
Example #34
0
        public void registerAndSubmitPPForm(ShoppingCart _shc)
        {
            __pp_encrypted = getPPEncryptedString(_shc);
            __txtEncrypted.Text = "<input type='hidden' name='cmd' value='_s-xclick'><input id='encrypted' type='hidden' name='encrypted' value='" + __pp_encrypted + "'/>";
            __txtEncrypted.Visible=true;
            __Page.Form.Action = ConfigurationManager.AppSettings["PP_SubmitUrl"];
            __Page.Form.Method = "Post";
            __Page.ClientScript.RegisterStartupScript(__Page.GetType(), "PayPal", "document.forms[0].submit();", true);

            System.Web.UI.WebControls.Literal ltl = new System.Web.UI.WebControls.Literal();
            ltl.ID = "ltlRedirecting";
            ltl.Text = "Redirecting....<br /><input type='submit' name='submit' value='Pay Now' /> ";
        }
Example #35
0
        protected void CustomerPage()
        {
            ///////////////CLEAN THIS MORE///////////////

            //Example:
            //Authenticated
            //Customer Profile

            using (var context = new SidejobEntities())
            {
                var customer = (from c in context.CustomerGenerals
                                where c.CustomerID == 85
                                select c).FirstOrDefault();

                var customerportfolio = (from c in context.CustomerPortfolios
                                         where c.CustomerID == 85
                                         select c).FirstOrDefault();

                if (customer != null)
                {
                    var customertitle = customer.FirstName + " " + customer.LastName + " " + customer.CountryName + "," +
                                        customer.RegionName
                                        + "," + customer.CityName;

                    //Page Title  + Page Attributes like Profile, photo, add photo
                    Page.Title = customer.FirstName + " " + customer.LastName + "Profile or Images";
                    var nl1 = new System.Web.UI.WebControls.Literal {Text = Environment.NewLine};

                    //Title
                    var title = new HtmlMeta {Name = "title", Content = CrawlerStringLimit(customertitle)};
                    Page.Header.Controls.AddAt(1, title);

                    //Description
                    if (customerportfolio != null)
                    {
                        var customerdescription = customerportfolio.About;
                        var description = new HtmlMeta
                                              {Name = "description", Content = CrawlerStringLimit(customerdescription)};
                        Page.Header.Controls.AddAt(2, description);
                    }

                    //username +   + Page Attributes like Profile, photo, add photo
                    var keyword = customer.UserName + Resources.Resource.HomeKeywords;
                    var keywords = new HtmlMeta {Name = "keywords", Content = CrawlerStringLimit(keyword)};
                    Page.Header.Controls.AddAt(3, keywords);

                    //Author
                    var customerauthor = customer.FirstName + " " + customer.LastName;
                    var author = new HtmlMeta {Name = "auhtor", Content = CrawlerStringLimit(customerauthor)};
                    Page.Header.Controls.AddAt(4, author);
                }
            }
        }
Example #36
0
 public Payment(System.Web.UI.Page _Page, System.Web.UI.WebControls.Literal _txtEncrypted)
 {
     this.__Page = _Page;
     this.__txtEncrypted = _txtEncrypted ;
 }
Example #37
0
 /// <summary>
 /// Shows the message in default message container 'oo-messageContainer"
 /// </summary>
 /// <param name="page">The page.</param>
 /// <param name="messageContent">Content of the message.</param>
 /// <param name="messageType">Type of the message.</param>
 public static void ShowMessage(this Page page, string messageContent, Global.Enum.MessageType messageType)
 {
     var pnlMessage = page.FindControlRecursive("pnlMessage") as System.Web.UI.WebControls.Panel;
     var liMessage = new System.Web.UI.WebControls.Literal
                         {
                             Text =
                                 @"<div id=""wNv-messageContainer"" class=""" + messageType.ToString().ToLower() +
                                 @""" style=""display: inline-block; "">" + messageContent + @"</div>"
                         };
     if (pnlMessage != null) pnlMessage.Controls.Add(liMessage);
 }
Example #38
0
 protected void auto_RetrieveAutoCompleterItems(object sender, AutoCompleter.RetrieveAutoCompleterItemsEventArgs e)
 {
     if (e.Query.Trim() == string.Empty)
         return;
     foreach (QuizItem idx in QuizItem.Search(e.Query))
     {
         AutoCompleterItem a = new AutoCompleterItem();
         System.Web.UI.WebControls.Literal lit = new System.Web.UI.WebControls.Literal();
         string tmpHeader = idx.Header;
         foreach (string idxStr in e.Query.Split(' '))
         {
             int index = tmpHeader.IndexOf(idxStr, StringComparison.InvariantCultureIgnoreCase);
             if (index != -1)
             {
                 tmpHeader = tmpHeader.Insert(index + idxStr.Length, "</span>");
                 tmpHeader = tmpHeader.Insert(index, "<span class=\"found\">");
             }
         }
         lit.Text = string.Format("<a href=\"{0}\">{1}</a>", idx.Url, tmpHeader);
         a.Controls.Add(lit);
         e.Controls.Add(a);
     }
 }
Example #39
0
		private void RenderErrorPage(Bobs.SpottedException spottedEx)
		{
			HttpResponse resp = HttpContext.Current.Response;
			resp.Clear();
			resp.StatusCode = 500;

			System.Web.UI.WebControls.Literal openPage = new System.Web.UI.WebControls.Literal();
			openPage.Text = @"
<html><head><style>
.{
	font-family: Verdana;
	font-size:12px;
	font-weight:bold;
}
p{
	font-family: Verdana;
	font-size:12px;
	font-weight:bold;
	margin-bottom:3px;
	margin-top:3px;
	line-height:130%;
}
a:link, 
a:visited         { color:#000000; }
a:hover           { color:#FF0000; }
</style></head><body>&nbsp;<br>&nbsp;
<center>
<table width=""400"" cellpadding=""0"" cellspacing=""0"" border=""0"">
			<tr>
				<td valign=bottom align=left width=""100%"" rowspan=""2"">
				
				
<center>
<a href=""/""><img src=""/gfx/dsi-sign-100.png"" border=0 style=""border:1px solid #000000;""></a>
</center>

<div style=""padding:10px;"">
<div style=""width:100%;border:solid 1px #000000;padding:2px 4px 2px 4px; margin:0px 0px 13px 0px;"">
	";

			System.Web.UI.WebControls.Literal closePage = new System.Web.UI.WebControls.Literal();
			closePage.Text = @"
</div>
</td></tr></table>
</center></body></html>";

			System.Web.UI.WebControls.Label exceptionLabel = new System.Web.UI.WebControls.Label();
			exceptionLabel.Text = "<p>";

			if (spottedEx != null && spottedEx.ExceptionType == typeof(Bobs.MalformedUrlException).ToString())
			{
				exceptionLabel.Text += "Page not found.";
			}
			else if (spottedEx != null && (Bobs.Usr.Current != null && Bobs.Usr.Current.IsAdmin || HttpContext.Current.Request.UserHostAddress.StartsWith("84.45.14.") || HttpContext.Current.Request.UserHostAddress.StartsWith("192.168.113.") || HttpContext.Current.Request.UserHostAddress.Equals("127.0.0.1")))
			{
				exceptionLabel.Text += spottedEx.Message + "</p><p>" + spottedEx.StackTrace;
			}
			else if (spottedEx != null && (spottedEx.ShowMessageToUsrs))
			{
				exceptionLabel.Text += spottedEx.Message;
			}
			else
			{
				exceptionLabel.Text += "An error has occurred.";
			}

			exceptionLabel.Text += "</p><p><br></p><p>If this problem persists, you may wish to report this to an Admin";
			if (spottedEx != null && spottedEx.K > 0) exceptionLabel.Text += ", quoting error #" + spottedEx.K;
			exceptionLabel.Text += ".</p>";

			System.Web.UI.WebControls.Button retryButton = new System.Web.UI.WebControls.Button();
			retryButton.Text = "Retry";
			retryButton.OnClientClick = "location.reload();";

			System.Web.UI.WebControls.Button historyBackButton = new System.Web.UI.WebControls.Button();
			historyBackButton.Text = "Back";
			historyBackButton.OnClientClick = @"history.back();";

			System.Web.UI.WebControls.Button homeButton = new System.Web.UI.WebControls.Button();
			homeButton.Text = "Home";
			homeButton.OnClientClick = @"location = ""/"";";


			System.IO.StringWriter stringWriter = new System.IO.StringWriter();

			System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(stringWriter);
			openPage.RenderControl(htmlWriter);

			exceptionLabel.RenderControl(htmlWriter);



			htmlWriter.RenderBeginTag("center");
			retryButton.RenderControl(htmlWriter);
			historyBackButton.RenderControl(htmlWriter);
			homeButton.RenderControl(htmlWriter);
			htmlWriter.RenderEndTag();

			closePage.RenderControl(htmlWriter);

			resp.Write(stringWriter.ToString());
		}
Example #40
0
        public static string RenderUserControl(string path, bool useFormLess,
            Dictionary<string, string> controlParams, string assemblyName, string controlName,
            HttpContext context)
        {
            System.Web.UI.Page pageHolder = null;
            if (useFormLess)
            {
                pageHolder = new FormlessPage() { AppRelativeTemplateSourceDirectory = HttpRuntime.AppDomainAppVirtualPath }; //needed to resolve "~/"
            }
            else
            {
                pageHolder = new System.Web.UI.Page() { AppRelativeTemplateSourceDirectory = HttpRuntime.AppDomainAppVirtualPath };
            }

            System.Web.UI.UserControl viewControl = null;

            //use path by default
            if (String.IsNullOrEmpty(path))
            {
                //load assembly and usercontrol when .ascx is compiled into a .dll
                string controlAssemblyName = string.Format("{0}.{1},{0}", assemblyName, controlName);

                Type type = Type.GetType(controlAssemblyName);
                viewControl = (System.Web.UI.UserControl)pageHolder.LoadControl(type, null);
            }
            else
            {
                viewControl = (System.Web.UI.UserControl)pageHolder.LoadControl(path);

            }

            pageHolder.EnableViewState = false;
            viewControl.EnableViewState = false;

            if (controlParams != null && controlParams.Count > 0)
            {
                foreach (var keyValuePair in controlParams)
                {
                    Type viewControlType = viewControl.GetType();
                    System.Reflection.PropertyInfo property =
                       viewControlType.GetProperty(keyValuePair.Key);

                    if (property != null)
                    {

                        object value;
                        DateTime date;
                        if (property.PropertyType == typeof(bool))
                            value = bool.Parse(keyValuePair.Value);
                        else if (property.PropertyType == typeof(Int32))
                            value = Int32.Parse(keyValuePair.Value);
                        else if (property.PropertyType == typeof(Guid))
                            value = new Guid(keyValuePair.Value);
                        else if (property.PropertyType == typeof(DateTime) && DateTime.TryParse(keyValuePair.Value, out date))
                            value = date;
                        else
                            value = keyValuePair.Value;

                        try
                        {
                            property.SetValue(viewControl, value, null);
                        }
                        catch (Exception ex)
                        {
                            //need to hook into external logger, throw?
                        }

                    }

                }
            }

            string parseIndex = System.Guid.NewGuid().ToString();
            if (useFormLess)
            {
                pageHolder.Controls.Add(viewControl);
            }
            else
            {
                System.Web.UI.HtmlControls.HtmlForm form = new System.Web.UI.HtmlControls.HtmlForm();
                System.Web.UI.ScriptManager sm = new System.Web.UI.ScriptManager();
                sm.EnableCdn = true;
                sm.AjaxFrameworkMode = System.Web.UI.AjaxFrameworkMode.Disabled;
                System.Web.UI.WebControls.Literal litParseIndex = new System.Web.UI.WebControls.Literal();
                litParseIndex.Text = parseIndex;
                form.Controls.Add(sm);
                form.Controls.Add(litParseIndex);
                form.Controls.Add(viewControl);
                pageHolder.Controls.Add(form);
            }
            System.IO.StringWriter output = new System.IO.StringWriter();
            context.Server.Execute(pageHolder, output, false);

            string renderedContent = output.ToString();

            if (renderedContent.Contains("<form method=")) //have to have a form and scriptmananger to render sometimes but we don't want it on the client
            {
                renderedContent = renderedContent.Substring(renderedContent.IndexOf(parseIndex) + parseIndex.Length);
                renderedContent = renderedContent.Replace(renderedContent.Substring(renderedContent.LastIndexOf("</form>"), 7), "");
            }
            return renderedContent;
        }
Example #41
0
 protected override void CreateChildControls()
 {
     base.CreateChildControls();
     if (Text != null) {
         var l = new System.Web.UI.WebControls.Literal();
         if (!Text.StartsWith("//<![CDATA[")) l.Text = "//<![CDATA[\r\n" + Text + "\r\n//]]>";
         else l.Text = Text;
         Controls.Add(l);
     }
 }
Example #42
0
        private static void CreateColor(ActiveEventArgs e)
        {
            // Creating "button" Panel
            Panel lb = new Panel
            {
                CssClass = "colorLabel " + e.Params["Value"].Get<string>()
            };
            lb.Click +=
                delegate(object sender, EventArgs e2)
                    {
                        Panel s = sender as Panel;
                        if (s == null)
                            return;
                        Panel fader = s.Controls[1] as Panel;
                        new EffectRollDown(fader, 400)
                            .JoinThese(
                            new EffectFadeIn())
                            .Render();
                    };

            // Dummy literal to make sure the panel is visible
            System.Web.UI.WebControls.Literal lit = new System.Web.UI.WebControls.Literal
            {
                Text = "&nbsp;"
            };
            lb.Controls.Add(lit);

            // Our "context sensitive menu" Panel - to choose new Color
            Window pnl = new Window {CssClass = "light-window colorPanel"};
            pnl.Style[Styles.display] = "none";
            pnl.Click +=
                delegate(object sender, EventArgs e2)
                    {
                        Panel pl = sender as Panel;
                        new EffectRollUp(pl, 400)
                            .JoinThese(
                            new EffectFadeOut())
                            .Render();
                    };
            foreach (string idx in new[] { "Gray", "Red", "Blue", "Green", "Yellow" })
            {
                Label cur = new Label
                {
                    Text = "&nbsp;", CssClass = "colorButton " + idx, Xtra = idx
                };
                int rowId;
                cur.Click +=
                    delegate(object sender, EventArgs e2)
                        {
                            Label clicked = sender as Label;
                            if (clicked == null) 
                                return;
                            Panel bx = clicked.Parent.Parent.Parent.Parent.Parent.Parent as Panel;
                            if (bx == null) 
                                return;
                            string[] xtra = bx.Xtra.Split('|');
                            rowId = int.Parse(xtra[0]);
                            Whiteboard.Row row = ActiveType<Whiteboard.Row>.SelectByID(rowId);
                            Whiteboard.Cell cell = row.Cells.Find(
                                delegate(Whiteboard.Cell idxCell)
                                    {
                                        return idxCell.Column.Caption == xtra[1];
                                    });
                            cell.Value = clicked.Xtra;
                            cell.Save();
                            bx.CssClass = "colorLabel " + clicked.Xtra;
                            new EffectRollUp(clicked.Parent.Parent.Parent.Parent.Parent, 400)
                                .JoinThese(
                                new EffectFadeOut())
                                .Render();
                            UpdateGridValue(e.Params["DataSource"].Value as Node, xtra[0], xtra[1], clicked.Xtra);
                        };
                pnl.SurfaceControl.Style[Styles.overflow] = "auto";
                pnl.Content.Add(cur);
            }
            lb.Controls.Add(pnl);

            // Sending back our Control
            e.Params["Control"].Value = lb;
        }
Example #43
0
 private Literal AddLiteral(Control parent, string text)
 {
     Literal literal = new Literal();
     literal.Text = Server.HtmlEncode(text);
     parent.Controls.Add(literal);
     return literal;
 }
Example #44
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (QuestionnaireDto.Company_Code == Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Company_HPI"]))
            {
                //Gofa Image Vivek
                rfgImageTop.Visible = false;
                rfgImageBottom.Visible = false;
                if (!string.IsNullOrEmpty(QuestionnaireDto.banner_template.ToString()) && !string.IsNullOrEmpty(QuestionnaireDto.banner))
                {
                    if (QuestionnaireDto.banner_template == 1)
                    {
                        rfgImageTop.Visible = true;
                        rfgImageBottom.Visible = false;
                        rfgImageTop.Src = ".." + ResolveUrl(bannerPath + QuestionnaireDto.banner.ToString().Replace(@"\", @"/"));
                        rfgImageTop.Style["width"] = QuestionnaireDto.banner_width.ToString() + "px";
                        rfgImageTop.Style["hieght"] = QuestionnaireDto.banner_height.ToString() + "px";

                    }
                    else if (QuestionnaireDto.banner_template == 2)
                    {
                        rfgImageTop.Visible = false;
                        rfgImageBottom.Visible = true;
                        rfgImageBottom.Src = ".." + ResolveUrl(bannerPath + QuestionnaireDto.banner.ToString().Replace(@"\", @"/"));
                        rfgImageBottom.Style["width"] = QuestionnaireDto.banner_width.ToString() + "px";
                        rfgImageBottom.Style["hieght"] = QuestionnaireDto.banner_height.ToString() + "px";
                    }
                    else
                    {
                        ImgDisplayBottm.Visible = false;
                        ImgDisplayTop.Visible = false;
                        rfgImageTop.Visible = false;
                        rfgImageBottom.Visible = false;
                    }
                }
                //Sprint 2 balakumar
                if (QuestionnaireDto.max_number_responses != -1 && QuestionnaireDto.max_number_responses <= QuestionnaireDto.number_of_responses)
                {
                    Literal_Ux_MaxResponses.Text = "Thank you for participating in the campaign.</br>We are sorry that this campaign has ended.</br>Please do visit us again for other campaigns.";
                    Ux_Submit.Visible = false;
                    Ux_PostParams.Visible = false;
                    ImgDisplayBottm.Visible = false;
                    ImgDisplayTop.Visible = false;
                    return;
                }

                Ux_FaxRequiredSentence.Visible = false;
                Ux_MobileRequiredSentence.Visible = false;
                Ux_PhoneRequiredSentence.Visible = false;

                SetTelPhoneFaxValidationMessages();

                #region validation for Flexfield10(AssetID)
                //††† 20100817 Biju Pattathil | RFG 2.2  Start†††
                //string questionnaire_id = Request.Params["qid"];
                //Hashtable h_params = new Hashtable();
                //h_params.Add("questionnaire_id", questionnaire_id);

                //DataTable questionnaire_general = DB.execProc("select_questionnaire_general", h_params);
                //h_params.Clear();
                //if (questionnaire_general.Rows.Count != 0)
                //{

                //    if ((Request.Params["status"] == null) || (Request.Params["status"].ToString() != "test"))
                //    {
                //        if (bool.Parse(questionnaire_general.Rows[0]["any_asset"].ToString()))
                //        {
                //            if (Request.Params["flexfield10"] != null)
                //            {
                //                if (Request.Params["flexfield10"].ToString() != "")
                //                {
                //                    if (!System.Text.RegularExpressions.Regex.IsMatch(Request.Params["flexfield10"].ToString(), utility.getParameter("FlexField10Format")))
                //                    {
                //                        Response.Redirect(String.Format("~/FormContentError.aspx?flex10msg=flexfield10 Incorrect"), true);
                //                    }
                //                }
                //            }
                //            else
                //            {
                //                Response.Redirect(String.Format("~/FormContentError.aspx?flex10msg=flexfield10 Missing"), true);
                //            }


                //        }
                //    }
                //}
                //else
                //{
                //    Response.Redirect("404_invalidqid.aspx", true);
                //}

                //††† 20100817 Biju Pattathil | RFG 2.2  Start†††
                #endregion

                #region validation for Flexfield12(AssetID)
                //Code commented because of message localization issue in UI 
                //††† 20120507 | Tirumala Raju | RFG 2.7 | flexfield12 length validation  Start†††
                //string questionnaire_id = Request.Params["qid"];
                //Hashtable h_params = new Hashtable();
                //h_params.Add("questionnaire_id", questionnaire_id);

                //DataTable questionnaire_general = DB.execProc("select_questionnaire_general", h_params);
                //h_params.Clear();
                //if (questionnaire_general.Rows.Count != 0)
                //{
                //    if (bool.Parse(questionnaire_general.Rows[0]["any_asset"].ToString()))
                //    {
                //        if (!string.IsNullOrEmpty(Request.Params["flexfield12"]))
                //        {
                //            if (Request.Params["flexfield12"].ToString().Length > 255)
                //            {
                //                Response.Redirect(String.Format("FormContentError.aspx?flex12msg=flexfield12 value exceeds 255 characters so can't be uploaded"), true);
                //            }
                //        }
                //    }
                //}
                //††† 20120507 | Tirumala Raju | RFG 2.7  End†††
                #endregion

                if (Wucs != null)
                {
                    if (PageAssembly.Page.RequiredSentence != null)
                        Ux_RequiredSentence.Text = WebConstants.ToRequiredSentence(PageAssembly.Page.RequiredSentence);

                    if (PageAssembly.Page.PrivacySentence != null)
                        Ux_PrivacySentance.Text = PageAssembly.Page.PrivacySentence;

                    if (PageAssembly.Page.ButtonText != null)
                        Ux_Submit.Text = PageAssembly.Page.ButtonText;
                    Ux_Title.Text = PageAssembly.Page.PageTitle;
                    Ux_Headline.Text = PageAssembly.Page.PageTitle;
                    if (!String.IsNullOrEmpty(PageAssembly.Page.PageTagline))
                        Ux_Tagline.Text = PageAssembly.Page.PageTagline;
                    Ux_IntroText.Text = PageAssembly.Page.Introduction;
                    foreach (WucPageElementBase elem in Wucs)
                    {
#if DEBUG
                        System.Web.UI.WebControls.Literal Comment = new System.Web.UI.WebControls.Literal();
                        Comment.Text = WebConstants.NewLine + "<!-- " + elem.PageElementType.ToString() + " -->" + WebConstants.NewLine;
                        Ux_Content.Controls.Add(Comment);
#endif

                        Ux_Content.Controls.Add(elem);

                        if (elem.PageElementType == PageElementType.PersonalDataSection) // changed by BERND 7.Sep 11 from: (elem.PageElementType.ToString() == "PersonalDataSection")
                        {
                            if (((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)) != null)
                            {
                                if (((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).MobileNumber != null)
                                {
                                    if (!string.IsNullOrEmpty(((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).MobileNumber.ToString().Trim()))
                                        bMobileExists = true;
                                }

                                if (((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).FaxNumber != null)
                                {
                                    if (!string.IsNullOrEmpty(((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).FaxNumber.ToString().Trim()))
                                        bFaxExists = true;
                                }

                                if (((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).TelephoneNumber != null)
                                {
                                    if (!string.IsNullOrEmpty(((HP.Rfg.Common.Questionnaire.PersonalDataSectionDto)(((HP.Rfg.Web.Controls.WucPageElementBase)(elem)).PageElement)).TelephoneNumber.ToString().Trim()))
                                        bTelePhoneExists = true;
                                }
                            }
                        }
                    }

                    if (bFaxExists == true)
                    {
                        //    Ux_FaxRequiredSentence.Visible = true;
                        if (FaxValidationMessage != null)
                            Ux_FaxRequiredSentence.Text = WebConstants.ToValidationSentence(FaxValidationMessage);
                    }
                    if (bMobileExists == true)
                    {
                        //     Ux_MobileRequiredSentence.Visible = true;
                        if (MobileValidatioinMessage != null)
                            Ux_MobileRequiredSentence.Text = WebConstants.ToValidationSentence(MobileValidatioinMessage);
                    }
                    if (bTelePhoneExists == true)
                    {
                        //   Ux_PhoneRequiredSentence.Visible = true;
                        if (TelephoneValidationMessage != null)
                            Ux_PhoneRequiredSentence.Text = WebConstants.ToValidationSentence(TelephoneValidationMessage);
                    }
                }//else: there should be a redirect from RfgExternalPage

                if (Request.Params["status"] == "test" && Configuration.Platform != "production")
                {
                    Ux_PostParams.Visible = true;
                }
                else
                {
                    Ux_PostParams.Visible = false;
                }
            }
            else
            {
                String URI = Request.Url.ToString();
                URI = URI.Replace("/index", "/index_e");
                Response.Redirect(URI);
            }
        }
        protected void SEOSiteMap()
        {
            Page.Title = Resources.Resource.HomeTitle;

            var nl1 = new System.Web.UI.WebControls.Literal { Text = Environment.NewLine };
            var title = new HtmlMeta { Name = "title", Content = Resources.Resource.HomeTitle };
            Page.Header.Controls.AddAt(1, title);

            var description = new HtmlMeta { Name = "description", Content = Resources.Resource.HomeDescription };
            Page.Header.Controls.AddAt(2, description);

            var keywords = new HtmlMeta { Name = "keywords", Content = Resources.Resource.HomeKeywords };
            Page.Header.Controls.AddAt(3, keywords);
        }