protected void Page_Load(object sender, EventArgs e)
    {
        CConexion ConexionBaseDatos = new CConexion();
        string    respuesta         = ConexionBaseDatos.ConectarBaseDatosSqlServer();

        if (respuesta == "Conexion Establecida")
        {
            //Llena etiquetas con la informacion solicitada
            int     idOpcion = Convert.ToInt32(this.Request.Params["IdOpcion"]);
            COpcion Opcion   = new COpcion();
            Opcion.LlenaObjeto(idOpcion, ConexionBaseDatos);
            lblOpcionConsulta.Text  = Opcion.Opcion;
            lblComandoConsulta.Text = Opcion.Comando;

            //Agreagar atributos en etiquetas
            HtmlGenericControl divFormulario = Page.FindControl("divFormulario") as HtmlGenericControl;
            divFormulario.Attributes.Add("idOpcion", Convert.ToString(Opcion.IdOpcion));
            divFormulario.Attributes.Add("opcion", Opcion.Opcion);

            HtmlInputControl btnEditar = Page.FindControl("btnEditar") as HtmlInputControl;
            string           onclickFormaEditarOpcion = "javascript:SetFormaEditarOpcion(" + Convert.ToString(Opcion.IdOpcion) + ")";
            btnEditar.Attributes.Add("onclick", onclickFormaEditarOpcion);
        }
        ConexionBaseDatos.CerrarBaseDatos();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        CConexion ConexionBaseDatos = new CConexion();
        string    respuesta         = ConexionBaseDatos.ConectarBaseDatosSqlServer();

        if (respuesta == "Conexion Establecida")
        {
            //Llena etiquetas con la informacion solicitada
            int   idMenu = Convert.ToInt32(this.Request.Params["IdMenu"]);
            CMenu Menu   = new CMenu();
            Menu.LlenaObjeto(idMenu, ConexionBaseDatos);
            lblMenuConsulta.Text = Menu.Menu;

            CProyectoSistema ProyectoSistemaMenu = new CProyectoSistema();
            ProyectoSistemaMenu.LlenaObjeto(Menu.IdProyectoSistema, ConexionBaseDatos);
            lblProyectoSistemaConsulta.Text = ProyectoSistemaMenu.ProyectoSistema;

            //Agreagar atributos en etiquetas
            HtmlGenericControl divFormulario = Page.FindControl("divFormulario") as HtmlGenericControl;
            divFormulario.Attributes.Add("idMenu", Convert.ToString(Menu.IdMenu));
            divFormulario.Attributes.Add("menu", Menu.Menu);

            HtmlInputControl btnEditar = Page.FindControl("btnEditar") as HtmlInputControl;
            string           onclickFormaEditarMenu = "javascript:SetFormaEditarMenu(" + Convert.ToString(Menu.IdMenu) + ")";
            btnEditar.Attributes.Add("onclick", onclickFormaEditarMenu);
        }
        ConexionBaseDatos.CerrarBaseDatos();
    }
        /// <summary>
        /// Handles the ItemDataBound event of the repeaterPaymentMethods control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param>
        protected void repeaterPaymentMethods_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            HtmlInputControl input = e.Item.FindControl("paymentMethod") as HtmlInputControl;

            PaymentSystem method = e.Item.DataItem as PaymentSystem;
            string        code   = string.Empty;

            if (method != null)
            {
                code = method.Code;
            }

            if (input != null)
            {
                input.Value = code;
            }

            if (this.ddlPaymentMethods.SelectedItem != null)
            {
                if (string.Compare(code, this.ddlPaymentMethods.SelectedItem.Value, true) != 0)
                {
                    HtmlControl container = e.Item.FindControl("paymentMethodContainer") as HtmlControl;
                    if (container != null)
                    {
                        container.Attributes["style"] = "display:none;";
                    }
                }
            }
        }
 private void FindControls()
 {
     this.rptProductImages      = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
     this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
     this.litShortDescription   = (Literal)this.FindControl("litShortDescription");
     this.litDescription        = (Literal)this.FindControl("litDescription");
     this.litSoldCount          = (Literal)this.FindControl("soldCount");
     this.litprice              = (Literal)this.FindControl("price");
     this.litcontent            = (Literal)this.FindControl("content");
     this.litminCount           = (Literal)this.FindControl("minCount");
     this.litGroupBuyId         = (HtmlInputControl)this.FindControl("litGroupbuyId");
     this.litLeftSeconds        = (Literal)this.FindControl("leftSeconds");
     this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
     this.linkDescription       = (HyperLink)this.FindControl("linkDescription");
     this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
     this.salePrice             = (Literal)this.FindControl("salePrice");
     this.leftCount             = (Literal)this.FindControl("leftCount");
     this.minSuccessCount       = (Literal)this.FindControl("minSuccessCount");
     this.txtProductId          = (HtmlInputControl)this.FindControl("txtProductId");
     this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount");
     this.litReviewsCount       = (Literal)this.FindControl("litReviewsCount");
     this.litMaxCount           = (Literal)this.FindControl("litMaxCount");
     this.startTime             = (HtmlInputHidden)this.FindControl("startTime");
     this.endTime                = (HtmlInputHidden)this.FindControl("endTime");
     this.groupBuySoldCount      = (HtmlInputHidden)this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount       = (HtmlInputHidden)this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription");
     this.nowTime                = (HtmlInputHidden)this.FindControl("nowTime");
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        CConexion ConexionBaseDatos = new CConexion();
        string    respuesta         = ConexionBaseDatos.ConectarBaseDatosSqlServer();

        if (respuesta == "Conexion Establecida")
        {
            //Llena etiquetas con la informacion solicitada
            int     idPagina = Convert.ToInt32(this.Request.Params["IdPagina"]);
            CPagina Pagina   = new CPagina();
            Pagina.LlenaObjeto(idPagina, ConexionBaseDatos);
            lblPaginaConsulta.Text     = Pagina.Pagina;
            lblTituloConsulta.Text     = Pagina.Titulo;
            lblNombreMenuConsulta.Text = Pagina.NombreMenu;
            chkValidarSucursal.Checked = Pagina.ValidarSucursal;

            CMenu MenuPadre = new CMenu();
            MenuPadre.LlenaObjeto(Pagina.IdMenu, ConexionBaseDatos);
            lblMenuPadreConsulta.Text = MenuPadre.Menu;

            //Agreagar atributos en etiquetas
            HtmlGenericControl divFormulario = Page.FindControl("divFormulario") as HtmlGenericControl;
            divFormulario.Attributes.Add("idPagina", Convert.ToString(Pagina.IdPagina));
            divFormulario.Attributes.Add("pagina", Pagina.Pagina);

            HtmlInputControl btnEditar = Page.FindControl("btnEditar") as HtmlInputControl;
            string           onclickFormaEditarPagina = "javascript:SetFormaEditarPagina(" + Convert.ToString(Pagina.IdPagina) + ")";
            btnEditar.Attributes.Add("onclick", onclickFormaEditarPagina);
        }
        ConexionBaseDatos.CerrarBaseDatos();
    }
