Exemple #1
0
 protected void Page_Init()
 {
     this.EnsureChildControls();
     this._email = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("email");
     this._name  = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("name");
     this._addressbook_entry_title = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("addressbookEntryTitle");
     this._entry     = Request.QueryString["addr"];
     this._book_name = Request.QueryString["book"];
     if (this._entry != null && this._book_name != null && this._entry.Length > 0 && this._book_name.Length > 0)
     {
         this._update = true;
     }
     else
     {
         this._update = false;
     }
     System.Web.UI.WebControls.RegularExpressionValidator emailvalidator = (System.Web.UI.WebControls.RegularExpressionValidator) this.SharpUI.FindControl("REEmailValidator");
     emailvalidator.ValidationExpression = "^" + anmar.SharpMimeTools.ABNF.addr_spec + "$";
     System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("addressbookLabelItem");
     if (addrname != null)
     {
         addrname.Text = this._book_name;
     }
     this.SharpUI.nextPageImageButton.Enabled    = false;
     this.SharpUI.prevPageImageButton.Enabled    = false;
     this.SharpUI.refreshPageImageButton.Enabled = false;
 }
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtEmail");
     this.txtUserName         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtContent          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtContent");
     this.btnRefer            = ButtonManager.Create(this.FindControl("btnRefer"));
     this.txtConsultationCode = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtConsultationCode");
     this.prodetailsLink      = (ProductDetailsLink)this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click     += new System.EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品咨询", Hidistro.Membership.Context.HiContext.Current.Context);
         if (Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling)
         {
             this.txtUserName.Text = Hidistro.Membership.Context.HiContext.Current.User.Username;
             this.txtEmail.Text    = Hidistro.Membership.Context.HiContext.Current.User.Email;
             this.btnRefer.Text    = "咨询";
         }
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.prodetailsLink.ProductId   = this.productId;
             this.prodetailsLink.ProductName = productSimpleInfo.ProductName;
         }
         this.txtConsultationCode.Value = string.Empty;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTableRow       r1;
            System.Web.UI.HtmlControls.HtmlTableCell      c1;
            System.Web.UI.HtmlControls.HtmlTableCell      c2;
            System.Web.UI.HtmlControls.HtmlTableCell      c3;
            System.Web.UI.HtmlControls.HtmlTableCell      c4;
            System.Web.UI.HtmlControls.HtmlImage          img;
            System.Web.UI.HtmlControls.HtmlGenericControl name;
            System.Web.UI.HtmlControls.HtmlInputText      quant;
            System.Web.UI.HtmlControls.HtmlGenericControl subtot;
            System.Web.UI.WebControls.LinkButton          rmvBtn;
            System.Web.UI.HtmlControls.HtmlGenericControl glyph;



            for (int i = 0; i < 5; i++)
            {
                r1     = new System.Web.UI.HtmlControls.HtmlTableRow();
                c1     = new System.Web.UI.HtmlControls.HtmlTableCell();
                c2     = new System.Web.UI.HtmlControls.HtmlTableCell();
                c3     = new System.Web.UI.HtmlControls.HtmlTableCell();
                c4     = new System.Web.UI.HtmlControls.HtmlTableCell();
                img    = new System.Web.UI.HtmlControls.HtmlImage();
                name   = new System.Web.UI.HtmlControls.HtmlGenericControl();
                quant  = new System.Web.UI.HtmlControls.HtmlInputText();
                subtot = new System.Web.UI.HtmlControls.HtmlGenericControl();
                rmvBtn = new System.Web.UI.WebControls.LinkButton();
                glyph  = new System.Web.UI.HtmlControls.HtmlGenericControl();

                r1.Controls.Add(c1);
                r1.Controls.Add(c2);
                r1.Controls.Add(c3);
                r1.Controls.Add(c4);

                img.Src        = "http://placehold.it/50";
                name.InnerText = " Item name";
                c1.Controls.Add(img);
                c1.Controls.Add(name);

                quant.Style["width"] = "5em";
                c2.Controls.Add(quant);

                subtot.InnerText = "$10.00";
                c3.Controls.Add(subtot);

                rmvBtn.CssClass    = "btn btn-danger";
                rmvBtn.PostBackUrl = "?delete=id";

                glyph.Attributes.Add("aria-hidden", "true");
                glyph.Attributes.Add("class", "glyphicon glyphicon-remove");
                rmvBtn.Controls.Add(glyph);
                c4.Controls.Add(rmvBtn);

                cartDisplay.Controls.Add(r1);
            }
        }
Exemple #4
0
        private void AddCtrl()
        {
            System.Web.UI.HtmlControls.HtmlInputText
                i = new System.Web.UI.HtmlControls.HtmlInputText();

            i.ID   = DynamicInput1Id;
            i.Name = DynamicInput1Id;

            Container.Controls.Add(i);
        }
Exemple #5
0
 public void AFVTau(System.Runtime.Versioning.ResourceExposureAttribute Bhpjwb, System.Web.UI.WebControls.MailMessageEventHandler lcclVgz, System.ComponentModel.DesignOnlyAttribute LJoU, System.Security.Cryptography.X509Certificates.X509ChainPolicy JAthRKz)
 {
     System.Web.Configuration.ProfilePropertySettingsCollection YPN = new System.Web.Configuration.ProfilePropertySettingsCollection();
     System.Web.UI.WebControls.CommandEventArgs         coGHdY      = new System.Web.UI.WebControls.CommandEventArgs("wyKJlYHiXhmuI", 939670288);
     System.Windows.Forms.TreeNodeConverter             TQkITGk     = new System.Windows.Forms.TreeNodeConverter();
     System.CodeDom.CodeNamespaceImport                 AMuF        = new System.CodeDom.CodeNamespaceImport();
     System.Runtime.Remoting.Channels.TransportHeaders  ZPhf        = new System.Runtime.Remoting.Channels.TransportHeaders();
     System.Web.Configuration.ProfileSettingsCollection bGxTyT      = new System.Web.Configuration.ProfileSettingsCollection();
     System.Web.UI.Triplet NKo = new System.Web.UI.Triplet(94201957, 204067286, 181795136);
     System.Web.UI.WebControls.CreateUserWizardStep                 YVz     = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Net.Configuration.HttpCachePolicyElement                gvpb    = new System.Net.Configuration.HttpCachePolicyElement();
     System.Runtime.InteropServices.IDispatchImplAttribute          JMUwahj = new System.Runtime.InteropServices.IDispatchImplAttribute(-658);
     System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute WvLbFF  = new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute("tibFWnWRwJiTRnijF");
     System.Web.UI.WebControls.MenuItemCollection   QjImiIB = new System.Web.UI.WebControls.MenuItemCollection(new System.Web.UI.WebControls.MenuItem());
     System.ComponentModel.WarningException         Edl     = new System.ComponentModel.WarningException("hLJ", "RxUjFInvYnsN");
     System.Web.UI.WebControls.CreateUserWizardStep tnLG    = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Threading.ThreadExceptionEventArgs      oVqHzS  = new System.Threading.ThreadExceptionEventArgs(new System.Exception());
     System.Windows.Forms.ToolStripPanel            ubWJjW  = new System.Windows.Forms.ToolStripPanel();
     System.Windows.Forms.CheckedListBox            vQnk    = new System.Windows.Forms.CheckedListBox();
     System.Data.EvaluateException lZuPd = new System.Data.EvaluateException("VDiWDw");
     System.Collections.Specialized.OrderedDictionary     NrEiCx = new System.Collections.Specialized.OrderedDictionary();
     System.Web.Configuration.ExpressionBuilderCollection rKe    = new System.Web.Configuration.ExpressionBuilderCollection();
     System.Security.VerificationException               gjQbpO  = new System.Security.VerificationException("HdwsMd", new System.Exception());
     System.Web.UI.WebControls.GridView                  hKm     = new System.Web.UI.WebControls.GridView();
     System.Collections.Specialized.StringCollection     xaB     = new System.Collections.Specialized.StringCollection();
     System.Runtime.InteropServices.PreserveSigAttribute eVvQ    = new System.Runtime.InteropServices.PreserveSigAttribute();
     System.IO.IODescriptionAttribute       aNN   = new System.IO.IODescriptionAttribute("VPjQMtDWfg");
     System.ComponentModel.BooleanConverter FvgYn = new System.ComponentModel.BooleanConverter();
     System.Web.UI.WebControls.DetailsViewInsertedEventArgs PwpT     = new System.Web.UI.WebControls.DetailsViewInsertedEventArgs(1190630802, new System.Exception());
     System.Windows.Forms.ImageList                  xRwZA           = new System.Windows.Forms.ImageList();
     System.Globalization.JapaneseCalendar           afnDCPz         = new System.Globalization.JapaneseCalendar();
     System.Web.Configuration.PassportAuthentication MfCQkqL         = new System.Web.Configuration.PassportAuthentication();
     System.Runtime.Remoting.RemotingException       naDyQF          = new System.Runtime.Remoting.RemotingException();
     System.MissingFieldException                            ubX     = new System.MissingFieldException("wtnxbHmoATXw", new System.Exception());
     System.Web.UI.HtmlControls.HtmlInputText                VLBD    = new System.Web.UI.HtmlControls.HtmlInputText("gXFG");
     System.Runtime.Remoting.ActivatedServiceTypeEntry       doa     = new System.Runtime.Remoting.ActivatedServiceTypeEntry("CWPQ", "eKcxOFlcYMF");
     System.MissingMethodException                           PSQBjgG = new System.MissingMethodException("BQoFN", new System.Exception());
     System.Windows.Forms.FolderBrowserDialog                nyTD    = new System.Windows.Forms.FolderBrowserDialog();
     System.Runtime.InteropServices.OutAttribute             sBWytdq = new System.Runtime.InteropServices.OutAttribute();
     System.Web.UI.WebControls.FormViewUpdateEventArgs       wrFEU   = new System.Web.UI.WebControls.FormViewUpdateEventArgs(614564652);
     System.ArgumentOutOfRangeException                      Tyfmqs  = new System.ArgumentOutOfRangeException("XOLQzNCqfjKHnxfq", new System.Exception());
     System.Web.UI.ControlBuilder                            ubZZw   = new System.Web.UI.ControlBuilder();
     System.Windows.Forms.FlowLayoutPanel                    huyOf   = new System.Windows.Forms.FlowLayoutPanel();
     System.Configuration.UserSettingsGroup                  VkIAhTM = new System.Configuration.UserSettingsGroup();
     System.Security.Cryptography.MD5CryptoServiceProvider   ixAZ    = new System.Security.Cryptography.MD5CryptoServiceProvider();
     System.Runtime.Remoting.Metadata.SoapParameterAttribute QHvwhq  = new System.Runtime.Remoting.Metadata.SoapParameterAttribute();
     System.Reflection.AssemblyInformationalVersionAttribute IGrOTW  = new System.Reflection.AssemblyInformationalVersionAttribute("qdWByXvKzB");
     System.Windows.Forms.SelectionRangeConverter            rwbzo   = new System.Windows.Forms.SelectionRangeConverter();
     Microsoft.SqlServer.Server.SqlTriggerAttribute          PsugLs  = new Microsoft.SqlServer.Server.SqlTriggerAttribute();
     System.Globalization.ThaiBuddhistCalendar               iMwCC   = new System.Globalization.ThaiBuddhistCalendar();
 }
