Exemple #1
0
 public void MergeStyle(System.Web.UI.WebControls.Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         this.ControlStyle.MergeWith(s);
     }
 }
Exemple #2
0
 public void ApplyStyle(System.Web.UI.WebControls.Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         this.ControlStyle.CopyFrom(s);
     }
 }
Exemple #3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            //给页面Title加上 当前用户的公司名称结尾
            if (this.Header != null && PageType == PageType.general)
            {
                AddMetaContentType();
            }

            if (Header != null && PageType == PageType.boxyPage)//重写弹窗页面样式
            {
                System.Web.UI.WebControls.Style style = new System.Web.UI.WebControls.Style();
                style.BackColor = System.Drawing.Color.FromArgb(0xe9f4f9);
                Header.StyleSheet.CreateStyleRule(style, null, "body,html");
            }
        }
Exemple #4
0
 public TemplateGroup(string groupName, System.Web.UI.WebControls.Style groupStyle)
 {
 }
 public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, System.Web.UI.WebControls.Style style)
 {
 }
Exemple #6
0
        /// <summary>
        /// Sends the ToolCheckBox content to a provided HtmlTextoutput object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="output">The HtmlTextoutput object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter output)
        {
            bool useSpan = false;

            if (!Enabled)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
                useSpan = true;
            }

            if (BorderColorRollOver != Color.Empty && AllowRollOver)
            {
                output.AddAttribute(string.Format("onMouseover=\"this.style.borderColor='{0}'\"", Utils.Color2Hex(this.BorderColorRollOver)), null);
                output.AddAttribute(string.Format("onMouseout=\"this.style.borderColor='{0}'\"", Utils.Color2Hex(this.BorderColor)), null);
            }

            string toolTipText = ToolTip;

            if (toolTipText.Length > 0)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Title, toolTipText);
                useSpan = true;
            }

            if (ControlStyleCreated)
            {
                System.Web.UI.WebControls.Style style = base.ControlStyle;
                style.AddAttributesToRender(output, this);
                useSpan = true;
            }

            if (Attributes.Count != 0)
            {
                System.Web.UI.AttributeCollection attributeCollection = Attributes;
                string attributeValue = attributeCollection["value"];
                if (attributeValue != null)
                {
                    attributeCollection.Remove("value");
                }
                if (attributeCollection.Count != 0)
                {
                    attributeCollection.AddAttributes(output);
                    useSpan = true;
                }
                if (attributeValue != null)
                {
                    attributeCollection["value"] = attributeValue;
                }
            }
            if (useSpan)
            {
                output.RenderBeginTag(HtmlTextWriterTag.Span);
            }

            if (this.ClientSideClick != string.Empty)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Onclick, this.ClientSideClick);
            }

            /*if (this.ClientSideOver != string.Empty)
             *      output.AddAttribute("onmouseover", this.ClientSideOver);*/

            if (Text.Length == 0)
            {
                RenderInputTag(output, ClientID);
            }
            else if (TextAlign == System.Web.UI.WebControls.TextAlign.Left)
            {
                RenderLabel(output, Text, ClientID);
                RenderInputTag(output, ClientID);
            }
            else
            {
                RenderInputTag(output, ClientID);
                RenderLabel(output, Text, ClientID);
            }

            if (useSpan)
            {
                output.RenderEndTag();
            }
        }
Exemple #7
0
 public virtual void ExitStyle(System.Web.UI.WebControls.Style style)
 {
 }
Exemple #8
0
 public virtual void ExitStyle(System.Web.UI.WebControls.Style style, System.Web.UI.HtmlTextWriterTag tag)
 {
 }
 public virtual void CopyFrom(System.Web.UI.WebControls.Style s)
 {
 }
        public bool Exportar(DataTable dt, string nombre, string path)
        {
            if (dt.Rows.Count <= 0)
            {
                return(false);
            }

            String nom_archivo = nombre;                             // +"_0";
            String ubi_archivo = path + "\\" + nom_archivo + ".xls"; //Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), nom_archivo + ".xls");

            //BORRANDO ARCHIVO EXISTENTE
            //if(System.IO.File.Exists(ubi_archivo))
            //{   if(HelpPV.MsjShowQs("Desea reemplazar archivo") == DialogResult.OK)
            //        System.IO.File.Delete(ubi_archivo);
            //    else return false;
            //}

            //CORRELATIVO
            bool verifica = true;

            while (System.IO.File.Exists(ubi_archivo))
            {
                //for(int i=0;i<=nom_archivo.Substring(nom_archivo.Length - 1, 1)-1;i++)
                if (verifica)
                {
                    nom_archivo = nombre + "_0";
                    verifica    = false;
                }
                else
                {
                    nom_archivo = nombre + "_" + Convert.ToInt32(nom_archivo.Substring(nombre.Length + 1));
                }

                int valor = int.Parse(nom_archivo.Substring(nom_archivo.Length - 1, 1));
                nom_archivo = nombre + "_" + (valor + 1).ToString();
                ubi_archivo = path + "\\" + nom_archivo + ".xls";;
            }

            System.Web.UI.WebControls.DataGrid grid = new System.Web.UI.WebControls.DataGrid();
            grid.HeaderStyle.Font.Bold = true;
            grid.CellSpacing           = 10;
            grid.HeaderStyle.BackColor = System.Drawing.Color.Silver;

            /*
             * DataRow dr = dt.NewRow();
             * dr[0] = "RUC: " + Session.RucEmpresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresaresa;
             * dt.Rows.InsertAt(dr, 0);
             */
            grid.DataSource = dt;
            grid.DataMember = dt.TableName;
            grid.DataBind();

            using (StreamWriter sw = new StreamWriter(ubi_archivo))
            {
                using (HtmlTextWriter hw = new HtmlTextWriter(sw))
                {
                    System.Web.UI.WebControls.Style estilo = new System.Web.UI.WebControls.Style();
                    estilo.Font.Bold = true;
                    estilo.ForeColor = Color.Blue;
                    hw.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12");
                    //estilo.Font.Size.Unit.Value = 12M;
                    hw.EnterStyle(estilo);

                    hw.WriteLine("EMPRESA: " + Session.NombreUsuario);
                    hw.WriteBreak();
                    hw.WriteLine("RUC: " + Session.RucEmpresa);
                    hw.WriteBreak();
                    hw.WriteLine("EJERCICIO: " + Session.RucEmpresa);
                    hw.WriteBreak();
                    hw.WriteLine(" ");

                    grid.RenderControl(hw);
                }
            }

            direccion = ubi_archivo;

            return(true);
        }
Exemple #11
0
 public virtual ITemplateEditingFrame CreateFrame(TemplatedControlDesigner designer, string frameName, string[] templateNames, System.Web.UI.WebControls.Style controlStyle, System.Web.UI.WebControls.Style[] templateStyles)
 {
 }
 public override void MergeWith(System.Web.UI.WebControls.Style s)
 {
 }
 public override void CopyFrom(System.Web.UI.WebControls.Style s)
 {
 }
Exemple #14
0
 public virtual new void EnterStyle(System.Web.UI.WebControls.Style style, HtmlTextWriterTag tag)
 {
 }
Exemple #15
0
 public virtual new void EnterStyle(System.Web.UI.WebControls.Style style)
 {
 }
 public void ApplyStyle(System.Web.UI.WebControls.Style s)
 {
 }
 public void MergeStyle(System.Web.UI.WebControls.Style s)
 {
 }
 public virtual void MergeWith(System.Web.UI.WebControls.Style s)
 {
 }