protected void btnAddShop_Click(object sender, EventArgs e) { Button b = sender as Button; if (b == null) return; //string cstr1 = "<dl><dt>网店名称:</dt><dd><input id=\"txt_addShopName\" runat=\"server\" type=\"text\" /></dd></dl>"; //string cstr2 = "<dl><dt>网店地址:</dt><dd><input id=\"txt_addShopUrl\" runat=\"server\" type=\"text\" /></dd></dl>"; Control cShopName = new HtmlGenericControl("dl"); HtmlGenericControl html = new HtmlGenericControl("dt"); html.InnerText = "网店名称"; cShopName.Controls.Add(html); html = new HtmlGenericControl("dd"); cShopName.Controls.Add(html); HtmlInputText input = new HtmlInputText("text"); input.ID = "txt_ShopName" + hid_ShopCount.Value; cShopName.Controls[1].Controls.Add(input); Control cShopUrl = new HtmlGenericControl("dl"); html = new HtmlGenericControl("dt"); html.InnerText = "网店地址"; cShopUrl.Controls.Add(html); html = new HtmlGenericControl("dd"); cShopUrl.Controls.Add(html); input = new HtmlInputText("text"); input.ID = "txt_ShopUrl" + hid_ShopCount.Value; cShopUrl.Controls[1].Controls.Add(input); b.Parent.Controls.AddAt(8, cShopUrl); b.Parent.Controls.AddAt(8, cShopName); int count = 1; int.TryParse(hid_ShopCount.Value, out count); hid_ShopCount.Value = (count++).ToString(); }
protected void dgSelectedFabrics_ItemDataBound(object sender, DataGridItemEventArgs e) { DataGridItem item = e.Item; if (item.ItemIndex > -1 && item.DataItem is FabricCodeBO) { FabricCodeBO objFabric = (FabricCodeBO)item.DataItem; PriceBO objPrice = (new PriceBO()).GetAllObject().SingleOrDefault(o => o.Pattern == int.Parse(this.hdnPattern.Value) && o.FabricCode == objFabric.ID); Literal litSetCost = (Literal)item.FindControl("litSetCost"); litSetCost.Text = "Set cost for all levels"; HtmlInputText txtSetCost = (HtmlInputText)item.FindControl("txtSetCost"); HtmlControl olPriceTable = (HtmlControl)item.FindControl("olPriceTable"); HtmlButton btnApply = (HtmlButton)item.FindControl("btnApply"); btnApply.Attributes.Add("table", olPriceTable.ClientID); HtmlButton btnUpdate = (HtmlButton)item.FindControl("btnUpdate"); btnUpdate.Attributes.Add("qid", objFabric.ID.ToString()); btnUpdate.InnerText = (objPrice != null) ? "Update" : "Add"; HtmlButton btnDelete = (HtmlButton)item.FindControl("btnDelete"); btnDelete.Attributes.Add("qid", objFabric.ID.ToString()); Repeater rptPriceLevelCost = (Repeater)item.FindControl("rptPriceLevelCost"); if (objPrice != null) // Update { decimal factoryCost = objPrice.PriceLevelCostsWhereThisIsPrice.Select(o => o.FactoryCost).Aggregate((x, y) => x + y); isEnableIndimanCost = (factoryCost > 0); litSetCost.Visible = isEnableIndimanCost; txtSetCost.Visible = isEnableIndimanCost; btnApply.Visible = isEnableIndimanCost; btnUpdate.Visible = isEnableIndimanCost; rptPriceLevelCost.DataSource = objPrice.PriceLevelCostsWhereThisIsPrice; } else // Add New { litSetCost.Visible = false; txtSetCost.Visible = false; btnApply.Visible = false; List <DistributorPriceMarkupBO> lstPriceMarkups = (new DistributorPriceMarkupBO()).GetAllObject().Where(o => (int)o.Distributor == int.Parse(this.ddlDistributors.SelectedValue.Trim())).ToList(); rptPriceLevelCost.DataSource = lstPriceMarkups; } rptPriceLevelCost.DataBind(); } }
protected void FormView1_DataBound(object sender, EventArgs e) { if (this.FormView1.CurrentMode == FormViewMode.ReadOnly) { Label tbxUnit = (Label)this.FormView1.Row.FindControl("UnitLabel"); tbxUnit.Text = RmsPM.BLL.SystemRule.GetUnitName(tbxUnit.Text); } if (this.FormView1.CurrentMode == FormViewMode.Edit) { HtmlInputHidden tbxUnitCode = (HtmlInputHidden)this.FormView1.Row.FindControl("txtUnit"); HtmlInputText tbxUnitName = (HtmlInputText)this.FormView1.Row.FindControl("txtUnitName"); tbxUnitName.Value = RmsPM.BLL.SystemRule.GetUnitName(tbxUnitCode.Value); } }
/// <summary> /// Adds the new choice label. /// </summary> /// <param name="text">The text.</param> public void AddNewChoiceLabel(string text) { HtmlInputText newChoice = ActiveBrowser.Find.AllByExpression <HtmlInputText>("placeholder=Enter label").LastOrDefault(); newChoice.ScrollToVisible(); newChoice.Focus(); newChoice.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
//控件可见性和可用性 private void contrlkjx() { //添加 if (action == "add") { iffankui.Disabled = false; btnsave.Visible = true; btnadd.Visible = true; delete.Visible = true; } //修改 if (action == "edit") { iffankui.Disabled = false; btnsave.Visible = true; btnadd.Visible = true; delete.Visible = true; } //查看和审核 if (action == "view" || action == "audit") { iffankui.Disabled = true; btnsave.Visible = false; btnadd.Visible = false; delete.Visible = false; } //反馈 if (action == "fankui") { iffankui.Disabled = true; btnsave.Visible = true; btnadd.Visible = false; delete.Visible = false; foreach (RepeaterItem item in rpt1.Items) { TextBox detailpername = item.FindControl("detailpername") as TextBox; TextBox startlocation = item.FindControl("startlocation") as TextBox; TextBox endlocation = item.FindControl("endlocation") as TextBox; HtmlInputText planstartdate = item.FindControl("planstartdate") as HtmlInputText; HtmlInputText planenddate = item.FindControl("planenddate") as HtmlInputText; detailpername.Enabled = false; startlocation.Enabled = false; endlocation.Enabled = false; planstartdate.Disabled = true; planenddate.Disabled = false; } } }
public void checkmandatory() { ObjAdduserDI objadddiuser = new ObjAdduserDI(myManager); HtmlInputText oprid = objadddiuser.operatoridtxt.As <HtmlInputText>(); HtmlInputText fn = objadddiuser.txtfirstname.As <HtmlInputText>(); HtmlInputText ln = objadddiuser.txtlastname.As <HtmlInputText>(); HtmlInputEmail em = objadddiuser.txtemail.As <HtmlInputEmail>(); HtmlInputText phn = objadddiuser.txtphone.As <HtmlInputText>(); oprid.Text = _operatormandatory; fn.Text = _fnmandatory; ln.Text = _lnmandatory; em.Text = _emailmandatory; phn.Text = _phnmandatory; Thread.Sleep(1000); myManager.ActiveBrowser.RefreshDomTree(); Element savebutton = objadddiuser.savebtn; myManager.ActiveBrowser.Actions.Click(savebutton); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); Element opridmsg = objadddiuser.oprmandatorymsg; Assert.IsTrue(opridmsg.InnerText.Contains("Operator ID is mandatory.")); Element fnmsg = objadddiuser.fnmandatorymsg; Assert.IsTrue(fnmsg.InnerText.Contains("First name is mandatory.")); Element lnmsg = objadddiuser.lnmandatorymsg; Assert.IsTrue(lnmsg.InnerText.Contains("Last name is mandatory")); Element emailmsg = objadddiuser.emailmandatorymsg; Assert.IsTrue(emailmsg.InnerText.Contains("Email is mandatory")); Element phonemsg = objadddiuser.phnmandatorymsg; Assert.IsTrue(phonemsg.InnerText.Contains("Phone number is mandatory")); Thread.Sleep(3000); myManager.ActiveBrowser.RefreshDomTree(); }
public void verifyLocked() { ObjMenus menus = new ObjMenus(myManager); HtmlListItem system = menus.systemlink.As <HtmlListItem>(); system.MouseHover(); myManager.ActiveBrowser.RefreshDomTree(); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlAnchor users = menus.userslink.As <HtmlAnchor>(); users.MouseClick(); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); ObjLogin objlogin = new ObjLogin(myManager); HtmlInputText usernm = objlogin.txtusername.As <HtmlInputText>(); HtmlInputPassword pw = objlogin.txtpassword.As <HtmlInputPassword>(); Element login = objlogin.btnlogin; usernm.Text = "admin"; pw.Text = "admin"; myManager.ActiveBrowser.Actions.Click(login); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlInputText usersearch = objlogin.usernamesearch.As <HtmlInputText>(); usersearch.Text = _searchusername; myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, usersearch.GetRectangle()); myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); HtmlTable usertbl = objlogin.usertable.As <HtmlTable>(); Assert.AreEqual(usertbl.BodyRows[0].Cells[7].InnerText, _status); Thread.Sleep(2000); }
public static void ObservationDate(ref HtmlInputText myDate, ref TextBox myText, ref HtmlInputText myCount, string action, int textLength, string category, string area, string itemCode, string userID, string appraisalYear, string appraisalSchool, string appraisalSession, string employeeID) { if (action == "Get") { myText.Text = AppraisalDataObservation.ObservationDate("Text", userID, appraisalYear, appraisalSchool, employeeID, appraisalSession, category, area, itemCode); myCount.Value = (textLength - myText.Text.Length).ToString(); myDate.Value = AppraisalDataObservation.ObservationDate("Date", userID, appraisalYear, appraisalSchool, employeeID, appraisalSession, category, area, itemCode); } else { string value = myText.Text; string date = myDate.Value; string result = AppraisalDataObservation.ObservationDate("Save", userID, appraisalYear, appraisalSchool, employeeID, appraisalSession, category, area, itemCode, date, value); } }
protected override void AttachChildControls() { MemberInfo currentMember = MemberProcessor.GetCurrentMember(); if (currentMember != null) { HtmlInputText control = (HtmlInputText)this.FindControl("txtRealName"); HtmlInputText text2 = (HtmlInputText)this.FindControl("txtPhone"); HtmlInputText text3 = (HtmlInputText)this.FindControl("txtMicroSignal"); control.SetWhenIsNotNull(currentMember.RealName); text2.SetWhenIsNotNull(currentMember.CellPhone); text3.SetWhenIsNotNull(currentMember.MicroSignal); } PageTitle.AddSiteNameTitle("我的名片"); }
/// <summary> /// 设置Go的样子 /// </summary> /// <param name="str"></param> /// <param name="txt"></param> public override void GetGoText(StringBuilder str, HtmlInputText txt) { string url = GetURL(); str.Append("\n<a id=\"P_GO\" "); str.Append("onclick=\"QPGo('"); str.Append(txt.ClientID); str.Append("','"); str.Append(url); str.Append("')\" style=\"cursor:hand;\">"); str.Append(MyPager.PageUIGO); str.Append("</a>"); }
/// <summary> /// Changes the use ajax submit in advanced settings. /// </summary> /// <param name="text">The text.</param> public void ChangeUseAjaxSubmitInAdvancedSettings(string text) { HtmlInputText ajaxSubmit = EM.Forms.FormsBackend.UseAjaxSubmit .AssertIsPresent("Use Ajax submit"); ajaxSubmit.ScrollToVisible(); ajaxSubmit.Focus(); ajaxSubmit.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
public static void STRTextContent(ref TextBox myText, ref HtmlInputText myCount, string action, int textLength, string category, string area, string itemCode, string userID, string appraisalYear, string appraisalSchool, string appraisalSession, string employeeID) { string column = myText.ID.Substring(8, 1); if (action == "Get") { myText.Text = AppraisalDataStrategy.TextContent(userID, appraisalYear, appraisalSchool, employeeID, appraisalSession, category, area, itemCode, column); myCount.Value = (textLength - myText.Text.Length).ToString(); } else { string value = myText.Text; string result = AppraisalDataStrategy.TextContent(userID, appraisalYear, appraisalSchool, employeeID, appraisalSession, category, area, itemCode, column, value); } }
private void CreateCommentCell(TableRow row, int index) { using (TableCell cell = new TableCell()) { using (HtmlInputText commentTextBox = new HtmlInputText()) { commentTextBox.ID = "CommentTextBox" + index; commentTextBox.Attributes.Add("class", "comment"); cell.Controls.Add(commentTextBox); } row.Controls.Add(cell); } }
public void DefaultProperties() { HtmlInputText it = new HtmlInputText(); Assert.AreEqual(defaultAttributesCount, it.Attributes.Count, "Attributes.Count"); Assert.AreEqual(-1, it.MaxLength, "MaxLength"); Assert.IsNull(it.Name, "Name"); Assert.AreEqual(-1, it.Size, "Size"); Assert.AreEqual("text", it.Type, "Type"); Assert.AreEqual(String.Empty, it.Value, "Value"); Assert.AreEqual("input", it.TagName, "TagName"); Assert.AreEqual(defaultAttributesCount, it.Attributes.Count, "Attributes.Count-2"); }
private bool CheckIfTextFieldIsEmpty(HtmlInputText id) { int i = 0; var valid = int.TryParse(id.Value, out i) == true; if (id.Value != "" && valid == true) { return(true); } else { lblCustomerSaved.Text = "review input in customer-id text field, can't find customer."; return(false); } }
/// <summary> /// Changes the placeholder. /// </summary> /// <param name="text">The text.</param> public void ChangePlaceholder(string text) { HtmlInputText placeholder = EM.Forms.FormsBackend.PlaceHolder .AssertIsPresent("placeholder"); placeholder.ScrollToVisible(); placeholder.Focus(); placeholder.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
/// <summary> /// Changes the predefined value. /// </summary> /// <param name="text">The text.</param> public void ChangePredefinedValue(string text) { HtmlInputText predefinedValue = EM.Forms.FormsBackend.PredefinedValue .AssertIsPresent("predefined value"); predefinedValue.ScrollToVisible(); predefinedValue.Focus(); predefinedValue.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(e.CommandArgument); string name = e.CommandName.ToString(); if (name == "Update") { spd.jumpAdminUrl1(this.Page, 1);//跳转三级密码 HtmlInputText valuemoney = (HtmlInputText)e.Item.FindControl("paramValue"); string msg = ""; UpdateParam(id, valuemoney, out msg); MessageBox.Show(this, msg); } }
public void NullProperties() { HtmlInputText it = new HtmlInputText(); it.MaxLength = -1; Assert.AreEqual(-1, it.MaxLength, "MaxLength"); it.Name = null; Assert.IsNull(it.Name, "Name"); it.Size = -1; Assert.AreEqual(-1, it.Size, "Size"); it.Value = null; Assert.AreEqual(String.Empty, it.Value, "Value"); Assert.AreEqual(defaultAttributesCount, it.Attributes.Count, "Attributes.Count"); }
private static void CreateItemCodeField(TableRow row) { using (TableCell cell = new TableCell()) { using (HtmlInputText itemCodeInputText = new HtmlInputText()) { itemCodeInputText.ID = "ItemCodeInputText"; itemCodeInputText.Attributes.Add("title", "ALT + C"); cell.Controls.Add(itemCodeInputText); } row.Cells.Add(cell); } }
private SPFieldLookupValue GetCustomSelectValue(HtmlInputText txtBox) { Control h = FindControl(string.Format(CultureInfo.InvariantCulture, "{0}_Hidden", Field.InternalName)); if (h != null && !string.IsNullOrEmpty(((HtmlInputHidden)h).Value)) { ListItem s = _availableItems.Find(x => (x.Value.ToLower() == ((HtmlInputHidden)h).Value.ToLower())); if (s != null && (s.Value != "0") && (s.Text.ToLower() == txtBox.Value.ToLower())) { return(new SPFieldLookupValue(int.Parse(s.Value), s.Text)); } } return(new SPFieldLookupValue()); }
/// <summary> /// Change css class in advanced settings /// </summary> /// <param name="text">Text</param> public void ChangeCssClassInAdvancedSettings(string text) { HtmlInputText cssClassInput = EM.Forms.FormsBackend.CssClassInAdvancedSettings .AssertIsPresent("Css class"); cssClassInput.ScrollToVisible(); cssClassInput.Focus(); cssClassInput.MouseClick(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); Manager.Current.Desktop.KeyBoard.TypeText(text); }
private void AddQuantityInputText(HtmlTableRow row) { using (HtmlTableCell cell = this.GetCell()) { using (HtmlInputText quantityInputText = new HtmlInputText()) { quantityInputText.ID = "QuantityInputText"; quantityInputText.Attributes.Add("class", "form-control input-sm number"); cell.Controls.Add(quantityInputText); } row.Controls.Add(cell); } }
private void AddItemCodeInputText(HtmlTableRow row) { using (HtmlTableCell cell = this.GetCell()) { using (HtmlInputText itemCodeInputText = new HtmlInputText()) { itemCodeInputText.ID = "ItemCodeInputText"; itemCodeInputText.Attributes.Add("class", "form-control input-sm"); cell.Controls.Add(itemCodeInputText); } row.Controls.Add(cell); } }
/// <summary> /// Remove css class in the widget designer /// </summary> public void RemoveCSSClass() { HtmlInputText input = EM.Navigation.NavigationWidgetEditScreen.CSSClass .AssertIsPresent("Css class"); input.ScrollToVisible(); input.Focus(); Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A); Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control); Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete); ActiveBrowser.WaitForAsyncOperations(); }
/// <summary> /// Search item by title /// </summary> /// <param name="title">The title of the tag</param> public void SearchItemByTitle(string title) { var activeDialog = this.EM.Selectors.SelectorsScreen.ActiveTab.AssertIsPresent("Content container"); HtmlDiv inputDiv = activeDialog.Find.ByExpression <HtmlDiv>("class=input-group m-bottom-sm"); HtmlInputText input = inputDiv.Find .ByExpression <HtmlInputText>("placeholder=Narrow by typing") .AssertIsPresent("Search field"); Manager.Current.Desktop.Mouse.Click(MouseClickType.LeftClick, input.GetRectangle()); input.Text = string.Empty; Manager.Current.Desktop.KeyBoard.TypeText(title); Manager.Current.ActiveBrowser.WaitForAsyncOperations(); Manager.Current.ActiveBrowser.RefreshDomTree(); }
private bool CheckIfTextFieldIsNotEmpty(HtmlInputText id) { int i = 0; var valid = int.TryParse(id.Value, out i) == true; if (id.Value != "" && valid == true) { return(true); } else { lblMessageDelete.Text = "review input in carid-text field, can't find car."; return(false); } }
/// <summary> /// Sets a text to search in t he search input. /// </summary> /// <param name="text">The text to be searched for.</param> public void SetSearchText(string text) { HtmlInputText input = this.EM.Widgets.FeatherWidget.SearchInput .AssertIsPresent("input"); input.ScrollToVisible(); input.Focus(); input.MouseClick(); Manager.Current.Desktop.KeyBoard.TypeText(text); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForAsyncRequests(); ActiveBrowser.RefreshDomTree(); }
private void SetNavigationButtons() { lnkFirst = new LinkButton(); lnkFirst.Text = "  <<  "; lnkFirst.ID = "lnkFirst"; lnkFirst.Click += new EventHandler(lnkFirst_Click); lnkFirst.CssClass = CSSStrings.GridPagerLinkCssClass; lnkFirst.ToolTip = "First Page"; lnkLast = new LinkButton(); lnkLast.Text = "  >>  "; lnkLast.ID = "lnkLast"; lnkLast.ToolTip = "Last Page"; lnkLast.Click += new EventHandler(lnkLast_Click); lnkLast.CssClass = CSSStrings.GridPagerLinkCssClass; lnkPrev = new LinkButton(); lnkPrev.Text = "<  "; lnkPrev.ID = "lnkPrev"; lnkPrev.ToolTip = "Previous Page"; lnkPrev.Click += new EventHandler(lnkPrev_Click); lnkPrev.CssClass = CSSStrings.GridPagerLinkCssClass; lnkNext = new LinkButton(); lnkNext.Text = "  >"; lnkNext.ID = "lnkNext"; lnkNext.ToolTip = "Next Page"; lnkNext.Click += new EventHandler(lnkNext_Click); lnkNext.CssClass = CSSStrings.GridPagerLinkCssClass; txtCurrentPage = new HtmlInputText(); txtCurrentPage.ID = "txtPage"; txtCurrentPage.Size = 1; txtCurrentPage.Value = "" + (owner.CurrentPage + 1); txtCurrentPage.Style.Add(HtmlTextWriterStyle.Height, "12px"); txtCurrentPage.Style.Add(HtmlTextWriterStyle.Width, "20px"); txtCurrentPage.Style.Add(HtmlTextWriterStyle.FontSize, "11px"); txtCurrentPage.Style.Add(HtmlTextWriterStyle.FontFamily, "Tahoma"); lblPageText = new Label(); lblPageText.Text = "Page "; lblPageText.CssClass = CSSStrings.GridPagerLabelCssClass; lblPageTextAfter = new Label(); lblPageTextAfter.Text = " of " + PageCount.ToString(); lblPageTextAfter.CssClass = CSSStrings.GridPagerLabelCssClass; SetLinksState(); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(); } this.txtEmail = (TextBox)this.FindControl("txtEmail"); this.txtUserName = (TextBox)this.FindControl("txtUserName"); this.txtContent = (TextBox)this.FindControl("txtContent"); this.btnRefer = ButtonManager.Create(this.FindControl("btnRefer")); this.spReviewUserName = (HtmlControl)this.FindControl("spReviewUserName"); this.spReviewPsw = (HtmlControl)this.FindControl("spReviewPsw"); this.spReviewReg = (HtmlControl)this.FindControl("spReviewReg"); this.txtReviewUserName = (HtmlInputText)this.FindControl("txtReviewUserName"); this.txtReviewPsw = (HtmlInputText)this.FindControl("txtReviewPsw"); this.txtReviewCode = (HtmlInputText)this.FindControl("txtReviewCode"); this.productdetailLink = (ProductDetailsLink)this.FindControl("ProductDetailsLink1"); this.btnRefer.Click += new EventHandler(this.btnRefer_Click); if (!this.Page.IsPostBack) { PageTitle.AddSiteNameTitle("商品评论", HiContext.Current.Context); if ((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling)) { this.txtUserName.Text = HiContext.Current.User.Username; this.txtEmail.Text = HiContext.Current.User.Email; this.txtReviewUserName.Value = string.Empty; this.txtReviewPsw.Value = string.Empty; this.spReviewUserName.Visible = false; this.spReviewPsw.Visible = false; this.spReviewReg.Visible = false; this.btnRefer.Text = "评论"; } else { this.spReviewUserName.Visible = true; this.spReviewPsw.Visible = true; this.spReviewReg.Visible = true; this.btnRefer.Text = "登录并评论"; } this.txtReviewCode.Value = string.Empty; ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId); if (productSimpleInfo != null) { this.productdetailLink.ProductId = this.productId; this.productdetailLink.ProductName = productSimpleInfo.ProductName; } } }
private Control GetHeader() { using (HtmlGenericControl form = ControlHelper.GetGenericControl(@"div", @"grey form-inline", @"form")) { using (HtmlGenericControl formGroup = ControlHelper.GetGenericControl(@"div", @"form-group form-group-sm")) { using (Literal partyDropDownListLabelLiteral = new Literal()) { partyDropDownListLabelLiteral.Text = ControlHelper.GetLabelText(@"PartyDropDownList", "Select Customer"); using (HtmlGenericControl partyCodeTextBoxFormGroup = ControlHelper.GetGenericControl(@"div", @"form-group form-group-sm")) { using (HtmlInputText partyCodeTextBox = ControlHelper.GetInputText(@"PartyCodeTextBox", @"form-control input-sm")) { partyCodeTextBox.Style.Add(@"width", @"100px"); partyCodeTextBoxFormGroup.Controls.Add(partyCodeTextBox); } formGroup.Controls.Add(partyCodeTextBoxFormGroup); } using (HtmlGenericControl partyDropDownListFormGroup = ControlHelper.GetGenericControl(@"div", @"input-group input-group-sm")) { using (HtmlSelect partyDropDownList = ControlHelper.GetSelect(@"PartyDropDownList", @"form-control")) { partyDropDownListFormGroup.Controls.Add(partyDropDownList); } using (HtmlGenericControl goButtonSpan = ControlHelper.GetGenericControl(@"span", @"input-group-btn")) { using (HtmlButton goButton = ControlHelper.GetButton(@"GoButton", @"btn btn-primary", "Go")) { goButtonSpan.Controls.Add(goButton); } partyDropDownListFormGroup.Controls.Add(goButtonSpan); } formGroup.Controls.Add(partyDropDownListFormGroup); } } form.Controls.Add(formGroup); return(form); } } }
public static void TypeText(this HtmlControl control, string text) { if(control.TagName == "input") { HtmlInputText ctrl = new HtmlInputText(control.BaseElement); ctrl.Text = string.Empty; ctrl.Focus(); ctrl.ExtendedMouseClick(); ctrl.Text = text; ctrl.OwnerBrowser.Manager.Desktop.KeyBoard.KeyPress(Keys.Tab); } else { control.Focus(); control.ExtendedMouseClick(); control.OwnerBrowser.Manager.Desktop.KeyBoard.TypeText(text); control.OwnerBrowser.Manager.Desktop.KeyBoard.KeyPress(Keys.Tab); } }
/// <summary> /// Reads the query string to populate a /// search criteria control for a range search /// </summary> /// <param name="fieldName">The name of the parameter in the query string that has the search criteria</param> /// <param name="searchControlBegin">The control to populate with the beginning search criteria</param> /// <param name="searchControlEnd">The control to populate with the ending search criteria</param> /// <returns></returns> protected int LoadSearchBetween(string fieldName, HtmlInputText searchControlBegin, HtmlInputText searchControlEnd) { int CriteriaCount = LoadSearchString(fieldName + "Begin", searchControlBegin); CriteriaCount += LoadSearchString(fieldName + "End", searchControlEnd); return CriteriaCount; }
protected void Page_Load( object sender, EventArgs e ) { AdminPopedom.IsHoldModel( "04" ); if( IsPostBack ) return; txtBeginDate.Text = RookiePresentConfig.Config.BeginDate.ToString( "yyyy-MM-dd" ); txtEndDate.Text = RookiePresentConfig.Config.EndDate.ToString( "yyyy-MM-dd" ); txtMoney.Text = RookiePresentConfig.Config.Money.ToString(); cbxIsEnable.Checked = RookiePresentConfig.Config.IsEnable; //开始构造动态表单 //1、读取道具定义表 DataTable dt = DbSession.Default.FromSql( "select * from TPropDefine" ).ToDataTable(); //2、循环数据,创建控件并赋值 HtmlTable table = new HtmlTable(); table.Border = 1; table.Style.Value = "border-collapse:collapse;"; table.CellPadding = 3; table.CellSpacing = 0; table.Width = "350"; foreach( DataRow row in dt.Rows ) { #region 构造动态表单 HtmlTableRow tr = new HtmlTableRow(); HtmlTableCell tdPropName = new HtmlTableCell(); tdPropName.Align = "right"; tdPropName.InnerText = row["PropName"].ToString() + ":"; tr.Controls.Add( tdPropName ); HtmlTableCell tdInput = new HtmlTableCell(); tdInput.Align = "left"; tdInput.NoWrap = false; HtmlInputText txt = new HtmlInputText(); txt.ID = "txt_" + row["PropID"].ToString(); if( RookiePresentConfig.Config.PropPresent.Rows.Count > 0 ) { DataRow[] p = RookiePresentConfig.Config.PropPresent.Select( "PropID=" + row["PropID"].ToString() ); if( p.Length > 0 ) txt.Value = p[0]["Amount"].ToString(); else txt.Value = "0"; } else txt.Value = "0"; txt.Attributes.Add( "class", "put imeclose" ); txt.Attributes.Add( "onkeypress", "return KeyPressNum(this,event);" ); Literal lt = new Literal(); lt.Text = "个"; tdInput.Controls.Add( txt ); tdInput.Controls.Add( lt ); tr.Controls.Add( tdInput ); table.Controls.Add( tr ); #endregion } phPropPresent.Controls.Add( table ); }
private void ClickAndVerify(HtmlTable calculator, HtmlInputText display, string click, string expect = null) { var button = GetButtonByValue(calculator, click); button.Click(); if (expect == null) { return; } Assert.AreEqual(expect, display.Value); }
private string CreateSelectList(string FieldListXml, HtmlInputText AssociatedControl, string CurrentValue, string DataTypes, string BaseTypes) { string strSelectList = ""; string strOptionList; string strFormsPath; string strXsltFilePath; try { strFormsPath = (string) (Server.MapPath(m_refContentApi.AppPath) + "controls\\forms\\"); strXsltFilePath = Utilities.QualifyURL(strFormsPath, "SelectFormField.xslt"); System.Xml.Xsl.XsltArgumentList objXsltArgs = null; if (CurrentValue.Length > 0) { if (objXsltArgs == null) { objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); } objXsltArgs.AddParam("value", string.Empty, CurrentValue); } if (DataTypes.Length > 0) { if (objXsltArgs == null) { objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); } objXsltArgs.AddParam("datatypes", string.Empty, DataTypes); } if (BaseTypes.Length > 0) { if (objXsltArgs == null) { objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); } objXsltArgs.AddParam("basetypes", string.Empty, BaseTypes); } strOptionList = m_refModule.XSLTransform(FieldListXml, strXsltFilePath, true, false, objXsltArgs); if (strOptionList.Length > 0) { // useFieldValue depends on "_sel" strSelectList = strSelectList + "<select name=\"" + AssociatedControl.Name + "_sel\" id=\"" + AssociatedControl.ClientID + "_sel\" onchange=\"useFieldValue(this)\">" + "\r\n"; strSelectList = strSelectList + "<option value=\"\">" + "(No field selected)" + "</option>" + "\r\n"; strSelectList = strSelectList + strOptionList + "\r\n"; strSelectList = strSelectList + "</select>" + "\r\n"; } } catch (Exception ex) { EkException.ThrowException(ex); } return strSelectList; }
private void ShowShoppingCart() { if (Session["dtShoppingCart"] != null) { divShoppingCart.Controls.Clear(); int intSoLoai = 0; int intSoSanPham = 0; DataTable dtShoppingCart = (DataTable) Session["dtShoppingCart"]; dtShoppingCart.DefaultView.Sort = "NguoiDungID"; DataView dv = dtShoppingCart.DefaultView; HtmlGenericControl div; HtmlGenericControl divtbl; HtmlTable tbl; HtmlTableRow tr; HtmlTableCell td; string strNguoiDungID = ""; string strNguoiDungIDNext = ""; int i = 0; if (dv.Count > 0) { btnTinhLai.Enabled = true; btnXoa.Enabled = true; btnGuiDonHang.Enabled = true; do { div = new HtmlGenericControl(); strNguoiDungID = dv[i]["NguoiDungID"].ToString(); strNguoiDungIDNext = dv[i]["NguoiDungID"].ToString(); div.InnerHtml = GetThongTinCuaHang(int.Parse(strNguoiDungID)); tbl = new HtmlTable(); divtbl = new HtmlGenericControl(); divtbl.Style.Add("align", "right"); setTableAttributes(tbl, true); int j = 0; HtmlGenericControl divThanhTien = new HtmlGenericControl(); divThanhTien.ID = strNguoiDungID; decimal dcmSoTien = 0; while (strNguoiDungIDNext == strNguoiDungID) { DataRowView dr = dv[i]; j++; tr = new HtmlTableRow(); HtmlGenericControl divTongTien = new HtmlGenericControl(); divTongTien.ID = dr["SanPhamID"].ToString(); divTongTien.InnerText = string.Format("{0:0,0}", decimal.Parse(dr["TongTien"].ToString())).Replace(",", "."); foreach (DataColumn dc in dtShoppingCart.Columns) { if (dc.ColumnName != "NguoiDungID") { td = new HtmlTableCell(); switch (dc.ColumnName) { case "SanPhamID": td.Align = "center"; td.Width = "10%"; td.InnerText = j.ToString(); break; case "TenSanPham": td.Width = "25%"; td.InnerText = dr[dc.ColumnName].ToString(); td.Align = "center"; break; case "GiaSanPham": td.Width = "15%"; td.InnerText = string.Format("{0:0,0}", decimal.Parse(dr[dc.ColumnName].ToString())). Replace(",", "."); td.Align = "right"; break; case "SoSanPham": td.Align = "center"; td.Width = "15%"; HtmlInputText txt = new HtmlInputText(); txt.Value = dr[dc.ColumnName].ToString(); txt.MaxLength = 2; //txt.Width = Unit.Pixel(80); txt.Attributes.Add("onchange", "changenumber(this,'" + dr["SanPhamID"] + "');"); td.Controls.Add(txt); break; case "Xoa": td.Width = "10%"; td.Align = "center"; CheckBox chk = new CheckBox(); chk.Checked = bool.Parse(dr[dc.ColumnName].ToString()); chk.Attributes.Add("onclick", "setdelete(this, '" + dr["SanPhamID"] + "');"); td.Controls.Add(chk); break; case "TongTien": td.Width = "15%"; //td.InnerText = string.Format("{0:0,0}", dr[dc.ColumnName]).Replace(",", "."); //td.ID = dr["SanPhamID"].ToString(); td.Controls.Add(divTongTien); td.Align = "right"; dcmSoTien += decimal.Parse(dr[dc.ColumnName].ToString()); break; default: td.Align = "center"; //td.Width = "22%"; td.InnerText = dr[dc.ColumnName].ToString(); break; } tr.Cells.Add(td); } } tbl.Rows.Add(tr); intSoLoai += 1; intSoSanPham += int.Parse(dr["SoSanPham"].ToString()); //dblSoTien += double.Parse(dr["TongSoTien"].ToString()); //tblShoppingCart.Rows.Insert(1, tr); if (i < dv.Count - 1) { strNguoiDungIDNext = dv[i + 1]["NguoiDungID"].ToString(); strNguoiDungID = dv[i]["NguoiDungID"].ToString(); } else { strNguoiDungIDNext = "no"; } i++; } tr = new HtmlTableRow(); //HtmlTableCell td1 = new HtmlTableCell(); HtmlTableCell td2 = new HtmlTableCell(); td2.Align = "center"; td2.ColSpan = 6; //td1.InnerHtml = " "; divThanhTien.InnerText = "Tổng số tiền là: " + string.Format("{0:0,0}", dcmSoTien).Replace(",", ".") + " VNĐ "; td2.Controls.Add(divThanhTien); //td2.Controls.Add(div); //td2.InnerText = string.Format("{0:0,0}", dcmSoTien).Replace(",", "."); // td2.ID = strNguoiDungID; //tr.Cells.Add(td1); tr.Cells.Add(td2); tbl.Rows.Add(tr); divShoppingCart.Controls.Add(div); divShoppingCart.Controls.Add(divtbl); divShoppingCart.Controls.Add(tbl); HtmlGenericControl hr = new HtmlGenericControl(); hr.TagName = "hr"; hr.Attributes.Add("height", "1px"); hr.Attributes.Add("color", "#ff6600"); divShoppingCart.Controls.Add(hr); } while (i < dv.Count); } else { divShoppingCart.InnerText = "Không có sản phẩm nào trong giỏ hàng của bạn"; btnTinhLai.Enabled = false; btnXoa.Enabled = false; btnGuiDonHang.Enabled = false; } //lblSoLoaiSanPham.Text = "Có " + intSoLoai.ToString() + " mặt hàng được chọn"; //lblSoSanPham.Text = intSoSanPham.ToString(); //lblSoTien.Text = string.Format("{0:00.0000}", dblSoTien); } }
/// <summary> /// Adds search criteria to a Query if the search control is not empty /// </summary> /// <param name="queryDefinition">The query to add the criteria to</param> /// <param name="column">The column to search on</param> /// <param name="comparisionMethod">The type of search to perform</param> /// <param name="searchControl">The search control that has the criteria</param> protected void AddToQuery(Query queryDefinition, Enum column, Comparison comparisionMethod, HtmlInputText searchControl) { if (searchControl.Value.Length > 0) { queryDefinition.And(Criteria.Create(column, Condition.Is, comparisionMethod, searchControl.Value)); } }
//void Category_SelectedIndexChanged(object sender, EventArgs e) //{ // Exercise.Items.Clear(); // Exercise.DataSource = GetExerciseByCategory(); // Exercise.DataBind(); //} //void Add_Click(object sender, EventArgs e) //{ // int documentId = int.Parse(HttpContext.Current.Request.QueryString["id"]); // Document document = new Document(documentId); // Document parentDocument = new Document(document.ParentId); // int id = 0; // string cn = ConfigurationManager.AppSettings["umbracoDbDSN"]; // string cmd = "InsertRoutine"; // SqlHelper.ExecuteNonQuery(cn, CommandType.StoredProcedure, cmd, // new SqlParameter { ParameterName = "@Id", Value = id, Direction = ParameterDirection.Output, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@DocumentId", Value = parentDocument.Id, Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@ExerciseId", Value = Exercise.SelectedValue, Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@MemberId", Value = Convert.ToInt32(parentDocument.getProperty("member").Value), Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@TrainerId", Value = Convert.ToInt32(parentDocument.getProperty("trainer").Value), Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@WorkoutId", Value = document.Id, Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Int }, // new SqlParameter { ParameterName = "@Value", Value = Value.Text, Direction = ParameterDirection.Input, SqlDbType = SqlDbType.Decimal } // ); // GetRoutineByWorkout(); //} protected override void OnInit(EventArgs e) { base.OnInit(e); //this.Controls.Add(Category); //this.Controls.Add(Exercise); //this.Controls.Add(Value); //this.Controls.Add(State); //this.Controls.Add(Add); //this.Controls.Add(Result); grid = new Table { ID = "grid1", ClientIDMode = ClientIDMode.Static }; pager = new Panel { ID = "pager1", ClientIDMode = ClientIDMode.Static }; Panel pnlTemplate = new Panel(); inputText = new HtmlInputText{ID = "templateName", ClientIDMode = ClientIDMode.Static}; button = new HtmlButton { ID = "addWorkout", InnerText = "Add Workout to your repository ", ClientIDMode = ClientIDMode.Static }; pnlTemplate.Controls.Add(new Label{Text = "Template Name"}); pnlTemplate.Controls.Add(inputText); pnlTemplate.Controls.Add(button); //Panel pnlApplyTemplate = new Panel(); //select = new HtmlSelect{ID = "ddlTemplate", DataSource = SelectTemplate()}; //select.DataBind(); //buttonApply = new HtmlButton { ID = "applyTemplate", InnerText = "Apply Template", ClientIDMode = ClientIDMode.Static }; //pnlApplyTemplate.Controls.Add(new Label { Text = "Templates" }); //pnlApplyTemplate.Controls.Add(select); //pnlApplyTemplate.Controls.Add(buttonApply); IEnumerable<PreValue> categories = UmbracoCustom.DataTypeValue(int.Parse(UmbracoCustom.GetParameterValue(UmbracoType.Category))); categorySelected = new HiddenField { ID = "categorySelected", Value = categories.First().Id.ToString(), ClientIDMode = ClientIDMode.Static }; Panel pnlForm = new Panel { ID = "pnlForm1", CssClass = "form-horizontal", ClientIDMode = ClientIDMode.Static }; //pnlForm.Controls.Add(pnlCategory); //pnlForm.Controls.Add(pnlExercise); //pnlForm.Controls.Add(pnlValue); //pnlForm.Controls.Add(pnlState); //pnlForm.Controls.Add(pnlAdd); //pnlForm.Controls.Add(pnlResult); //pnlForm.Controls.Add(Message); pnlForm.Controls.Add(pnlTemplate); //pnlForm.Controls.Add(pnlApplyTemplate); pnlForm.Controls.Add(grid); pnlForm.Controls.Add(pager); pnlForm.Controls.Add(categorySelected); Controls.Add(pnlForm); }
/// <summary> /// 附件URL相关 /// </summary> /// <param name="infos"></param> private void InitOption(string fileUrls) { Table t = new Table(); t.ID = "tableFileOption"; t.Attributes.Add("class", "FileTable"); TableRow row = new TableRow(); TableCell cell = new TableCell(); //row.Attributes.Add("class", "t"); string[] files = fileUrls.Split('|'); if (fileUrls == "" || fileUrls.Equals("")) { row = new TableRow(); cell = new TableCell(); //Option Body HtmlInputText txt1 = new HtmlInputText(); txt1.Size = 20; txt1.ID = "filename" + 1; txt1.Value = "附件1"; cell.Controls.Add(txt1); HtmlInputText txt2 = new HtmlInputText(); txt2.Size = 45; txt2.ID = "option" + 1; txt2.Value = ""; cell.Controls.Add(txt2); //Option Id HtmlInputHidden hidden1 = new HtmlInputHidden(); hidden1.ID = "filename_id_" + 1; hidden1.Value = "附件1"; cell.Controls.Add(hidden1); HtmlInputHidden hidden2 = new HtmlInputHidden(); hidden2.ID = "option_id_" + 1; hidden2.Value = ""; cell.Controls.Add(hidden2); row.Cells.Add(cell); cell = new TableCell(); cell.ID = "tdDel_" + 1; //if (i == files.Length && i != 1) //cell.Attributes.Add("style", "display:;"); //else cell.Attributes.Add("style", "display:none;"); cell.Text = "<a href=\"#\" onclick=\"DeletePollOption(" + 1 + ");DeleteServerOption();\"><img src=\"../images/delete1.gif\" alt=\"删除\" border=\"0\"/></a>"; row.Cells.Add(cell); t.Rows.Add(row); } else { string fileName = ""; string filePath = ""; int index = 0; for (int i = 0; i < files.Length; i++) { index = i + 1; row = new TableRow(); cell = new TableCell(); //Option Body if (files[i] != "") { string[] strs2 = files[i].Split('$'); if (strs2.Length == 1) { fileName = "附件" + index; filePath = strs2[0]; } else { fileName = strs2[0]; filePath = strs2[1]; } HtmlInputText txt1 = new HtmlInputText(); txt1.Size = 20; txt1.ID = "filename" + index; txt1.Value = fileName; cell.Controls.Add(txt1); HtmlInputText txt2 = new HtmlInputText(); txt2.Size = 45; txt2.ID = "option" + index; txt2.Value = filePath; cell.Controls.Add(txt2); //Option Id HtmlInputHidden hidden1 = new HtmlInputHidden(); hidden1.ID = "filename_id_" + index; hidden1.Value = fileName; cell.Controls.Add(hidden1); HtmlInputHidden hidden2 = new HtmlInputHidden(); hidden2.ID = "option_id_" + index; hidden2.Value = filePath; cell.Controls.Add(hidden2); row.Cells.Add(cell); } else { HtmlInputText txt1 = new HtmlInputText(); txt1.Size = 20; txt1.ID = "filename" + index; txt1.Value = "附件" + index.ToString(); cell.Controls.Add(txt1); HtmlInputText txt2 = new HtmlInputText(); txt2.Size = 45; txt2.ID = "option" + index; txt2.Value = ""; cell.Controls.Add(txt2); //Option Id HtmlInputHidden hidden1 = new HtmlInputHidden(); hidden1.ID = "filename_id_" + index; hidden1.Value = "附件" + index.ToString(); cell.Controls.Add(hidden1); HtmlInputHidden hidden2 = new HtmlInputHidden(); hidden2.ID = "option_id_" + index; hidden2.Value = ""; cell.Controls.Add(hidden2); row.Cells.Add(cell); } cell = new TableCell(); cell.ID = "tdDel_" + index; if (index == files.Length && index != 1) cell.Attributes.Add("style", "display:;"); else cell.Attributes.Add("style", "display:none;"); cell.Text = "<a href=\"#\" onclick=\"DeletePollOption(" + index + ");DeleteServerOption('" + files[i].ToString() + "');\"><img src=\"../images/delete1.gif\" alt=\"删除\" border=\"0\"/></a>"; row.Cells.Add(cell); t.Rows.Add(row); } } this.OptionTotal.Value = files.Length.ToString(); phMain.Controls.Add(t); }
/// <summary> /// Adds Between search criteria to a Query if the search controls are not empty /// </summary> /// <param name="queryDefinition">The query to add the criteria to</param> /// <param name="column">The column to search on</param> /// <param name="searchControlBegin">The search control with the lowest value</param> /// <param name="searchControlEnd">The search control with the highest value</param> protected void AddToQuery(Query queryDefinition, Enum column, HtmlInputText searchControlBegin, HtmlInputText searchControlEnd) { if (searchControlBegin.Value.Length > 0 && searchControlEnd.Value.Length > 0) { // // Two values specified, use Between // queryDefinition.And(Criteria.Create(column, Condition.Is, Comparison.Between, searchControlBegin.Value, searchControlEnd.Value)); } else if (searchControlBegin.Value.Length > 0) { // // Low value specified, use GreaterThanOrEqualTo // queryDefinition.And(Criteria.Create(column, Condition.Is, Comparison.GreaterThanOrEqualTo, searchControlBegin.Value)); } else if (searchControlEnd.Value.Length > 0) { // // High value specified, use GreaterThanOrEqualTo // queryDefinition.And(Criteria.Create(column, Condition.Is, Comparison.LessThanOrEqualTo, searchControlEnd.Value)); } }
private void InitItemList(List<XYECOM.Configuration.ModuleItemInfo> infos) { Table t = new Table(); t.ID = "tableInfoType"; t.Attributes.Add("class", "s_f_p"); TableRow row = new TableRow(); TableCell cell = new TableCell(); row.Attributes.Add("class","t"); cell.Text = ""; row.Cells.Add(cell); cell = new TableCell(); cell.Text = "前缀"; row.Cells.Add(cell); cell = new TableCell(); cell.Text = "后缀"; row.Cells.Add(cell); cell = new TableCell(); cell.Text = "信息类型"; row.Cells.Add(cell); cell = new TableCell(); cell.Text = " "; row.Cells.Add(cell); t.Rows.Add(row); int i= 1; foreach(XYECOM.Configuration.ModuleItemInfo item in infos) { row = new TableRow(); cell = new TableCell(); HtmlInputText txt = new HtmlInputText(); txt.ID = "tbid" + item.ID; txt.Value = item.ID.ToString(); txt.Attributes.Add("readonly","readonly"); txt.Attributes.Add("class", "m_i"); cell.Controls.Add(txt); row.Cells.Add(cell); cell = new TableCell(); txt = new HtmlInputText(); txt.ID = "tbprefix" + item.ID; txt.Value = item.Prefix; cell.Controls.Add(txt); row.Cells.Add(cell); cell = new TableCell(); txt = new HtmlInputText(); txt.ID = "tbpostfix" + item.ID; txt.Value = item.Postfix; cell.Controls.Add(txt); row.Cells.Add(cell); cell = new TableCell(); string isBuyStr = "checked=\"checked\""; string isSellStr = "checked=\"checked\""; string infoTypeStr = ""; if (item.InfoType == XYECOM.Configuration.InfoType.Sell) { isBuyStr = ""; infoTypeStr = "sell"; } else { isSellStr = ""; infoTypeStr = "buy"; } string body = "<input type=\"radio\" name=\"rb" + item.ID + "\" value=\"sell\" " + isSellStr + " onclick=\"SetInfoTypeValue(" + item.ID + ");\"/>供 " + "<input type=\"radio\" name=\"rb" + item.ID + "\" value=\"buy\" " + isBuyStr + " onclick=\"SetInfoTypeValue(" + item.ID + ");\"/>求" + "<input type=\"hidden\" id=\"hidInfoType_" + item.ID + "\" name=\"hidInfoType_" + item.ID + "\" value=\"" + infoTypeStr + "\" />"; cell.Text = body; row.Cells.Add(cell); cell = new TableCell(); cell.ID = "tdDel_" + item.ID; if(i== infos.Count && i != 1) cell.Attributes.Add("style", "display:;"); else cell.Attributes.Add("style", "display:none;"); cell.Text = "<a href=\"#\" onclick=\"DeleteInfoType("+item.ID+");\"><img src=\"../images/delete1.gif\" alt=\"删除\" border=\"0\"/></a>"; row.Cells.Add(cell); t.Rows.Add(row); i++; } this.infoTypeTotal.Value = infos.Count.ToString(); phMain.Controls.Add(t); }
private void InitPriceData(XYECOM.Model.SearchKeyInfo keyInfo) { List<XYECOM.Configuration.RankingPriceInfo> infos = XYECOM.Configuration.Ranking.Instance.PriceInfo; string[] customPrices = keyInfo.SK_CustomPrice.Split('|'); Table t = new Table(); phMain.Controls.Clear(); t.ID = "tablePrice"; TableRow row = new TableRow(); TableCell cell = new TableCell(); int i = 0; foreach (XYECOM.Configuration.RankingPriceInfo info in infos) { cell = new TableCell(); cell.Text = info.Rank + "."; row.Cells.Add(cell); cell = new TableCell(); HtmlInputText txt = new HtmlInputText(); txt.Size = 5; txt.MaxLength = 5; txt.ID = "rank_" + info.Rank; if (i < customPrices.Length) txt.Value = customPrices[i]; else txt.Value = info.Price.ToString(); cell.Controls.Add(txt); row.Cells.Add(cell); i++; } t.Rows.Add(row); phMain.Controls.Add(t); }
private void InitPriceData() { List<XYECOM.Configuration.RankingPriceInfo> infos = XYECOM.Configuration.Ranking.Instance.PriceInfo; Table t = new Table(); phMain.Controls.Clear(); t.ID = "tablePrice"; TableRow row = new TableRow(); TableCell cell = new TableCell(); foreach (XYECOM.Configuration.RankingPriceInfo info in infos) { cell = new TableCell(); cell.Text = info.Rank + "."; row.Cells.Add(cell); cell = new TableCell(); HtmlInputText txt = new HtmlInputText(); txt.Size = 5; txt.MaxLength = 5; txt.ID = "rank_" + info.Rank; txt.Value = info.Price.ToString(); cell.Controls.Add(txt); row.Cells.Add(cell); } t.Rows.Add(row); phMain.Controls.Add(t); }
/// <summary> /// Reads the query string to populate a /// search criteria control /// </summary> /// <param name="fieldName">The name of the parameter in the query string that has the search criteria</param> /// <param name="searchControl">The control to populate with the search criteria</param> /// <returns>zero if no criteria was found, or one if criteria is specified</returns> protected int LoadSearchString(string fieldName, HtmlInputText searchControl) { if (HasQueryStringParameter(fieldName)) { string SearchValue = Request.QueryString[fieldName]; if ((SearchValue != null && SearchValue.Length > 0) || AllowSearchAll) { searchControl.Value = SearchValue; return 1; } } return 0; }
public HtmlInputText VratiEditText(string vrednost,bool daliEdit) { HtmlInputText textBox = new HtmlInputText("text"); textBox.Value = vrednost; if (!daliEdit) { textBox.Attributes.Add("readonly", " "); } return textBox; }
protected void Page_Load( object sender, EventArgs e ) { AdminPopedom.IsHoldModel( "15" ); if( string.IsNullOrEmpty( ParamsUrlDecode ) ) { CommonManager.Web.RegJs( this, "history.back();", false ); return; } ltUserName.Text = ParamsUrlDecode; if( IsPostBack ) return; //1、读取玩家道具表 string sql = @"select up.*,tu.UserName,pd.PropName from tuserprop as up inner join TPropDefine as pd on up.PropID=pd.PropID inner join TUsers as tu on up.UserID=tu.UserID where tu.UserName=@UserName order by UserID desc,PropID asc "; DataTable dt = DbSession.Default.FromSql( sql ).AddInputParameter( "@UserName", DbType.String, ParamsUrlDecode ).ToDataTable(); if( dt.Rows.Count <= 0 ) { Literal lt = new Literal(); lt.Text = "该用户还没有购买过道具。"; phPropList.Controls.Add( lt ); return; } //2、构造动态表单 foreach( DataRow row in dt.Rows ) { HtmlTableRow tr = new HtmlTableRow(); HtmlTableCell th = new HtmlTableCell( "TH" ); th.Align = "right"; th.InnerText = row["PropName"].ToString() + ":"; tr.Controls.Add( th ); HtmlTableCell td = new HtmlTableCell(); td.Align = "left"; HtmlInputText txt = new HtmlInputText(); txt.Attributes.Add("maxlength", "7"); txt.Attributes.Add( "class", "put" ); txt.Attributes.Add( "style", "ime-mode:disabled;" ); txt.Attributes.Add( "onkeypress", "return KeyPressNum(this,event);" ); txt.Value = row["HoldCount"].ToString(); txt.ID = "txt_" + row["UserID"].ToString() + "_" + row["PropID"].ToString(); td.Controls.Add( txt ); tr.Controls.Add( td ); phPropList.Controls.Add( tr ); } }
public bool FieldActive(HtmlInputText control) { if (control.BaseElement.Parent.ChildNodes.Count > 1) { return true; } else { return false; } }