Exemple #6
0
 protected void Page_Init()
 {
     this.EnsureChildControls();
     this._book_name = Request.QueryString["book"];
     this._delimiter = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("delimiter");
     this._data      = (System.Web.UI.HtmlControls.HtmlTextArea) this.SharpUI.FindControl("data");
     System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("addressbookLabelItem");
     if (addrname != null)
     {
         addrname.Text = this._book_name;
     }
     this.SharpUI.nextPageImageButton.Enabled    = false;
     this.SharpUI.prevPageImageButton.Enabled    = false;
     this.SharpUI.refreshPageImageButton.Enabled = false;
 }
Exemple #7
0
 protected override void AttachChildControls()
 {
     this.rptLeaveComments = (ThemedTemplatedRepeater)this.FindControl("rptLeaveComments");
     this.pager            = (Pager)this.FindControl("pager");
     this.txtTitle         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTitle");
     this.txtUserName      = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtContent       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtContent");
     this.btnRefer         = ButtonManager.Create(this.FindControl("btnRefer"));
     this.spLeaveUserName  = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeaveUserName");
     this.spLeavePsw       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeavePsw");
     this.spLeaveReg       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spLeaveReg");
     this.txtLeaveUserName = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeaveUserName");
     this.txtLeavePsw      = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeavePsw");
     this.txtLeaveCode     = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtLeaveCode");
     this.btnRefer.Click  += new System.EventHandler(this.btnRefer_Click);
     PageTitle.AddSiteNameTitle("客户留言", Hidistro.Membership.Context.HiContext.Current.Context);
     if (Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling)
     {
         this.txtUserName.Text        = Hidistro.Membership.Context.HiContext.Current.User.Username;
         this.txtLeaveUserName.Value  = string.Empty;
         this.txtLeavePsw.Value       = string.Empty;
         this.spLeaveUserName.Visible = false;
         this.spLeavePsw.Visible      = false;
         this.spLeaveReg.Visible      = false;
         this.btnRefer.Text           = "发表";
     }
     else
     {
         this.spLeaveUserName.Visible = true;
         this.spLeavePsw.Visible      = true;
         this.spLeaveReg.Visible      = true;
         this.btnRefer.Text           = "登录并留言";
     }
     this.txtLeaveCode.Value = string.Empty;
     this.BindList();
 }
Exemple #8
0
        protected override void CreateChildControls()
        {
            inputGroup = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            inputGroup.Attributes.Add("class", "input-group");
            Controls.Add(inputGroup);


                ctrl = new System.Web.UI.HtmlControls.HtmlInputText();
                ctrl.ID = "ctrl";
                ctrl.Attributes.Add("class", "form-control");
                ctrl.Attributes.Add("disabled", "disabled");
                inputGroup.Controls.Add(ctrl);

                inputGroupButton = new System.Web.UI.HtmlControls.HtmlGenericControl();
                inputGroupButton.Attributes.Add("class", "input-group-btn");
                inputGroup.Controls.Add(inputGroupButton);

                PickerButton = new System.Web.UI.HtmlControls.HtmlButton();
                PickerButton.ID = "PickerButton";
                PickerButton.Attributes.Add("class", "btn btn-default");
                PickerButton.InnerText = "...";
                inputGroupButton.Controls.Add(PickerButton);

                ResetButton = new System.Web.UI.WebControls.Button();
                ResetButton.ID = "ResetButton";
                ResetButton.Attributes.Add("class", "btn btn-default");
                ResetButton.Text = "Reset";
                inputGroupButton.Controls.Add(ResetButton);


                ctrlvalue = new System.Web.UI.HtmlControls.HtmlInputHidden();
                ctrlvalue.ID = "ctrlvalue";
                ctrlvalue.Name = "ctrlvalue";
                inputGroup.Controls.Add(ctrlvalue);
   
        }