Exemple #6
0
    protected void syncOrganVisibility23DBuilder(Object sender, EventArgs e)
    {
        //int index = Convert.ToInt32(e.CommandArgument);
        //Get the button that raised the event
        HtmlInputControl show_Hide_Icon = (HtmlInputControl)sender;

        //Get the row that contains this button
        GridViewRow selectedRow = (GridViewRow)show_Hide_Icon.NamingContainer;


        // Get the last name of the selected author from the appropriate
        // cell in the GridView control.


        var organIndicator = selectedRow.FindControl("LBTextBox_OrganName") as Label;

        string correctOrganName = organIndicator.Text;

        //If the organ is set to be visible
        if ((selectedRow.FindControl("hf_OrganVisibility") as HiddenField).Value == "true")
        {
            string contact = "6 " + "show" + " " + correctOrganName; //send "6 Hide realOrganName" to 3DBuilder

            NamedPipe_IPC_Connection.sendMsg23DBuilder(contact);
        }

        //If the organ is set to be invisible
        else
        {
            string contact = "6 " + "hide" + " " + correctOrganName; //send "6 Hide realOrganName" to 3DBuilder

            NamedPipe_IPC_Connection.sendMsg23DBuilder(contact);
        }
    }
Exemple #7
0
 public static void SetWhenIsNotNull(this Control control, string value)
 {
     if (control == null)
     {
         return;
     }
     if (control is ITextControl)
     {
         ITextControl textControl = (ITextControl)control;
         textControl.Text = value;
         return;
     }
     if (control is HtmlInputControl)
     {
         HtmlInputControl htmlInputControl = (HtmlInputControl)control;
         htmlInputControl.Value = value;
         return;
     }
     if (control is HyperLink)
     {
         HyperLink hyperLink = (HyperLink)control;
         hyperLink.NavigateUrl = value;
         return;
     }
     throw new ApplicationException("未实现" + control.GetType().ToString() + "的SetWhenIsNotNull方法");
 }
    protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        HtmlInputControl TemplateHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode");

        if (TemplateHIC.Value == "")
        {
            e.Values["FileTemplateCode"] = -1;
        }
        if (this.FullPath == "")
        {
            e.Values["FullID"] = "0";
        }
        else
        {
            e.Values["FullID"] = this.FullPath;
        }
        if (this.Deep == "")
        {
            e.Values["Deep"] = 1;
        }
        else
        {
            e.Values["Deep"] = this.Deep;
        }
        e.Values["CreateDate"] = System.DateTime.Now;
    }