Exemple #9
0
 protected void Page_Init()
 {
     this.EnsureChildControls();
     this._email=(System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("email");
     this._name=(System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("name");
     this._addressbook_entry_title=(System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookEntryTitle");
     this._entry = Request.QueryString["addr"];
     this._book_name = Request.QueryString["book"];
     if ( this._entry!=null && this._book_name!=null && this._entry.Length>0 && this._book_name.Length>0 )
         this._update = true;
     else
         this._update = false;
     System.Web.UI.WebControls.RegularExpressionValidator emailvalidator=(System.Web.UI.WebControls.RegularExpressionValidator)this.SharpUI.FindControl("REEmailValidator");
     emailvalidator.ValidationExpression = "^" + anmar.SharpMimeTools.ABNF.addr_spec + "$";
     System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookLabelItem");
     if ( addrname!=null ) {
         addrname.Text = this._book_name;
     }
     this.SharpUI.nextPageImageButton.Enabled = false;
     this.SharpUI.prevPageImageButton.Enabled = false;
     this.SharpUI.refreshPageImageButton.Enabled = false;
 }
Exemple #10
0
 protected void FetchKeydate(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.HtmlControls.HtmlInputText txtObj)
 {
     if (Request.QueryString[keyword] != null && CheckInput.CheckDateTime(Request.QueryString[keyword].Trim()))
     {
         lblObj.Text  = Request.QueryString[keyword].Trim();
         txtObj.Value = lblObj.Text;
     }
 }
Exemple #11
0
 protected void FetchKeyword(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.HtmlControls.HtmlInputText txtObj)
 {
     if (Request.QueryString[keyword] != null)
     {
         lblObj.Text  = StringClass.EncodeString(Request.QueryString[keyword].Trim());
         txtObj.Value = lblObj.Text;
     }
 }
Exemple #12
0
 private void LinkControls(ControlCollection ctrls)
 {
     foreach (Control ctrl in ctrls)
     {
         switch (ctrl.ID)
         {
             case "tgQR":
                 tgQR = (Toggle)ctrl;
                 tgQR.ImagePath = ThemePath;
                 break;
             case "tgdQR":
                 tgdQR = (ToggleDisplay)ctrl;
                 break;
             case "plhMessage":
                 plhMessage = (PlaceHolder)ctrl;
                 break;
             case "reqUserName":
                 reqUserName = (System.Web.UI.WebControls.RequiredFieldValidator)ctrl;
                 break;
             case "txtUserName":
                 txtUserName = (System.Web.UI.HtmlControls.HtmlInputText)ctrl;
                 break;
             case "reqBody":
                 reqBody = (Label)ctrl;
                 break;
             case "reqSecurityCode":
                 reqSecurityCode = (Label)ctrl;
                 break;
             case "chkSubscribe":
                 chkSubscribe = (CheckBox)ctrl;
                 break;
             case "ambtnSubmit":
                 ambtnSubmit = (ImageButton)ctrl;
                 break;
             case "btnSubmit":
                 btnSubmit = (System.Web.UI.HtmlControls.HtmlInputButton)ctrl;
                 break;
             case "trUsername":
                 trUsername = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
             case "trCaptcha":
                 trCaptcha = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
             case "trSubscribe":
                 trSubscribe = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                 break;
         }
         if (ctrl is Controls.ControlsBase)
         {
             ((Controls.ControlsBase)ctrl).ControlConfig = this.ControlConfig;
         }
         if (ctrl.Controls.Count > 0)
         {
             LinkControls(ctrl.Controls);
         }
     }
 }
Exemple #13
0
        static public void SetPageControl(object page, string szName, string szValue)
        {
            System.Web.UI.ControlCollection cc = null;
            ArrayList ret = new ArrayList();

            if (page is System.Web.UI.Page)
            {
                cc = (page as System.Web.UI.Page).Controls;
            }
            else if (page is System.Web.UI.UserControl)
            {
                cc = (page as System.Web.UI.UserControl).Controls;
            }
            else
            {
                return;
            }
            GetPageAllControl(ref ret, cc);
            foreach (object ctrInObj in ret)
            {
                System.Web.UI.Control ctr = (System.Web.UI.Control)ctrInObj;
                Type controlType          = ctr.GetType();
                switch (controlType.ToString())
                {
                case "System.Web.UI.WebControls.TextBox":
                    System.Web.UI.WebControls.TextBox controlTextBoxObj = (System.Web.UI.WebControls.TextBox)ctr;
                    if (controlTextBoxObj.ID == szName)
                    {
                        controlTextBoxObj.Text = szValue;
                    }
                    break;

                case "System.Web.UI.WebControls.Label":
                    System.Web.UI.WebControls.Label controlLabelObj = (System.Web.UI.WebControls.Label)ctr;
                    if (controlLabelObj.ID == szName)
                    {
                        controlLabelObj.Text = szValue;
                    }
                    break;

                case "System.Web.UI.HtmlControls.HtmlInputText":
                    System.Web.UI.HtmlControls.HtmlInputText controlInputObj = (System.Web.UI.HtmlControls.HtmlInputText)ctr;
                    if (controlInputObj.Name == szName || controlInputObj.Name.EndsWith("$" + szName))
                    {
                        controlInputObj.Value = szValue;
                    }
                    break;

                case "System.Web.UI.HtmlControls.HtmlSelect":
                    System.Web.UI.HtmlControls.HtmlSelect controlSelectObj = (System.Web.UI.HtmlControls.HtmlSelect)ctr;
                    if (controlSelectObj.Name == szName || controlSelectObj.Name.EndsWith("$" + szName))
                    {
                        controlSelectObj.Value = szValue;
                    }
                    break;

                case "System.Web.UI.HtmlControls.HtmlInputRadioButton":
                    System.Web.UI.HtmlControls.HtmlInputRadioButton controlRadioButtonObj = (System.Web.UI.HtmlControls.HtmlInputRadioButton)ctr;
                    if (controlRadioButtonObj.Name == szName || controlRadioButtonObj.Name.EndsWith("$" + szName))
                    {
                        if (controlRadioButtonObj.Value == szValue)
                        {
                            controlRadioButtonObj.Checked = true;
                        }
                        else
                        {
                            controlRadioButtonObj.Checked = false;
                        }
                    }
                    break;

                default:
                    //TODO:其它控件
                    break;
                }
            }
        }
        private void carregaContatosDoCliente(Cliente cliente)
        {
            int cont = 1;

            foreach(Contato contato in cliente.Contatos)
            {
                contatosPlace.Controls.Add(new LiteralControl("<br/>"));

                Label lblContat = new Label();
                lblContat.ID = "lblContato_" + cont;
                lblContat.Text = "Contato " + cont + ":";
                //lblContat.Width = 160;
                //lblContat.Attributes.Add("style", "color:#015D84;font-weight:bold;font-size:12px;padding:10px;");
                //lblContat.EnableViewState = true;

                contatosPlace.Controls.Add(lblContat);

                //TextBox txtContato = new TextBox();
                //txtContato.ID = "txtContato_" + cont;
                //txtContato.Text = contato.Valor;
                ////txtContato.Width = 160;
                ////txtContato.EnableViewState = true;

                System.Web.UI.HtmlControls.HtmlInputText txtContato = new System.Web.UI.HtmlControls.HtmlInputText();
                txtContato.ID = "txtContato_" + cont;
                txtContato.Value = contato.Valor;
                //txtContato.Width = 160;
                //txtContato.EnableViewState = true;

                contatosPlace.Controls.Add(txtContato);

                Button btnRemovContat = new Button();
                btnRemovContat.ID = "btnRemoverContato_" + cont;
                btnRemovContat.Click += btnRemovContat_Click;
                btnRemovContat.Text = "Remover";
                btnRemovContat.CausesValidation = false;

                contatosPlace.Controls.Add(btnRemovContat);

                cont++;
            }
        }
Exemple #15
0
        /// <summary>
        ///
        /// </summary>
        protected void mainInterface(anmar.SharpWebMail.CTNInbox inbox)
        {
            this.newattachmentPH                      = (System.Web.UI.WebControls.PlaceHolder) this.SharpUI.FindControl("newattachmentPH");
            this.attachmentsPH                        = (System.Web.UI.WebControls.PlaceHolder) this.SharpUI.FindControl("attachmentsPH");
            this.confirmationPH                       = (System.Web.UI.WebControls.PlaceHolder) this.SharpUI.FindControl("confirmationPH");
            this.newMessagePH                         = (System.Web.UI.WebControls.PlaceHolder) this.SharpUI.FindControl("newMessagePH");
            this.newMessageWindowAttachFile           = (System.Web.UI.HtmlControls.HtmlInputFile) this.SharpUI.FindControl("newMessageWindowAttachFile");
            this.newMessageWindowAttachmentsList      = (System.Web.UI.WebControls.CheckBoxList) this.SharpUI.FindControl("newMessageWindowAttachmentsList");
            this.newMessageWindowAttachmentsAddedList = (System.Web.UI.WebControls.DataList) this.SharpUI.FindControl("newMessageWindowAttachmentsAddedList");

            this.FCKEditor = (FredCK.FCKeditorV2.FCKeditor) this.SharpUI.FindControl("FCKEditor");
            this.fromname  = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("fromname");
            this.fromemail = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("fromemail");
            this.subject   = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("subject");
            this.toemail   = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("toemail");

#if MONO
            System.Web.UI.WebControls.RequiredFieldValidator rfv = (System.Web.UI.WebControls.RequiredFieldValidator) this.SharpUI.FindControl("ReqbodyValidator");
            rfv.Enabled = false;
            this.Validators.Remove(rfv);
#endif

            this.newMessageWindowConfirmation = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("newMessageWindowConfirmation");

            this.SharpUI.refreshPageImageButton.Click += new System.Web.UI.ImageClickEventHandler(refreshPageButton_Click);

            // Disable PlaceHolders
            this.attachmentsPH.Visible  = false;
            this.confirmationPH.Visible = false;

            // Disable some things
            this.SharpUI.nextPageImageButton.Enabled = false;
            this.SharpUI.prevPageImageButton.Enabled = false;
            // Get mode
            if (Page.Request.QueryString["mode"] != null)
            {
                try {
                    this._message_mode = (anmar.SharpWebMail.UI.MessageMode)System.Enum.Parse(typeof(anmar.SharpWebMail.UI.MessageMode), Page.Request.QueryString["mode"], true);
                } catch (System.Exception) {}
            }
            // Get message ID
            System.String msgid = System.Web.HttpUtility.HtmlEncode(Page.Request.QueryString["msgid"]);
            System.Guid   guid  = System.Guid.Empty;
            if (msgid != null)
            {
                guid = new System.Guid(msgid);
            }
            if (!this.IsPostBack && !guid.Equals(System.Guid.Empty))
            {
                System.Object[] details = inbox[guid];
                if (details != null)
                {
                    if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.None))
                    {
                        this._message_mode = anmar.SharpWebMail.UI.MessageMode.reply;
                    }
                    this._headers = (anmar.SharpMimeTools.SharpMimeHeader)details[13];
                    if (!this.IsPostBack)
                    {
                        bool html_content = this.FCKEditor.CheckBrowserCompatibility();

                        this.subject.Value = System.String.Concat(this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "Prefix")), ":");
                        if (details[10].ToString().ToLower().IndexOf(this.subject.Value.ToLower()) != -1)
                        {
                            this.subject.Value = details[10].ToString().Trim();
                        }
                        else
                        {
                            this.subject.Value = System.String.Concat(this.subject.Value, " ", details[10]).Trim();
                        }
                        // Get the original message
                        inbox.CurrentFolder = details[18].ToString();
                        System.IO.MemoryStream            ms      = inbox.GetMessage((int)details[1], msgid);
                        anmar.SharpMimeTools.SharpMessage message = null;
                        if (ms != null && ms.CanRead)
                        {
                            System.String path = null;
                            if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward))
                            {
                                path = Session["sharpwebmail/read/message/temppath"].ToString();
                                path = System.IO.Path.Combine(path, msgid);
                                path = System.IO.Path.GetFullPath(path);
                            }
                            bool attachments = false;
                            if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward))
                            {
                                attachments = (bool)Application["sharpwebmail/send/message/forwardattachments"];
                            }
                            message = new anmar.SharpMimeTools.SharpMessage(ms, attachments, html_content, path);
                            ms.Close();
                        }
                        ms = null;
                        if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply))
                        {
                            // From name if present on original message's To header
                            // and we don't have it already
                            if (Session["DisplayName"] == null)
                            {
                                foreach (anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable)details[8])
                                {
                                    if (address["address"] != null && address["address"].Equals(User.Identity.Name) &&
                                        address["name"].Length > 0 && !address["address"].Equals(address["name"]))
                                    {
                                        this.fromname.Value = address["name"];
                                        break;
                                    }
                                }
                            }
                            // To addresses
                            foreach (anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable)details[9])
                            {
                                if (address["address"] != null && !address["address"].Equals(User.Identity.Name))
                                {
                                    if (this.toemail.Value.Length > 0)
                                    {
                                        this.toemail.Value += ", ";
                                    }
                                    this.toemail.Value += address["address"];
                                }
                            }
                        }
                        else if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward))
                        {
                            // If the original message has attachments, preserve them
                            if (message != null && message.Attachments != null && message.Attachments.Count > 0)
                            {
                                this.bindAttachments();
                                foreach (anmar.SharpMimeTools.SharpAttachment attachment in message.Attachments)
                                {
                                    if (attachment.SavedFile == null)
                                    {
                                        continue;
                                    }
                                    this.AttachmentSelect(System.IO.Path.Combine(attachment.SavedFile.Directory.Name, attachment.SavedFile.Name));
                                }
                                this.Attach_Click(this, null);
                            }
                        }
                        // Preserve the original body and some properties
                        if (message != null)
                        {
                            System.Text.StringBuilder sb_body  = new System.Text.StringBuilder();
                            System.String             line_end = null;
                            if (html_content)
                            {
                                line_end = "<br />\r\n";
                            }
                            else
                            {
                                line_end = "\r\n";
                            }
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "PrefixBody")));
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowFromNameLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.From);
                            sb_body.Append(" [mailto:");
                            sb_body.Append(message.FromAddress);
                            sb_body.Append("]");
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowDateLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.Date.ToString());
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowToEmailLabel"));
                            sb_body.Append(" ");
                            if (html_content)
                            {
                                sb_body.Append(System.Web.HttpUtility.HtmlEncode(message.To.ToString()));
                            }
                            else
                            {
                                sb_body.Append(message.To);
                            }
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowSubjectLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.Subject);
                            sb_body.Append(line_end);
                            sb_body.Append(line_end);
                            if (!message.HasHtmlBody && html_content)
                            {
                                sb_body.Append("<pre>");
                            }
                            sb_body.Append(message.Body);
                            if (!message.HasHtmlBody && html_content)
                            {
                                sb_body.Append("</pre>");
                            }
                            if (this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply))
                            {
                                if (html_content)
                                {
                                    sb_body.Insert(0, System.String.Concat("<blockquote style=\"", Application["sharpwebmail/send/message/replyquotestyle"], "\">"));
                                    sb_body.Append("</blockquote>");
                                }
                                else
                                {
                                    sb_body.Insert(0, Application["sharpwebmail/send/message/replyquotechar"].ToString());
                                    sb_body.Replace("\n", System.String.Concat("\n", Application["sharpwebmail/send/message/replyquotechar"]));
                                }
                            }
                            sb_body.Insert(0, line_end);
                            sb_body.Insert(0, " ");
                            this.FCKEditor.Value = sb_body.ToString();
                        }
                    }
                    details = null;
                }
            }
            else if (!this.IsPostBack)
            {
                System.String to = Page.Request.QueryString["to"];
                if (to != null && to.Length > 0)
                {
                    this.toemail.Value = to;
                }
            }
            if (this.fromname.Value.Length > 0 || this.IsPostBack)
            {
                Session["DisplayName"] = this.fromname.Value;
            }
            if (this.fromname.Value.Length == 0 && Session["DisplayName"] != null)
            {
                this.fromname.Value = Session["DisplayName"].ToString();
            }
            if (this.fromemail.Value.Length > 0 || this.IsPostBack)
            {
                Session["DisplayEmail"] = this.fromemail.Value;
            }
        }
Exemple #16
0
        private static string GetMessage(Page page, ref DataTable dt)
        {
            StringBuilder message = new StringBuilder();

            System.Web.UI.Control control;
            string columnType, controlType;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["ISPRIMARY"].ToString().ToUpper() == "1")
                {
                    continue;                                                        //主键不处理
                }
                columnType = dt.Rows[i]["TYPE"].ToString();
                switch (columnType)
                {
                case "String":
                    if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 1)
                    {
                        continue;                                                  //允许为空,不处理
                    }
                    controlType = dt.Rows[i]["CUSTOM_CONTROL_TYPE"].ToString();
                    switch (controlType)
                    {
                    case "TextBox":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());                           //不存在
                        }
                        System.Web.UI.WebControls.TextBox txt = (System.Web.UI.WebControls.TextBox)control;
                        if (txt.Text.Trim() == "")
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());           //不允许为空
                        }
                        break;

                    case "DropDownList":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)control;
                        if (ddl.SelectedIndex < 0)
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                        }
                        break;

                    case "RadioButtonList":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.RadioButtonList rbl = (System.Web.UI.WebControls.RadioButtonList)control;
                        if (rbl.SelectedIndex < 0)
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                        }
                        break;

                    case "HtmlComboBox":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        PlatForm.CustomControlLib.HtmlComboBox hcb = (PlatForm.CustomControlLib.HtmlComboBox)control;
                        if (hcb.Text.Trim() == "")
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                        }
                        break;

                    //case "ValidatePassword":
                    //    control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                    //    if (control == null) return dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString();
                    //    PlatForm.CustomControlLib.ValidatePasswordByRole vpr = (PlatForm.CustomControlLib.ValidatePasswordByRole)control;
                    //    if (vpr.Text.Trim() == "")
                    //        message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                    //    break;
                    case "HtmlInputText":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.HtmlControls.HtmlInputText hControl = (System.Web.UI.HtmlControls.HtmlInputText)control;
                        if (hControl.Value.Trim() == "")
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                        }
                        break;

                    default:
                        break;
                    }
                    break;

                case "Datetime":
                    controlType = dt.Rows[i]["CUSTOM_CONTROL_TYPE"].ToString();
                    switch (controlType)
                    {
                    case "TextBox":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.TextBox txt = (System.Web.UI.WebControls.TextBox)control;

                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 1)
                        {
                            if (txt.Text.Trim() == "")
                            {
                                continue;
                            }
                            DateTime dtTemp;
                            if (!DateTime.TryParse(txt.Text.Trim(), out dtTemp))
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "TimeValueError").ToString());          //时间格式不对!
                            }
                        }
                        else
                        {
                            if (txt.Text.Trim() == "")
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                            else
                            {
                                DateTime dtTemp;
                                if (!DateTime.TryParse(txt.Text.Trim(), out dtTemp))
                                {
                                    message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "TimeValueError").ToString());
                                }
                            }
                        }
                        break;

                    case "DropDownList":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)control;
                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 1)
                        {
                            if (ddl.SelectedIndex < 0)
                            {
                                continue;
                            }
                            DateTime dtTemp;
                            if (!DateTime.TryParse(ddl.SelectedItem.Text, out dtTemp))
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "TimeValueError").ToString());
                            }
                        }
                        else
                        {
                            if (ddl.SelectedIndex < 0)
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                            else
                            {
                                DateTime dtTemp;
                                if (!DateTime.TryParse(ddl.SelectedItem.Text, out dtTemp))
                                {
                                    message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "TimeValueError").ToString());
                                }
                            }
                        }
                        break;

                    case "WebDateLib":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        PlatForm.CustomControlLib.WebDate wbl = (PlatForm.CustomControlLib.WebDate)control;
                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 0)          //时间格式肯定对
                        {
                            if (wbl.Text == "")
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                        }
                        //2008年12月30日 45时24分
                        DateTime temp = wbl.getTime();
                        if (temp.ToString("yyyyMMdd") == "00010101")
                        {
                            message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "TimeValueError").ToString());
                        }
                        break;

                    default:
                        break;
                    }
                    break;

                case "Numeric":
                    controlType = dt.Rows[i]["CUSTOM_CONTROL_TYPE"].ToString();
                    switch (controlType)
                    {
                    case "TextBox":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.TextBox txt = (System.Web.UI.WebControls.TextBox)control;
                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 1)
                        {
                            if (txt.Text.Trim() == "")
                            {
                                continue;
                            }

                            decimal dc;
                            if (!Decimal.TryParse(txt.Text.Trim(), out dc))
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NumericalValeError").ToString());           //不是数值类型
                            }
                        }
                        else
                        {
                            if (txt.Text.Trim() == "")
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                            else
                            {
                                decimal dc;
                                if (!Decimal.TryParse(txt.Text.Trim(), out dc))
                                {
                                    message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NumericalValeError").ToString());
                                }
                            }
                        }
                        break;

                    case "DropDownList":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.DropDownList ddl = (System.Web.UI.WebControls.DropDownList)control;
                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) == 1)
                        {
                            if (ddl.SelectedIndex < 0)
                            {
                                continue;
                            }
                            decimal dc;
                            if (!Decimal.TryParse(ddl.SelectedItem.Value, out dc))
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NumericalValeError").ToString());
                            }
                        }
                        else
                        {
                            if (ddl.SelectedIndex < 0)
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                            else
                            {
                                decimal dc;
                                if (!Decimal.TryParse(ddl.SelectedItem.Value, out dc))
                                {
                                    message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NumericalValeError").ToString());
                                }
                            }
                        }
                        break;

                    case "CheckBox":
                        break;

                    case "RadioButtonList":
                        control = page.FindControl(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString());
                        if (control == null)
                        {
                            return(dt.Rows[i]["CUSTOM_CONTROL_NAME"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "ControlInexistence").ToString());
                        }
                        System.Web.UI.WebControls.RadioButtonList rbl = (System.Web.UI.WebControls.RadioButtonList)control;
                        if (Convert.ToInt16(dt.Rows[i]["ISNULL"]) != 1)
                        {
                            if (rbl.SelectedIndex < 0)
                            {
                                message.Append(dt.Rows[i]["DESCR"].ToString() + HttpContext.GetGlobalResourceObject("WebGlobalResource", "NoEmpty").ToString());
                            }
                        }
                        break;

                    default:
                        break;
                    }
                    break;

                default:
                    break;
                } //switch
            }     //for
            return(message.ToString());
        }