Exemple #9
0
        public override HtmlControl Generate()
        {
            HtmlInputControl Input = null;

            switch (InputType)
            {
            case PkInputType.Text: {
                Input = new HtmlInputText();
                break;
            }

            default:
                throw new NotImplementedException();
            }

            Input.Name = Name;
            Input.Attributes["class"] = CssClass;
            Input.Attributes["name"]  = Name;

            if (!string.IsNullOrEmpty(Placeholder))
            {
                Input.Attributes["placeholder"] = Placeholder;
            }

            return(Input);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        CConexion ConexionBaseDatos = new CConexion();
        string    respuesta         = ConexionBaseDatos.ConectarBaseDatosSqlServer();

        if (respuesta == "Conexion Establecida")
        {
            //Llena etiquetas con la informacion solicitada
            int     idPerfil = Convert.ToInt32(this.Request.Params["IdPerfil"]);
            CPerfil Perfil   = new CPerfil();
            Perfil.LlenaObjeto(idPerfil, ConexionBaseDatos);
            lblPerfilConsulta.Text      = Perfil.Perfil;
            chkEsPerfilSucursal.Checked = Perfil.EsPerfilSucursal;

            CPagina Pagina = new CPagina();
            Pagina.LlenaObjeto(Perfil.IdPagina, ConexionBaseDatos);
            lblPaginaConsulta.Text = Pagina.Titulo;

            //Agreagar valores a etiquetas
            HtmlGenericControl divFormulario = Page.FindControl("divFormulario") as HtmlGenericControl;
            divFormulario.Attributes.Add("idPerfil", Convert.ToString(Perfil.IdPerfil));
            divFormulario.Attributes.Add("perfil", Perfil.Perfil);

            HtmlInputControl btnEditar = Page.FindControl("btnEditar") as HtmlInputControl;
            string           onclickFormaEditarPerfil = "javascript:SetFormaEditarPerfil(" + Convert.ToString(Perfil.IdPerfil) + ")";
            btnEditar.Attributes.Add("onclick", onclickFormaEditarPerfil);
        }
        ConexionBaseDatos.CerrarBaseDatos();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int       idPagina          = Convert.ToInt32(this.Request.Params["IdPagina"]);
        CConexion ConexionBaseDatos = new CConexion();
        string    respuesta         = ConexionBaseDatos.ConectarBaseDatosSqlServer();

        if (respuesta == "Conexion Establecida")
        {
            HtmlGenericControl divFormulario = Page.FindControl("divFormulario") as HtmlGenericControl;
            divFormulario.Attributes.Add("idPagina", idPagina.ToString());

            HtmlGenericControl ulPermisosAsignados = Page.FindControl("ulConsultaPermisosAsignados") as HtmlGenericControl;
            string             liPermisosAsignados = "";
            CPaginaPermiso     PermisosAsignados   = new CPaginaPermiso();
            foreach (CPaginaPermiso CPP in PermisosAsignados.PermisosAsignados(idPagina, ConexionBaseDatos))
            {
                COpcion Opcion = new COpcion();
                Opcion.LlenaObjeto(CPP.IdOpcion, ConexionBaseDatos);
                liPermisosAsignados = liPermisosAsignados + "<li title='" + Opcion.Comando + "' opcion='" + Opcion.IdOpcion + "'>" + Opcion.Opcion + "</li>";
            }
            ulPermisosAsignados.InnerHtml = liPermisosAsignados;

            HtmlInputControl btnEditar = Page.FindControl("btnEditar") as HtmlInputControl;
            string           onclickFormaAltaAsignarPermisosPagina = "javascript:SetFormaAltaAsignarPermisosPagina(" + idPagina + ")";
            btnEditar.Attributes.Add("onclick", onclickFormaAltaAsignarPermisosPagina);
        }
        ConexionBaseDatos.CerrarBaseDatos();
    }