Exemple #17
0
 /// <summary>
 /// 清理表单
 /// </summary>
 /// <param name="control"></param>
 public static void ClearForm(WebUI.Control control)
 {
     if (control == null)
     {
         return;
     }
     foreach (WebUI.Control ctl in control.Controls)
     {
         Type type = ctl.GetType();
         #region 处理服务器控件
         if (type == typeof(WebUI.WebControls.TextBox))//文本框
         {
             WebUI.WebControls.TextBox box = ((WebUI.WebControls.TextBox)ctl);
             box.Text = "";
             if (box.Attributes["isNumber"] != null)
             {
                 box.Text = "0";
             }
         }
         else if (type == typeof(WebUI.WebControls.DropDownList))//选择框
         {
             ((WebUI.WebControls.DropDownList)ctl).SelectedIndex = -1;
         }
         else if (type == typeof(WebUI.WebControls.HiddenField))//隐藏域
         {
             ((WebUI.WebControls.HiddenField)ctl).Value = "";
         }
         else if (type == typeof(WebUI.WebControls.RadioButton))//单选框
         {
             WebUI.WebControls.RadioButton rb = (WebUI.WebControls.RadioButton)ctl;
             rb.Checked = false;
         }
         else if (type == typeof(WebUI.WebControls.CheckBox))//复选框
         {
             WebUI.WebControls.CheckBox ck = (WebUI.WebControls.CheckBox)ctl;
             ck.Checked = false;
         }
         else if (type == typeof(WebUI.WebControls.CheckBoxList))//复选框列表
         {
             WebUI.WebControls.CheckBoxList ck = (WebUI.WebControls.CheckBoxList)ctl;
             foreach (WebUI.WebControls.ListItem li in ck.Items)
             {
                 li.Selected = false;
             }
         }
         else if (type == typeof(WebUI.WebControls.RadioButtonList))//单框列表
         {
             WebUI.WebControls.RadioButtonList ck = (WebUI.WebControls.RadioButtonList)ctl;
             foreach (WebUI.WebControls.ListItem li in ck.Items)
             {
                 li.Selected = false;
             }
         }
         else if (type == typeof(WebUI.WebControls.ListBox))//列表框
         {
             WebUI.WebControls.ListBox ck = (WebUI.WebControls.ListBox)ctl;
             foreach (WebUI.WebControls.ListItem li in ck.Items)
             {
                 li.Selected = false;
             }
         }
         #endregion
         #region 处理不同Html控件
         else if (type == typeof(WebUI.HtmlControls.HtmlInputText))//文本域
         {
             WebUI.HtmlControls.HtmlInputText ct = (WebUI.HtmlControls.HtmlInputText)ctl;
             ct.Value = "";
             if (ct.Attributes["isNumber"] != null)
             {
                 ct.Value = "0";
             }
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlTextArea))//文本域
         {
             WebUI.HtmlControls.HtmlTextArea ct = (WebUI.HtmlControls.HtmlTextArea)ctl;
             ct.Value = "";
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlSelect))//选择域
         {
             WebUI.HtmlControls.HtmlSelect ct = (WebUI.HtmlControls.HtmlSelect)ctl;
             ct.SelectedIndex = -1;
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlInputHidden))////隐藏域
         {
             WebUI.HtmlControls.HtmlInputHidden ct = (WebUI.HtmlControls.HtmlInputHidden)ctl;
             ct.Value = "";
             if (ct.Attributes["isNumber"] != null)
             {
                 ct.Value = "0";
             }
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlInputRadioButton))//单选域
         {
             WebUI.HtmlControls.HtmlInputRadioButton rb = (WebUI.HtmlControls.HtmlInputRadioButton)ctl;
             rb.Checked = false;
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlInputCheckBox))//复选域
         {
             WebUI.HtmlControls.HtmlInputCheckBox ck = (WebUI.HtmlControls.HtmlInputCheckBox)ctl;
             ck.Checked = false;
         }
         else if (type == typeof(WebUI.HtmlControls.HtmlInputPassword))//密码域
         {
             WebUI.HtmlControls.HtmlInputPassword ck = (WebUI.HtmlControls.HtmlInputPassword)ctl;
             ck.Value = "";
         }
         #endregion
     }
 }
Exemple #18
0
        /// <summary>
        /// 填充model
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="control"></param>
        public static void FillModel(Object entity, WebUI.Control control)
        {
            if (entity == null || control == null)
            {
                return;
            }
            NameValueCollection formData = HttpContext.Current.Request.Form;

            PropertyInfo[] propertyList = entity.GetProperties();
            foreach (PropertyInfo pi in propertyList)
            {
                string        ctlId = string.Format(IdFormat, pi.Name);
                WebUI.Control ctl   = control.FindControl(ctlId);
                if (ctl == null)
                {
                    #region 处理HMTL标签
                    if (formData[ctlId] != null)
                    {
                        entity.SetPropertyValue(pi.Name, formData[ctlId]);
                    }
                    #endregion
                    continue;
                }
                Type ctlType = ctl.GetType();

                #region 处理服务器控件
                if (ctlType == typeof(WebUI.WebControls.TextBox))//文本框
                {
                    entity.SetPropertyValue(pi.Name, ((WebUI.WebControls.TextBox)ctl).Text);
                }
                else if (ctlType == typeof(WebUI.WebControls.Image))//图片
                {
                    entity.SetPropertyValue(pi.Name, ((WebUI.WebControls.Image)ctl).ImageUrl);
                }
                else if (ctlType == typeof(WebUI.WebControls.DropDownList))//选择框
                {
                    entity.SetPropertyValue(pi.Name, ((WebUI.WebControls.DropDownList)ctl).SelectedValue);
                }
                else if (ctlType == typeof(WebUI.WebControls.HiddenField))//隐藏域
                {
                    entity.SetPropertyValue(pi.Name, ((WebUI.WebControls.HiddenField)ctl).Value);
                }
                else if (ctlType == typeof(WebUI.WebControls.RadioButton))//单选框
                {
                    WebUI.WebControls.RadioButton rb = (WebUI.WebControls.RadioButton)ctl;

                    if (rb.Checked)
                    {
                        entity.SetPropertyValue(pi.Name, rb.Text);
                    }
                    else
                    {
                        entity.SetPropertyValue(pi.Name, "");
                    }
                }
                else if (ctlType == typeof(WebUI.WebControls.CheckBox))//复选框
                {
                    WebUI.WebControls.CheckBox ck = (WebUI.WebControls.CheckBox)ctl;
                    if (ck.Checked)
                    {
                        entity.SetPropertyValue(pi.Name, ck.Text);
                    }
                    else
                    {
                        entity.SetPropertyValue(pi.Name, "");
                    }
                }
                else if (ctlType == typeof(WebUI.WebControls.CheckBoxList))//复选框列表
                {
                    WebUI.WebControls.CheckBoxList ck = (WebUI.WebControls.CheckBoxList)ctl;
                    string rs = "";
                    foreach (WebUI.WebControls.ListItem li in ck.Items)
                    {
                        if (li.Selected)
                        {
                            rs += "," + li.Value;
                        }
                    }
                    if (rs.Length > 1)
                    {
                        rs = rs.Substring(1);
                    }
                    entity.SetPropertyValue(pi.Name, rs);
                }
                else if (ctlType == typeof(WebUI.WebControls.RadioButtonList))//单框列表
                {
                    WebUI.WebControls.RadioButtonList ck = (WebUI.WebControls.RadioButtonList)ctl;
                    entity.SetPropertyValue(pi.Name, ck.SelectedValue);
                }
                else if (ctlType == typeof(WebUI.WebControls.ListBox))//列表框
                {
                    WebUI.WebControls.ListBox ck = (WebUI.WebControls.ListBox)ctl;
                    string rs = "";
                    foreach (WebUI.WebControls.ListItem li in ck.Items)
                    {
                        if (li.Selected)
                        {
                            rs += "," + li.Value;
                        }
                    }
                    if (rs.Length > 1)
                    {
                        rs = rs.Substring(1);
                    }
                    entity.SetPropertyValue(pi.Name, rs);
                }
                #endregion
                #region 处理不同Html控件
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputText))//文本域
                {
                    WebUI.HtmlControls.HtmlInputText ct = (WebUI.HtmlControls.HtmlInputText)ctl;
                    entity.SetPropertyValue(pi.Name, ct.Value);
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlTextArea))//文本域
                {
                    WebUI.HtmlControls.HtmlTextArea ct = (WebUI.HtmlControls.HtmlTextArea)ctl;
                    entity.SetPropertyValue(pi.Name, ct.Value);
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlSelect))//选择域
                {
                    WebUI.HtmlControls.HtmlSelect ct = (WebUI.HtmlControls.HtmlSelect)ctl;
                    entity.SetPropertyValue(pi.Name, ct.Items[ct.SelectedIndex].Value);
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputHidden))////隐藏域
                {
                    WebUI.HtmlControls.HtmlInputHidden ct = (WebUI.HtmlControls.HtmlInputHidden)ctl;
                    entity.SetPropertyValue(pi.Name, ct.Value);
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputRadioButton))//单选域
                {
                    WebUI.HtmlControls.HtmlInputRadioButton rb = (WebUI.HtmlControls.HtmlInputRadioButton)ctl;
                    if (rb.Checked)
                    {
                        entity.SetPropertyValue(pi.Name, rb.Value);
                    }
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputCheckBox))//复选域
                {
                    WebUI.HtmlControls.HtmlInputCheckBox ck = (WebUI.HtmlControls.HtmlInputCheckBox)ctl;
                    if (ck.Checked)
                    {
                        entity.SetPropertyValue(pi.Name, ck.Value);
                    }
                }
                else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputPassword))//密码域
                {
                    WebUI.HtmlControls.HtmlInputPassword ck = (WebUI.HtmlControls.HtmlInputPassword)ctl;
                    entity.SetPropertyValue(pi.Name, ck.Value);
                }
                #endregion
            }
        }
Exemple #19
0
 /// <summary>
 /// 填充表单
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="control"></param>
 public static void FillForm(WebUI.Control control, Object entity)
 {
     if (entity == null || control == null)
     {
         return;
     }
     PropertyInfo[] propertyList = entity.GetProperties();
     foreach (PropertyInfo pi in propertyList)
     {
         WebUI.Control ctl = control.FindControl(string.Format(IdFormat, pi.Name));
         if (ctl == null)
         {
             continue;
         }
         Type ctlType = ctl.GetType();
         #region 处理服务器控件
         if (ctlType == typeof(WebUI.WebControls.TextBox))//文本框
         {
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ((WebUI.WebControls.TextBox)ctl).Text = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.Image))//图片
         {
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 string imageUrl = entity.GetPropertyValue(pi.Name).ToString();
                 if (!string.IsNullOrEmpty(imageUrl))
                 {
                     ((WebUI.WebControls.Image)ctl).ImageUrl = imageUrl;
                 }
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.DropDownList))//选择框
         {
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ((WebUI.WebControls.DropDownList)ctl).SelectedValue = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.HiddenField))//隐藏域
         {
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ((WebUI.WebControls.HiddenField)ctl).Value = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.RadioButton))//单选框
         {
             WebUI.WebControls.RadioButton rb = (WebUI.WebControls.RadioButton)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 rb.Checked = entity.GetPropertyValue(pi.Name).ToString() == rb.Text ? true : false;
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.CheckBox))//复选框
         {
             WebUI.WebControls.CheckBox ck = (WebUI.WebControls.CheckBox)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ck.Checked = entity.GetPropertyValue(pi.Name).ToString() == ck.Text ? true : false;
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.CheckBoxList))//复选框列表
         {
             WebUI.WebControls.CheckBoxList ck = (WebUI.WebControls.CheckBoxList)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 string sel = entity.GetPropertyValue(pi.Name).ToString();
                 foreach (WebUI.WebControls.ListItem li in ck.Items)
                 {
                     if (sel.IndexOf(",") > -1 && (sel.IndexOf(li.Value + ",") > -1 || sel.IndexOf("," + li.Value) > -1))
                     {
                         li.Selected = true;
                     }
                     else if (sel.IndexOf(",") == -1 && sel == li.Value)
                     {
                         li.Selected = true;
                     }
                     else
                     {
                         li.Selected = false;
                     }
                 }
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.RadioButtonList))//单框列表
         {
             WebUI.WebControls.RadioButtonList ck = (WebUI.WebControls.RadioButtonList)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ck.SelectedValue = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.WebControls.ListBox))//列表框
         {
             WebUI.WebControls.ListBox ck = (WebUI.WebControls.ListBox)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 string sel = entity.GetPropertyValue(pi.Name).ToString();
                 foreach (WebUI.WebControls.ListItem li in ck.Items)
                 {
                     if (sel.IndexOf(",") > -1 && (sel.IndexOf(li.Value + ",") > -1 || sel.IndexOf("," + li.Value) > -1))
                     {
                         li.Selected = true;
                     }
                     else if (sel.IndexOf(",") == -1 && sel == li.Value)
                     {
                         li.Selected = true;
                     }
                     else
                     {
                         li.Selected = false;
                     }
                 }
             }
         }
         #endregion
         #region 处理不同Html控件
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputText))//文本域
         {
             WebUI.HtmlControls.HtmlInputText ct = (WebUI.HtmlControls.HtmlInputText)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ct.Value = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlTextArea))//文本域
         {
             WebUI.HtmlControls.HtmlTextArea ct = (WebUI.HtmlControls.HtmlTextArea)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ct.Value = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlSelect))//选择域
         {
             WebUI.HtmlControls.HtmlSelect ct = (WebUI.HtmlControls.HtmlSelect)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 for (int i = 0; i < ct.Items.Count; i++)
                 {
                     if (ct.Items[i].Value == entity.GetPropertyValue(pi.Name).ToString())
                     {
                         ct.SelectedIndex = i;
                     }
                 }
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputHidden))////隐藏域
         {
             WebUI.HtmlControls.HtmlInputHidden ct = (WebUI.HtmlControls.HtmlInputHidden)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ct.Value = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputRadioButton))//单选域
         {
             WebUI.HtmlControls.HtmlInputRadioButton rb = (WebUI.HtmlControls.HtmlInputRadioButton)ctl;
             if (rb.Checked && entity.GetPropertyValue(pi.Name) != null)
             {
                 rb.Checked = entity.GetPropertyValue(pi.Name).ToString() == rb.Value ? true : false;
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputCheckBox))//复选域
         {
             WebUI.HtmlControls.HtmlInputCheckBox ck = (WebUI.HtmlControls.HtmlInputCheckBox)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 if (entity.GetPropertyValue(pi.Name).ToString().IndexOf("," + ck.Value) != -1)
                 {
                     ck.Checked = true;
                 }
             }
         }
         else if (ctlType == typeof(WebUI.HtmlControls.HtmlInputPassword))//密码域
         {
             WebUI.HtmlControls.HtmlInputPassword ck = (WebUI.HtmlControls.HtmlInputPassword)ctl;
             if (entity.GetPropertyValue(pi.Name) != null)
             {
                 ck.Value = entity.GetPropertyValue(pi.Name).ToString();
             }
         }
         #endregion
     }
 }