Exemple #12
0
 public static void SetWhenIsNotNull(this Control control, string value)
 {
     if (control != null)
     {
         if (!(control is ITextControl))
         {
             if (!(control is HtmlInputControl))
             {
                 if (!(control is HyperLink))
                 {
                     throw new ApplicationException("未实现" + control.GetType().ToString() + "的SetWhenIsNotNull方法");
                 }
                 HyperLink link = (HyperLink)control;
                 link.NavigateUrl = value;
             }
             else
             {
                 HtmlInputControl control3 = (HtmlInputControl)control;
                 control3.Value = value;
             }
         }
         else
         {
             ITextControl control2 = (ITextControl)control;
             control2.Text = value;
         }
     }
 }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName");

        //HtmlInputControl TemplateHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode");
        TemplateNameHIC.Value = "";
    }
 private void FindControls()
 {
     this.rptProductImages      = (AppshopTemplatedRepeater)this.FindControl("rptProductImages");
     this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
     this.litShortDescription   = (Literal)this.FindControl("litShortDescription");
     this.litDescription        = (Literal)this.FindControl("litDescription");
     this.litSoldCount          = (Literal)this.FindControl("soldCount");
     this.litprice              = (Literal)this.FindControl("price");
     this.litcontent            = (Literal)this.FindControl("content");
     this.litminCount           = (Literal)this.FindControl("minCount");
     this.litGroupBuyId         = (HtmlInputControl)this.FindControl("litGroupbuyId");
     this.hidden_IsOver         = (HtmlInputHidden)this.FindControl("hidden_IsOver");
     this.litLeftSeconds        = (Literal)this.FindControl("leftSeconds");
     this.skuSubmitOrder        = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder");
     this.salePrice             = (Literal)this.FindControl("salePrice");
     this.leftCount             = (Literal)this.FindControl("leftCount");
     this.minSuccessCount       = (Literal)this.FindControl("minSuccessCount");
     this.txtProductId          = (HtmlInputControl)this.FindControl("txtProductId");
     this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount");
     this.litReviewsCount       = (Literal)this.FindControl("litReviewsCount");
     this.litMaxCount           = (Literal)this.FindControl("litMaxCount");
     this.startTime             = (HtmlInputHidden)this.FindControl("startTime");
     this.endTime                = (HtmlInputHidden)this.FindControl("endTime");
     this.groupBuySoldCount      = (HtmlInputHidden)this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount       = (HtmlInputHidden)this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription");
     this.groupBuyMaxCount       = (HtmlInputHidden)this.FindControl("groupBuyMaxCount");
     this.skuStock               = (HtmlInputHidden)this.FindControl("skuStock");
     this.hiddenIsLogin          = (HtmlInputHidden)this.FindControl("hiddenIsLogin");
     this.hdCountDownId          = (HtmlInputHidden)this.FindControl("hdCountDownId");
     this.litUnit                = (Literal)this.FindControl("litUnit");
 }