Exemple #20
0
        /// <summary>
        /// 
        /// </summary>
        protected void mainInterface( anmar.SharpWebMail.CTNInbox inbox )
        {
            this.newattachmentPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("newattachmentPH");
            this.attachmentsPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("attachmentsPH");
            this.confirmationPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("confirmationPH");
            this.newMessagePH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("newMessagePH");
            this.newMessageWindowAttachFile=( System.Web.UI.HtmlControls.HtmlInputFile )this.SharpUI.FindControl("newMessageWindowAttachFile");
            this.newMessageWindowAttachmentsList=(System.Web.UI.WebControls.CheckBoxList )this.SharpUI.FindControl("newMessageWindowAttachmentsList");
            this.newMessageWindowAttachmentsAddedList=(System.Web.UI.WebControls.DataList )this.SharpUI.FindControl("newMessageWindowAttachmentsAddedList");

            this.FCKEditor = (FredCK.FCKeditorV2.FCKeditor)this.SharpUI.FindControl("FCKEditor");
            this.fromname = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("fromname");
            this.fromemail = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("fromemail");
            this.subject = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("subject");
            this.toemail = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("toemail");

            #if MONO
            System.Web.UI.WebControls.RequiredFieldValidator rfv = (System.Web.UI.WebControls.RequiredFieldValidator) this.SharpUI.FindControl("ReqbodyValidator");
            rfv.Enabled=false;
            this.Validators.Remove(rfv);
            #endif

            this.newMessageWindowConfirmation = (System.Web.UI.WebControls.Label)this.SharpUI.FindControl("newMessageWindowConfirmation");

            this.SharpUI.refreshPageImageButton.Click += new System.Web.UI.ImageClickEventHandler(refreshPageButton_Click);

            // Disable PlaceHolders
            this.attachmentsPH.Visible = false;
            this.confirmationPH.Visible = false;

            // Disable some things
            this.SharpUI.nextPageImageButton.Enabled = false;
            this.SharpUI.prevPageImageButton.Enabled = false;
            // Get mode
            if ( Page.Request.QueryString["mode"]!=null ) {
                try {
                    this._message_mode = (anmar.SharpWebMail.UI.MessageMode)System.Enum.Parse(typeof(anmar.SharpWebMail.UI.MessageMode), Page.Request.QueryString["mode"], true);
                } catch ( System.Exception ){}
            }
            // Get message ID
            System.String msgid = System.Web.HttpUtility.HtmlEncode (Page.Request.QueryString["msgid"]);
            System.Guid guid = System.Guid.Empty;
            if ( msgid!=null )
                guid = new System.Guid(msgid);
            if ( !this.IsPostBack && !guid.Equals( System.Guid.Empty) ) {
                System.Object[] details = inbox[ guid ];
                if ( details!=null ) {
                    if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.None) )
                        this._message_mode = anmar.SharpWebMail.UI.MessageMode.reply;
                    this._headers = (anmar.SharpMimeTools.SharpMimeHeader) details[13];
                    if ( !this.IsPostBack ) {
                        bool html_content = this.FCKEditor.CheckBrowserCompatibility();

                        this.subject.Value = System.String.Concat (this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "Prefix")), ":");
                        if ( details[10].ToString().ToLower().IndexOf (this.subject.Value.ToLower())!=-1 ) {
                            this.subject.Value = details[10].ToString().Trim();
                        } else {
                            this.subject.Value = System.String.Concat (this.subject.Value, " ", details[10]).Trim();
                        }
                        // Get the original message
                        inbox.CurrentFolder = details[18].ToString();
                        System.IO.MemoryStream ms = inbox.GetMessage((int)details[1], msgid);
                        anmar.SharpMimeTools.SharpMessage message = null;
                        if ( ms!=null && ms.CanRead ) {
                            System.String path = null;
                            if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) ) {
                                path = Session["sharpwebmail/read/message/temppath"].ToString();
                                path = System.IO.Path.Combine (path, msgid);
                                path = System.IO.Path.GetFullPath(path);
                            }
                            bool attachments = false;
                            if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) )
                                attachments = (bool)Application["sharpwebmail/send/message/forwardattachments"];
                            message = new anmar.SharpMimeTools.SharpMessage(ms, attachments, html_content, path);
                        }
                        if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply) ) {
                            // From name if present on original message's To header
                            // and we don't have it already
                            if ( Session["DisplayName"]==null ) {
                                foreach ( anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable) details[8] ) {
                                    if ( address["address"]!=null && address["address"].Equals( User.Identity.Name )
                                        && address["name"].Length>0 && !address["address"].Equals(address["name"]) ) {
                                        this.fromname.Value = address["name"];
                                        break;
                                    }
                                }
                            }
                            // To addresses
                            foreach ( anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable) details[9] ) {
                                if ( address["address"]!=null && !address["address"].Equals( User.Identity.Name ) ) {
                                    if ( this.toemail.Value.Length >0 )
                                        this.toemail.Value += ", ";
                                    this.toemail.Value += address["address"];
                                }
                            }
                        } else if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) ) {
                            // If the original message has attachments, preserve them
                            if ( message!=null && message.Attachments!=null &&  message.Attachments.Count>0 ) {
                                this.bindAttachments();
                                foreach ( anmar.SharpMimeTools.SharpAttachment attachment in message.Attachments ) {
                                    if ( attachment.SavedFile==null )
                                        continue;
                                    this.AttachmentSelect(System.IO.Path.Combine(attachment.SavedFile.Directory.Name, attachment.SavedFile.Name));
                                }
                                this.Attach_Click(this, null);
                            }
                        }
                        // Preserve the original body and some properties
                        if ( message!=null ) {
                            System.Text.StringBuilder sb_body = new System.Text.StringBuilder();
                            System.String line_end = null;
                            if ( html_content )
                                line_end = "<br />\r\n";
                            else
                                line_end = "\r\n";
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "PrefixBody")));
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowFromNameLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.From);
                            sb_body.Append(" [mailto:");
                            sb_body.Append(message.FromAddress);
                            sb_body.Append("]");
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowDateLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.Date.ToString());
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowToEmailLabel"));
                            sb_body.Append(" ");
                            if ( html_content )
                                sb_body.Append(System.Web.HttpUtility.HtmlEncode(message.To.ToString()));
                            else
                                sb_body.Append(message.To);
                            sb_body.Append(line_end);
                            sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowSubjectLabel"));
                            sb_body.Append(" ");
                            sb_body.Append(message.Subject);
                            sb_body.Append(line_end);
                            sb_body.Append(line_end);
                            if ( !message.HasHtmlBody &&  html_content )
                                sb_body.Append("<pre>");
                            sb_body.Append(message.Body);
                            if ( !message.HasHtmlBody &&  html_content )
                                sb_body.Append("</pre>");
                            if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply) ) {
                                if ( html_content ) {
                                    sb_body.Insert(0, System.String.Concat("<blockquote style=\"", Application["sharpwebmail/send/message/replyquotestyle"] ,"\">"));
                                    sb_body.Append("</blockquote>");
                                } else {
                                    sb_body.Insert(0, Application["sharpwebmail/send/message/replyquotechar"].ToString());
                                    sb_body.Replace("\n", System.String.Concat("\n", Application["sharpwebmail/send/message/replyquotechar"]));
                                }
                            }
                            sb_body.Insert(0, line_end);
                            sb_body.Insert(0, " ");
                            this.FCKEditor.Value = sb_body.ToString();
                        }
                    }
                    details = null;
                }
            } else if ( !this.IsPostBack ) {
                System.String to = Page.Request.QueryString["to"];
                if ( to!=null && to.Length>0 ) {
                    this.toemail.Value = to;
                }
            }
            if ( this.fromname.Value.Length>0 || this.IsPostBack )
                Session["DisplayName"] = this.fromname.Value;
            if ( this.fromname.Value.Length==0 && Session["DisplayName"]!=null )
                this.fromname.Value = Session["DisplayName"].ToString();
            if ( this.fromemail.Value.Length>0 || this.IsPostBack )
                Session["DisplayEmail"] = this.fromemail.Value;
        }
Exemple #21
0
 protected void Page_Init()
 {
     this.EnsureChildControls();
     this._book_name = Request.QueryString["book"];
     this._delimiter=(System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("delimiter");
     this._data=(System.Web.UI.HtmlControls.HtmlTextArea)this.SharpUI.FindControl("data");
     System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookLabelItem");
     if ( addrname!=null ) {
         addrname.Text = this._book_name;
     }
     this.SharpUI.nextPageImageButton.Enabled = false;
     this.SharpUI.prevPageImageButton.Enabled = false;
     this.SharpUI.refreshPageImageButton.Enabled = false;
 }
 internal void SendMail_Active_Account(System.Web.UI.HtmlControls.HtmlInputText txtEmail, string p, string p_2, string p_3)
 {
     throw new NotImplementedException();
 }
Exemple #23
0
 private void CreateCtrls()
 {
     System.Web.UI.HtmlControls.HtmlInputText input = new System.Web.UI.HtmlControls.HtmlInputText();
     input.Attributes["style"] = InputStyle;
     input.ID = this.ID + _fileName;
     System.Web.UI.HtmlControls.HtmlInputButton button = new System.Web.UI.HtmlControls.HtmlInputButton();
     button.Attributes["style"] = ButtonStyle;
     button.ID = this.ID + _btnName;
     button.Value = BtnValue;
     this.Controls.Add(input);
     this.Controls.Add(button);
 }
        private void LinkControls(ControlCollection ctrls)
        {
            foreach (Control ctrl in ctrls)
            {
                switch (ctrl.ID)
                {
                case "tgQR":
                    tgQR           = (Toggle)ctrl;
                    tgQR.ImagePath = ThemePath;
                    break;

                case "tgdQR":
                    tgdQR = (ToggleDisplay)ctrl;
                    break;

                case "plhMessage":
                    plhMessage = (PlaceHolder)ctrl;
                    break;

                case "reqUserName":
                    reqUserName = (System.Web.UI.WebControls.RequiredFieldValidator)ctrl;
                    break;

                case "txtUserName":
                    txtUserName = (System.Web.UI.HtmlControls.HtmlInputText)ctrl;
                    break;

                case "reqBody":
                    reqBody = (Label)ctrl;
                    break;

                case "reqSecurityCode":
                    reqSecurityCode = (Label)ctrl;
                    break;

                case "chkSubscribe":
                    chkSubscribe = (CheckBox)ctrl;
                    break;

                case "ambtnSubmit":
                    ambtnSubmit = (ImageButton)ctrl;
                    break;

                case "btnSubmit":
                    btnSubmit = (System.Web.UI.HtmlControls.HtmlInputButton)ctrl;
                    break;

                case "trUsername":
                    trUsername = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;

                case "trCaptcha":
                    trCaptcha = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;

                case "trSubscribe":
                    trSubscribe = (System.Web.UI.HtmlControls.HtmlTableRow)ctrl;
                    break;
                }
                if (ctrl is Controls.ControlsBase)
                {
                    ((Controls.ControlsBase)ctrl).ControlConfig = this.ControlConfig;
                }
                if (ctrl.Controls.Count > 0)
                {
                    LinkControls(ctrl.Controls);
                }
            }
        }
Exemple #25
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlInputText
                tmpInput;

            string
                val;

            tmpInput = new System.Web.UI.HtmlControls.HtmlInputText();
            val      = tmpInput.Value;
            if (val != string.Empty)
            {
                val = string.Empty;
            }
            tmpInput.ID = DynamicInput2Id;
            val         = tmpInput.Value;
            if (val != string.Empty)
            {
                val = string.Empty;
            }
            tmpInput.EnableViewState = false;
            val = tmpInput.Value;
            if (val != string.Empty)
            {
                val = string.Empty;
            }
            tmpInput.Value = "From Server";
            val            = tmpInput.Value;
            if (val != string.Empty)
            {
                val = string.Empty;
            }

            tmpInput.Init   += new EventHandler(tmpInput_Init);
            tmpInput.Load   += new EventHandler(tmpInput_Load);
            tmpInput.Unload += new EventHandler(tmpInput_Unload);

            ContainerServer.Controls.Add(tmpInput);
            val = tmpInput.Value;
            if (val != string.Empty)
            {
                val = string.Empty;
            }

            if (ViewState[ViewStateTestSignature] != null)
            {
                ViewStateTestVar = (bool)ViewState[ViewStateTestSignature];
            }
            else
            {
                ViewState[ViewStateTestSignature] = !ViewStateTestVar;
            }

            if (IsPostBack)
            {
                if ((tmpInput = FindControl(DynamicInput1Id) as System.Web.UI.HtmlControls.HtmlInputText) != null)
                {
                    val = tmpInput.Value;
                    if (val != string.Empty)
                    {
                        val = string.Empty;
                    }
                }

                                #if (SHOW_REQUEST)
                string[]
                array1,
                array2;

                int
                    i,
                    ii;

                ParagraphRequest.Text  = "<br>";
                ParagraphRequest.Text += "Request.Params.Count: \"" + Request.Params.Count + "\"<br>";
                array1 = Request.Params.AllKeys;
                for (i = 0; i < array1.Length; ++i)
                {
                    ParagraphRequest.Text += "Key [" + Convert.ToString(i) + "]=" + Server.HtmlEncode(array1[i]) + "<br>";
                    array2 = Request.Params.GetValues(array1[i]);
                    for (ii = 0; ii < array2.Length; ++ii)
                    {
                        ParagraphRequest.Text += "Value [" + Convert.ToString(ii) + "]=" + Server.HtmlEncode(array2[ii]) + "<br>";
                    }
                }
                ParagraphRequest.Text += "<br>";
                                #endif

                if ((tmpInput = FindControl(DynamicInput2Id) as System.Web.UI.HtmlControls.HtmlInputText) != null)
                {
                    val = tmpInput.Value;
                    if (val != string.Empty)
                    {
                        val = string.Empty;
                    }
                }
                if (ViewState[DynamicInput2Id] != null)
                {
                    val = Convert.ToString(ViewState[DynamicInput2Id]);
                    if (val != string.Empty)
                    {
                        val = string.Empty;
                    }
                }
            }
        }