Exemple #15
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (!this.rptProduct.Visible)
            {
                return;
            }

            string pids    = string.Empty;
            bool   isCheck = false;

            foreach (RepeaterItem ri in this.rptProduct.Items)
            {
                CheckBox cb = (CheckBox)ri.FindControl("chb");

                if (cb.Checked)
                {
                    //Response.Write(ri.DataItem["constid"]);
                    //Response.Write("<Br>");

                    HtmlInputControl hic = (HtmlInputControl)ri.FindControl("pid");
                    string           pid = hic.Value;
                    pids = pids + "'" + pid + "',";


                    //Response.Write(hic.Value);

                    isCheck = true;
                }
            }

            pids = pids.TrimEnd(",".ToCharArray());

            if (isCheck)
            {
                //更新数据库
                string connBoss = "user id=psboss;password=pan@data2006;initial catalog=psboss;data source=192.168.72.22,1712;";
                try
                {
                    SqlConnection conn1 = new SqlConnection(connBoss);
                    conn1.Open();

                    string     sql  = string.Format("update product_master set oprflag=0 where productid in ({0})", pids);
                    SqlCommand cmd1 = new SqlCommand(sql, conn1);
                    cmd1.CommandType = CommandType.Text;

                    int i = cmd1.ExecuteNonQuery();

                    this.lblMsg.Text = "执行完成,共 " + i.ToString() + " 条数据被更新";
                }
                catch (Exception e1)
                {
                }
            }

            //Response.Write(pids);


            //bindSearch();
        }
 public static void SimulateRealTextTyping(this HtmlInputControl control, string text)
 {
     control.ScrollToVisible(ScrollToVisibleType.ElementTopAtWindowTop);
     Manager.Current.ActiveBrowser.Window.SetFocus();
     control.Focus();
     control.MouseClick();
     Manager.Current.Desktop.KeyBoard.TypeText(text, 50, 100, true);
 }
 public static void SetText(HtmlInputControl valueCtrl, string text)
 {
     if (valueCtrl == null)
     {
         throw new ArgumentNullException("设置文本内容的控件不能为空!");
     }
     valueCtrl.Value = Utility.HtmlDecode(text.Trim());
 }
Exemple #18
0
 private void ClearInputControls(HtmlInputControl InputCtrl)
 {
     try
     {
         //clear the input controls
         InputCtrl.Value = string.Empty;
     }
     catch { throw; }
 }
Exemple #19
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        HtmlInputControl another = (HtmlInputControl)Page.Master.FindControl("anotherid");
        int anotherid            = Convert.ToInt32(another.Value);
        HtmlInputControl more    = (HtmlInputControl)Page.Master.FindControl("more");
        int moreid = Convert.ToInt32(more.Value);

        Label1.Text = p.ProcessRefreshChatBox(anotherid, (Session[CDKey.LOGINUSER] as tMember).fIdMember, moreid);
    }
    protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName");

        if (TemplateNameHIC.Value == "")
        {
            e.NewValues["FileTemplateCode"] = -1;
        }
    }
        protected override void AttachChildControls()
        {
            this.hidUserPicture   = (HtmlInputHidden)this.FindControl("hidUserPicture");
            this.txtRealName      = (HtmlInputControl)this.FindControl("txtRealName");
            this.txtSex           = (HtmlInputControl)this.FindControl("txtSex");
            this.txtBirthday      = (HtmlInputControl)this.FindControl("txtBirthday");
            this.txtQQ            = (HtmlInputControl)this.FindControl("txtQQ");
            this.txtMSN           = (HtmlInputControl)this.FindControl("txtMSN");
            this.WapLocateAddress = (Common_WAPLocateAddress)this.FindControl(Common_WAPLocateAddress.TagId);
            MemberInfo user = HiContext.Current.User;

            if (!string.IsNullOrEmpty(user.Picture))
            {
                this.hidUserPicture.Value = user.Picture;
            }
            else
            {
                this.hidUserPicture.Value = "/templates/common/images/headerimg.png";
            }
            if (!string.IsNullOrEmpty(user.RealName))
            {
                this.txtRealName.Value = user.RealName;
            }
            switch (user.Gender)
            {
            case Gender.NotSet:
                this.txtSex.Value = "";
                break;

            case Gender.Male:
                this.txtSex.Value = "男士";
                break;

            case Gender.Female:
                this.txtSex.Value = "女士";
                break;
            }
            if (user.BirthDate.HasValue)
            {
                this.txtBirthday.Value = user.BirthDate.Value.ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(user.QQ))
            {
                this.txtQQ.Value = user.QQ;
            }
            if (!string.IsNullOrEmpty(user.NickName))
            {
                this.txtMSN.Value = user.NickName;
            }
            if (this.WapLocateAddress != null)
            {
                this.WapLocateAddress.RegionId = user.RegionId;
                this.WapLocateAddress.Address  = user.Address;
            }
            PageTitle.AddSiteNameTitle("个人信息");
        }
Exemple #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     foreach (Control c in Form.Controls)
     {
         HtmlInputControl ic = c as HtmlInputControl;
         if (ic != null)
         {
             Debug.WriteLine("Name: {0}, Value {1}", ic.Name, ic.Value);
         }
     }
 }
Exemple #23
0
 private void bindDefaultAirportInfo(string code, HtmlInputControl valueControl, HtmlInputControl textControl)
 {
     if (!string.IsNullOrWhiteSpace(code))
     {
         var airport = Service.FoundationService.QueryAirport(code);
         if (airport != null && airport.Location != null)
         {
             valueControl.Value = airport.Code.Value;
             textControl.Value  = airport.Location.Name + "[" + airport.Code + "]";
         }
     }
 }
 protected void btnUpdateCart_Click(object sender, EventArgs e)
 {
     foreach (RepeaterItem i in rptCardItems.Items)
     {
         HtmlInputControl txtId       = (HtmlInputControl)i.FindControl("txtId");
         TextBox          txtQuantity = (TextBox)i.FindControl($"txtqtyhide");
         DataTable        dt          = BL.getProductPrice(Convert.ToInt32(txtId.Value));
         BL.UpdateItemInCart(Convert.ToInt32(Session["CartId"].ToString()), Convert.ToInt32(txtId.Value),
                             Convert.ToInt32(txtQuantity.Text), Convert.ToDouble(dt.Rows[0]["Price"].ToString()) * Convert.ToInt32(txtQuantity.Text));
     }
     GetItems();
 }
Exemple #25
0
 public static string GetText(HtmlInputControl valueCtrl)
 {
     if (valueCtrl == null)
     {
         throw new ArgumentNullException("获取文本内容的控件不能为空!");
     }
     if (TextUtility.EmptyTrimOrNull(valueCtrl.Value))
     {
         return("");
     }
     return(TextFilter.FilterScript(valueCtrl.Value.Trim()));
 }
Exemple #26
0
    protected void FormView1_DataBound(object sender, EventArgs e)
    {
        switch (this.FormView1.CurrentMode)
        {
        case FormViewMode.Edit:

            HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName");
            HtmlInputControl TemplateHIC     = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode");
            TemplateNameHIC.Value = RmsDM.BFL.FileTemplateBFL.GetTemplateName(TemplateHIC.Value);

            HtmlInputHidden tbxUnitCode = (HtmlInputHidden)this.FormView1.Row.FindControl("txtUnit");
            HtmlInputText   tbxUnitName = (HtmlInputText)this.FormView1.Row.FindControl("txtUnitName");
            tbxUnitName.Value = RmsPM.BLL.SystemRule.GetUnitName(tbxUnitCode.Value);

            break;

        case FormViewMode.Insert:
            RmsDM.BFL.DocumentDirectoryBFL     docDirBFL = new RmsDM.BFL.DocumentDirectoryBFL();
            RmsDM.MODEL.DocumentDirectoryModel ddModel   = docDirBFL.GetDocumentDirectory(int.Parse(Request["DirectorCode"]));
            int    FileTemplateCode = ddModel.FileTemplateCode;
            string DepartmentCode   = ddModel.DepartmentCode;

            Label labFileTemplateCode = (Label)this.FormView1.Row.FindControl("FileTemplateCodeLabel");
            labFileTemplateCode.Text = RmsDM.BFL.FileTemplateBFL.GetTemplateName(Convert.ToString(FileTemplateCode));


            Label labDepartmentCode = (Label)this.FormView1.Row.FindControl("ApplyDepartmentCodeLabel");
            labDepartmentCode.Text = RmsPM.BLL.SystemRule.GetUnitName(DepartmentCode);

            TextBox txtCounts = (TextBox)this.FormView1.Row.FindControl("txtCounts");
            txtCounts.Text = "1";
            TextBox txtLeaves = (TextBox)this.FormView1.Row.FindControl("txtLeaves");
            txtLeaves.Text = "1";

            break;

        case FormViewMode.ReadOnly:

            Label tbxUnit = (Label)this.FormView1.Row.FindControl("ApplyDepartmentCodeLabel");
            tbxUnit.Text = RmsPM.BLL.SystemRule.GetUnitName(tbxUnit.Text);

            Label labUser = (Label)this.FormView1.Row.FindControl("ApplyUserCodeLabel");
            labUser.Text = WebFunctionRule.GetUserNameByCode(labUser.Text);


            Label labGreateUser = (Label)this.FormView1.Row.FindControl("CreateUserCodeLabel");
            labGreateUser.Text = WebFunctionRule.GetUserNameByCode(labGreateUser.Text);

            Label labLastModifyUser = (Label)this.FormView1.Row.FindControl("LastModifyByUserCodeLabel");
            labLastModifyUser.Text = WebFunctionRule.GetUserNameByCode(labLastModifyUser.Text);
            break;
        }
    }
 public static string GetTextAndFilter(HtmlInputControl valueCtrl)
 {
     if (valueCtrl == null)
     {
         throw new ArgumentNullException("获取文本内容的控件不能为空!");
     }
     if (string.IsNullOrEmpty(valueCtrl.Value))
     {
         return("");
     }
     return(Utility.HtmlEncode(TextFilter.FilterSql(TextFilter.FilterScript(valueCtrl.Value.Trim()))));
 }
        protected override void AttachChildControls()
        {
            this.txtRegionName            = (Literal)this.FindControl("regionName");
            this.txtRegionId              = (HtmlInputControl)this.FindControl("region");
            this.txtAddress               = (HtmlTextArea)this.FindControl("address");
            this.txtIsDeliveryScopeRegion = (HtmlInputHidden)this.FindControl("IsDeliveryScopeRegion");
            this.txtBuildingNumber        = (HtmlTextArea)this.FindControl("txtBuildingNumber");
            if (this.txtIsDeliveryScopeRegion != null)
            {
                this.txtIsDeliveryScopeRegion.Value = this.IsDeliveryScopeRegion.ToString().ToLower();
            }
            int?regionId = this.RegionId;

            if (regionId.HasValue)
            {
                if (this.txtRegionId != null)
                {
                    HtmlInputControl htmlInputControl = this.txtRegionId;
                    regionId = this.RegionId;
                    htmlInputControl.Value = regionId.ToString();
                }
                if (this.txtRegionName != null)
                {
                    Literal literal = this.txtRegionName;
                    regionId     = this.RegionId;
                    literal.Text = RegionHelper.GetFullRegion(regionId.Value, this.separator, true, 0);
                }
            }
            else if (this.txtRegionName != null)
            {
                this.txtRegionName.Text = "请选择省市区";
            }
            if (string.IsNullOrEmpty(this.txtRegionName.Text))
            {
                this.txtRegionName.Text = "请选择省市区";
            }
            if (this.ShowAddress)
            {
                if (this.txtAddress != null)
                {
                    this.txtAddress.Value = this.Address;
                }
                if (this.txtBuildingNumber != null)
                {
                    this.txtBuildingNumber.Value = this.BuildingNumber;
                }
            }
            else
            {
                this.txtAddress.Visible = false;
            }
        }
 private void FindControls()
 {
     this.divShortDescription   = (HtmlGenericControl)this.FindControl("divShortDescription");
     this.rptProductImages      = (WapTemplatedRepeater)this.FindControl("rptProductImages");
     this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
     this.litShortDescription   = (Literal)this.FindControl("litShortDescription");
     this.litDescription        = (Literal)this.FindControl("litDescription");
     this.litSoldCount          = (Literal)this.FindControl("soldCount");
     this.litprice              = (Literal)this.FindControl("price");
     this.litcontent            = (Literal)this.FindControl("content");
     this.litminCount           = (Literal)this.FindControl("minCount");
     this.litGroupBuyId         = (HtmlInputControl)this.FindControl("litGroupbuyId");
     this.hidden_IsOver         = (HtmlInputHidden)this.FindControl("hidden_IsOver");
     this.hidden_pdEx           = (HtmlInputHidden)this.FindControl("hidden_pdEx");
     this.litLeftSeconds        = (Literal)this.FindControl("leftSeconds");
     this.skuSubmitOrder        = (Common_SKUSubmitStoreOrder)this.FindControl("skuSubmitOrder");
     this.salePrice             = (Literal)this.FindControl("salePrice");
     this.leftCount             = (Literal)this.FindControl("leftCount");
     this.minSuccessCount       = (Literal)this.FindControl("minSuccessCount");
     this.txtProductId          = (HtmlInputControl)this.FindControl("txtProductId");
     this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount");
     this.litReviewsCount       = (Literal)this.FindControl("litReviewsCount");
     this.litMaxCount           = (Literal)this.FindControl("litMaxCount");
     this.startTime             = (HtmlInputHidden)this.FindControl("startTime");
     this.endTime                = (HtmlInputHidden)this.FindControl("endTime");
     this.groupBuySoldCount      = (HtmlInputHidden)this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount       = (HtmlInputHidden)this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription");
     this.groupBuyMaxCount       = (HtmlInputHidden)this.FindControl("groupBuyMaxCount");
     this.skuStock               = (HtmlInputHidden)this.FindControl("skuStock");
     this.hiddenIsLogin          = (HtmlInputHidden)this.FindControl("hiddenIsLogin");
     this.hdAppId                = (HtmlInputHidden)this.FindControl("hdAppId");
     this.hdTimestamp            = (HtmlInputHidden)this.FindControl("hdTimestamp");
     this.hdNonceStr             = (HtmlInputHidden)this.FindControl("hdNonceStr");
     this.hdSignature            = (HtmlInputHidden)this.FindControl("hdSignature");
     this.hdTitle                = (HtmlInputHidden)this.FindControl("hdTitle");
     this.hdDesc         = (HtmlInputHidden)this.FindControl("hdDesc");
     this.hdImgUrl       = (HtmlInputHidden)this.FindControl("hdImgUrl");
     this.hdLink         = (HtmlInputHidden)this.FindControl("hdLink");
     this.hdCountDownId  = (HtmlInputHidden)this.FindControl("hdCountDownId");
     this.hidLngLat      = (HtmlInputHidden)this.FindControl("hidLngLat");
     this.litPdImgSlides = (Literal)this.FindControl("litPdImgSlides");
     this.hidNoData      = (HtmlInputHidden)this.FindControl("hidNoData");
     this.hidRecommend   = (HtmlInputHidden)this.FindControl("hidRecommend");
     this.hidStoreType   = (HtmlInputHidden)this.FindControl("hidStoreType");
     this.hidStoreId     = (HtmlInputHidden)this.FindControl("hidStoreId");
     this.hidStoreName   = (HtmlInputHidden)this.FindControl("hidStoreName");
     this.hidQQMapKey    = (HtmlInputHidden)this.FindControl("hidQQMapKey");
     this.hidLanLng      = (HtmlInputHidden)this.FindControl("hidLanLng");
     this.expandAttr     = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
     this.litUnit        = (Literal)this.FindControl("litUnit");
 }
        private ArrayList GetUserGroups()
        {
            ArrayList groups = new ArrayList();

            foreach (DataListItem itm in dlGroups.Items)
            {
                HtmlInputControl hfGroupId = (HtmlInputControl)itm.FindControl("hfGroupId");
                CheckBox         cbSel     = (CheckBox)itm.FindControl("cbGroupSel");
                if (cbSel.Checked)
                {
                    groups.Add(Convert.ToInt32(hfGroupId.Value));
                }
            }
            return(groups);
        }
 private static bool IsColorControl(HtmlInputControl control)
 {
     var dataType = control.Attributes.FirstOrDefault(x => x.Name == "data-type");
     return dataType != null && dataType.Value == "color";
 }