예제 #1
0
 public StudentsPage ClickFindStudent()
 {
     HtmlInputButton searchButton = new HtmlInputButton(BrowserManager.Instance.Browser);
     searchButton.SearchProperties.Add(HtmlInputButton.PropertyNames.DisplayText, "Search");
     Mouse.Click(searchButton);
     return new StudentsPage();
 }
 public InstructorsPage CreateInstructor()
 {
     HtmlInputButton button = new HtmlInputButton(BrowserManager.Instance.Browser);
     button.SearchProperties.Add(HtmlInputButton.PropertyNames.DisplayText, "Create");
     Mouse.Click(button);
     return new InstructorsPage();
 }
예제 #3
0
 public StudentsPage ClickDeleteStudent()
 {
     HtmlInputButton delete =  new HtmlInputButton(BrowserManager.Instance.Browser);
     delete.SearchProperties.Add(HtmlInputButton.PropertyNames.DisplayText, "Delete");
     Mouse.Click(delete);
     return new StudentsPage();
 }
예제 #4
0
        private void CreateAddButton(HtmlGenericControl container)
        {
            if (!string.IsNullOrWhiteSpace(this.AddNewUrl))
            {
                using (HtmlInputButton addButton = new HtmlInputButton())
                {
                    addButton.ID    = "AddNewButton";
                    addButton.Value = Titles.AddNew;
                    addButton.Attributes.Add("class", "ui button");
                    addButton.Attributes.Add("onclick", "window.location='" + this.ResolveUrl(this.AddNewUrl) + "'");

                    container.Controls.Add(addButton);
                }
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlInputButton LogIn     = (HtmlInputButton)Master.FindControl("btnLogIn");
            HtmlInputButton LogOut    = (HtmlInputButton)Master.FindControl("btnLogOut");
            Label           masterlbl = (Label)Master.FindControl("Label1");

            masterlbl.Visible = false;
            LogOut.Visible    = true;
            LogIn.Visible     = false;

            if (!IsPostBack)
            {
                loadCoupons();
            }
        }
예제 #6
0
        /// <summary>Renders the open popup button.</summary>
        private void RenderButton(HtmlTextWriter writer)
        {
            HtmlInputButton hib = new HtmlInputButton();

            hib.ID    = ID + "-button";
            hib.Value = ButtonText;
            hib.Attributes["class"] = "popupButton selectorButton";
            Controls.Add(hib);
            hib.Attributes["onclick"] = string.Format(OpenPopupFormat,
                                                      N2.Web.Url.ResolveTokens(BrowserUrl),
                                                      ClientID,
                                                      PopupOptions,
                                                      DefaultMode,
                                                      AvailableModes);
            hib.RenderControl(writer);
        }
예제 #7
0
        void grdVehicles_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridCommandItem)
            {
                HtmlInputButton btnAddVehicle = e.Item.FindControl("btnAddVehicle") as HtmlInputButton;
                btnAddVehicle.Attributes.Add("onclick", dlgAddUpdateVehicle.GetOpenDialogScript());
            }
            if (e.Item is GridDataItem)
            {
                HtmlAnchor  hypAddUpdateVehicle = e.Item.FindControl("hypAddUpdateVehicle") as HtmlAnchor;
                DataRowView drv = (DataRowView)e.Item.DataItem;

                hypAddUpdateVehicle.InnerText = drv["RegNo"].ToString();
                hypAddUpdateVehicle.HRef      = string.Format("javascript:{0}", dlgAddUpdateVehicle.GetOpenDialogScript("resourceid=" + drv["ResourceId"].ToString()));
            }
        }
예제 #8
0
        void grdTrailers_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridCommandItem)
            {
                HtmlInputButton btnAddNewTrailer = e.Item.FindControl("btnAddNewTrailer") as HtmlInputButton;
                btnAddNewTrailer.Attributes.Add("onclick", dlgAddUpdateTrailer.GetOpenDialogScript());
            }
            if (e.Item is GridDataItem)
            {
                DataRowView drv = (DataRowView)e.Item.DataItem;

                HtmlAnchor hypAddUpdateTrailer = (HtmlAnchor)e.Item.FindControl("hypAddUpdateTrailer");
                hypAddUpdateTrailer.InnerText = drv["TrailerRef"].ToString();
                hypAddUpdateTrailer.HRef      = string.Format("javascript:{0}", dlgAddUpdateTrailer.GetOpenDialogScript("resourceId=" + drv["ResourceId"].ToString()));
            }
        }
예제 #9
0
파일: Action.cs 프로젝트: ududsha/mixerp
        private static void CreateActionField(TableRow row)
        {
            using (TableCell cell = new TableCell())
            {
                using (HtmlInputButton addButton = new HtmlInputButton())
                {
                    addButton.ID = "AddButton";
                    addButton.Attributes.Add("class", "small ui button blue");
                    addButton.Value = Titles.Add;
                    addButton.Attributes.Add("title", "Ctrl + Return");

                    cell.Controls.Add(addButton);
                }
                row.Cells.Add(cell);
            }
        }
예제 #10
0
        private void AddButton(HtmlTableRow row)
        {
            using (HtmlTableCell cell = this.GetCell())
            {
                using (HtmlInputButton addButton = new HtmlInputButton())
                {
                    addButton.ID    = "AddButton";
                    addButton.Value = Titles.Add;
                    addButton.Attributes.Add("class", "btn btn-sm btn-primary");

                    cell.Controls.Add(addButton);
                }

                row.Controls.Add(cell);
            }
        }
예제 #11
0
 protected void gvShow_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#e1f2e9'");
         e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
         Label     lblGoodsId    = (Label)e.Row.FindControl("lblGoodsId");
         int       intGoodsId    = Convert.ToInt32(lblGoodsId.Text);
         HyperLink hlProductName = (HyperLink)e.Row.FindControl("hlProductName");
         hlProductName.NavigateUrl = "show.aspx?id=" + intGoodsId;
         // 记录进货总量的Label控件
         Label lblAmountIn = (Label)e.Row.FindControl("lblAmountIn");
         // 记录实时库存总量的Label控件
         Label lblInventory = (Label)e.Row.FindControl("lblInventory");
         // 记录盘后库存总量的Label控件
         Label lblAmountStock = (Label)e.Row.FindControl("lblAmountStock");
         // 得到某个货品的出库总量
         decimal dcmOut = BllCheckoutRecord.getAmountByGoodsId(intGoodsId);
         // 得到入库的货品总量
         if ("".Equals(lblAmountIn.Text))
         {
             lblAmountIn.Text = "0";
         }
         decimal dcmIn = Convert.ToDecimal(lblAmountIn.Text);
         // 计算实时库存量
         decimal dcmInventory = dcmIn - dcmOut;
         lblInventory.Text = dcmInventory.ToString("N");
         // 根据出库单id,货品id,出库数量添加一条出库货品记录
         // 先得到输入出库数量的textbox控件id
         TextBox tbCheckoutAmount = (TextBox)e.Row.FindControl("tbCheckoutAmount");
         // 得到添加到出库单的按钮控件
         HtmlInputButton btnAddToList          = (HtmlInputButton)e.Row.FindControl("btnAddToList");
         int             intCheckoutContractId = Convert.ToInt32(ViewState["ContractId"]);
         if ("".Equals(tbCheckoutAmount.Text))
         {
             tbCheckoutAmount.Text = "0";
         }
         string strClickHandler = "addGoods(" +
                                  intCheckoutContractId + "," +
                                  intGoodsId + ",\"" +
                                  lblInventory.ClientID + "\",\"" +
                                  lblAmountStock.ClientID + "\",\"" +
                                  tbCheckoutAmount.ClientID + "\")";
         // 将上述值绑定到按钮事件上
         btnAddToList.Attributes.Add("onclick", strClickHandler);
     }
 }
예제 #12
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            if (this.currentPeriodDateTextBox != null)
            {
                this.currentPeriodDateTextBox.Dispose();
                this.currentPeriodDateTextBox = null;
            }

            if (this.previousPeriodDateTextBox != null)
            {
                this.previousPeriodDateTextBox.Dispose();
                this.previousPeriodDateTextBox = null;
            }

            if (this.factorInputText != null)
            {
                this.factorInputText.Dispose();
                this.factorInputText = null;
            }

            if (this.showButton != null)
            {
                this.showButton.Dispose();
                this.showButton = null;
            }

            if (this.printButton != null)
            {
                this.printButton.Dispose();
                this.printButton = null;
            }

            if (this.grid != null)
            {
                this.grid.RowDataBound -= this.Grid_RowDataBound;
                this.grid.DataBound    -= this.Grid_DataBound;
                this.grid.Dispose();
                this.grid = null;
            }

            this.disposed = true;
        }
예제 #13
0
        /// <summary>
        /// LoginUserPortal - Use 'LoginUserPortalParams' to pass parameters into this method.
        /// </summary>
        public void LoginUserPortal()
        {
            #region Variable Declarations
            HtmlEdit        uIEmailAddressEdit = this.UIWelcometoStageBitzWiWindow.UIWelcometoStageBitzDocument1.UIEmailAddressEdit;
            HtmlEdit        uIPasswordEdit     = this.UIWelcometoStageBitzWiWindow.UIWelcometoStageBitzDocument1.UIPasswordEdit;
            HtmlInputButton uISignInButton     = this.UIWelcometoStageBitzWiWindow.UIWelcometoStageBitzDocument1.UISignInButton;
            #endregion

            // Type '*****@*****.**' in 'Email Address' text box
            uIEmailAddressEdit.Text = this.LoginUserPortalParams.UIEmailAddressEditText;

            // Type '********' in 'Password' text box
            uIPasswordEdit.Password = this.LoginUserPortalParams.UIPasswordEditPassword;

            // Click 'Sign In' button
            Mouse.Click(uISignInButton, new Point(14, 9));
        }
예제 #14
0
        public bool IsInExport = false;         // Added by Icyer 2006/12/26 @ YHI	标识是否导出操作,如果是导出则不用计算总数

        public WebQueryHelperNew(
            HtmlInputButton queryButton,
            HtmlInputButton exportButton,
            WebDataGrid grid,
            PagerSizeSelector selector,
            PagerToolBar toolBar,
            ControlLibrary.Web.Language.LanguageComponent languageComponent,
            DataTable source)
        {
            dtSource = source;
            //variable
            this.cmdQuery           = queryButton;
            this.cmdGridExport      = exportButton;
            this.gridWebGrid        = grid;
            this.pagerSizeSelector  = selector;
            this.pagerToolBar       = toolBar;
            this.languageComponent1 = languageComponent;
            //export
            this.excelExporter      = new BenQGuru.eMES.Web.Helper.ExcelExporter();
            this.excelExporter.Page = this.gridWebGrid.Page;
            this.excelExporter.FormatExportRecordHandle  = new FormatExportRecordDelegate(this.FormatExportRecord);
            this.excelExporter.LoadExportDataHandle      = new LoadExportDataDelegate(this.LoadDataSource);
            this.excelExporter.LanguageComponent         = this.languageComponent1;
            this.excelExporter.GetColumnHeaderTextHandle = new GetColumnHeaderTextDelegate(GetColumnHeaderText);
            //register event
            if (this.cmdQuery != null)
            {
                this.cmdQuery.ServerClick += new EventHandler(cmdQuery_ServerClick);
            }
            if (this.cmdGridExport != null)
            {
                this.cmdGridExport.ServerClick += new EventHandler(cmdGridExport_ServerClick);
            }
            //if (this.gridWebGrid != null)
            //{
            //    this.gridWebGrid.ClickCellButton += new ClickCellButtonEventHandler(gridWebGrid_ClickCellButton);
            //}
            if (this.pagerToolBar != null)
            {
                this.pagerToolBar.OnPagerToolBarClick += new EventHandler(this.PagerToolBar_OnPagerToolBarClick);
            }
            if (this.pagerSizeSelector != null)
            {
                this.pagerSizeSelector.OnPagerSizeChanged += new BenQGuru.eMES.Web.Helper.PagerSizeSelector.PagerSizeChangedHandle(pagerSizeSelector_OnPagerSizeChanged);
            }
        }
        /// <summary>
        /// Prend en charge la désinscription d'un atelier. L'identité de l'étudiant provient du contexte HTTP,
        /// et l'identité de l'atelier provient de l'ID du bouton cliqué.
        /// </summary>
        /// <param name="sender">Bouton cliqué. Son ID correspond au numéro de l'atelier choisi dans la BD.</param>
        /// <param name="e"></param>
        public static void Unsubscribe(object sender, EventArgs e)
        {
            HtmlInputButton button = (HtmlInputButton)sender;
            string          user   = HttpContext.Current.User.Identity.Name;


            if (int.TryParse(button.ID, out int numAtelier))
            {
                Etudiant_Atelier toDelete = context.Etudiant_Atelier.SingleOrDefault(ea => ea.Numero_Etudiant == user &&
                                                                                     ea.NumAtelier == numAtelier);

                context.Etudiant_Atelier.DeleteOnSubmit(toDelete);

                context.SubmitChanges();
                button.Value = "Succès";
            }
        }
예제 #16
0
        private void AddSignInButtonField(HtmlGenericControl container)
        {
            using (HtmlGenericControl field = new HtmlGenericControl("div"))
            {
                field.Attributes.Add("class", "field");

                using (HtmlInputButton signInButton = new HtmlInputButton())
                {
                    signInButton.ID    = "SignInButton";
                    signInButton.Value = Titles.SignIn;
                    signInButton.Attributes.Add("class", "ui teal button");
                    field.Controls.Add(signInButton);
                }

                container.Controls.Add(field);
            }
        }
        private void AddInputButtonControlCell(TableRow row, string controlId, string cssClass, string value)
        {
            using (TableCell cell = new TableCell())
            {
                using (HtmlInputButton targetControl = new HtmlInputButton())
                {
                    targetControl.ID = controlId;
                    targetControl.Attributes.Add("class", cssClass);
                    targetControl.Value = value;

                    cell.Controls.Add(targetControl);
                }

                row.Controls.Add(cell);
            }
            #endregion
        }
        /// <summary>
        /// Insert hyperlinks in the placeholders to enable placeholder selection (for administration only).
        /// </summary>
        public void InsertContainerButtons()
        {
            string placeholderChooseControl = Context.Request.QueryString["Control"];

            if (placeholderChooseControl != null)
            {
                foreach (PlaceHolder plc in Containers.Values)
                {
                    HtmlInputButton btn = new HtmlInputButton();
                    btn.Value = plc.ID;
                    btn.Attributes.Add("onclick",
                                       String.Format("window.opener.setPlaceholderValue('{0}','{1}');self.close()",
                                                     placeholderChooseControl, plc.ID));
                    plc.Controls.Add(btn);
                }
            }
        }
예제 #19
0
        private void AddButton()
        {
            using (HtmlGenericControl div = new HtmlGenericControl())
            {
                div.TagName = "div";
                div.Attributes.Add("class", "vpad16");

                using (HtmlInputButton reorderButton = new HtmlInputButton())
                {
                    reorderButton.Attributes.Add("class", "ui positive button");
                    reorderButton.Attributes.Add("onclick", "ReorderInputButtonClick()");
                    reorderButton.Value = Titles.PlaceReorderRequests;
                    div.Controls.Add(reorderButton);
                    this.Placeholder1.Controls.Add(div);
                }
            }
        }
예제 #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["Uid"] == null)
     {
         base.Response.Redirect("../Smt_Login.aspx", false);
     }
     else if (!base.IsPostBack)
     {
         this.bind();
         this.bindStyle();
         this.bindForapprove();
         Control[]         btnall  = new Control[] { this.btnSave };
         Control[]         addbtn  = new Control[0];
         HtmlInputButton[] htmlbtn = new HtmlInputButton[] { this.btnAddsupplier };
         this._mycls.SetBtnPermissionwithhtmlbtn(this.Session["Uid"].ToString(), btnall, addbtn, htmlbtn, "Smt_Inv_GRN.aspx");
     }
 }
예제 #21
0
        private HtmlInputButton CreateTagButton(Tags tag)
        {
            HtmlInputButton button = new HtmlInputButton()
            {
                Value = tag.Description
            };

            button.Name = "btn";

            button.Attributes.Add("class", "btn choix-tag");

            button.ServerClick += tagbtn_Click;



            return(button);
        }
예제 #22
0
        /// <summary>
        /// addCar2 - Use 'addCar2Params' to pass parameters into this method.
        /// </summary>
        public void addCar2()
        {
            #region Variable Declarations
            HtmlHyperlink   uIPojazdyHyperlink         = this.UIIndexMyASPNETApplicaWindow.UIIndexMyASPNETApplicaDocument.UIBsexamplenavbarcollaPane.UIPojazdyHyperlink;
            HtmlDiv         uIIndexCreateNewNameMoPane = this.UIIndexMyASPNETApplicaWindow.UIIndexMyASPNETApplicaDocument1.UIIndexCreateNewNameMoPane;
            HtmlHyperlink   uICreateNewHyperlink       = this.UIIndexMyASPNETApplicaWindow.UIIndexMyASPNETApplicaDocument1.UICreateNewHyperlink;
            HtmlEdit        uIModelEdit        = this.UIIndexMyASPNETApplicaWindow.UICreateMyASPNETApplicDocument.UIModelEdit;
            HtmlEdit        uIRokprodukcjiEdit = this.UIIndexMyASPNETApplicaWindow.UICreateMyASPNETApplicDocument.UIRokprodukcjiEdit;
            HtmlEdit        uIVinEdit          = this.UIIndexMyASPNETApplicaWindow.UICreateMyASPNETApplicDocument.UIVinEdit;
            HtmlInputButton uICreateButton     = this.UIIndexMyASPNETApplicaWindow.UICreateMyASPNETApplicDocument.UICreateButton;
            #endregion

            // Click 'Pojazdy' link
            Mouse.Click(uIPojazdyHyperlink, new Point(48, 34));

            // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
            Playback.PlaybackSettings.ContinueOnError = true;

            // Mouse hover 'Index Create New Name Model' pane at (1, 1)
            Mouse.Hover(uIIndexCreateNewNameMoPane, new Point(1, 1));

            // Reset flag to ensure that play back stops if there is an error.
            Playback.PlaybackSettings.ContinueOnError = false;

            // Click 'Create New' link
            Mouse.Click(uICreateNewHyperlink, new Point(14, 5));

            // Type 'opel' in 'Model' text box
            uIModelEdit.Text = this.addCar2Params.UIModelEditText;

            // Type '{Tab}' in 'Model' text box
            Keyboard.SendKeys(uIModelEdit, this.addCar2Params.UIModelEditSendKeys, ModifierKeys.None);

            // Type '2008' in 'Rok produkcji' text box
            uIRokprodukcjiEdit.Text = this.addCar2Params.UIRokprodukcjiEditText;

            // Type '{Tab}' in 'Rok produkcji' text box
            Keyboard.SendKeys(uIRokprodukcjiEdit, this.addCar2Params.UIRokprodukcjiEditSendKeys, ModifierKeys.None);

            // Type 'bndmioksndhg' in 'Vin' text box
            uIVinEdit.Text = this.addCar2Params.UIVinEditText;

            // Click 'Create' button
            Mouse.Click(uICreateButton, new Point(38, 24));
        }
예제 #23
0
        public void CreateControls()
        {
            // Render Text inputs
            _ParameterProperties.ForEach(p =>
            {
                var tr = new HtmlTableRow();
                tr.Cells.Add(CreateTableCell(new LiteralControl(p.FriendlyName + ": ")));
                tr.Cells.Add(CreateTableCell(new LiteralControl("<input type=\"text\" style=\"width: 300px\" id=\"" + p.Name + "\" />")));

                tabForm.Controls.Add(tr);
            });


            // Render validation area
            var trValidation = new HtmlTableRow();

            trValidation.Cells.Add(CreateTableCell(new LiteralControl()));
            trValidation.Cells.Add(CreateTableCell(new LiteralControl("<span class=\"error-validation\" id=\"spnErrorMessage\"></span>")));
            tabForm.Controls.Add(trValidation);


            // Submit Button
            var trSubmit     = new HtmlTableRow();
            var submitButton = new HtmlInputButton()
            {
                Value = "Subscribe"
            };

            submitButton.Attributes.Add("class", "button");
            submitButton.Attributes.Add("onclick", "validateInput();");
            submitButton.Attributes.Add("type", "button");

            trSubmit.Cells.Add(CreateTableCell(new LiteralControl()));

            var panel = new Panel();

            panel.Controls.Add(submitButton);

            var goBack = new LiteralControl("&nbsp;or <a href=\"javascript:history.go(-1);\">cancel</a>");

            panel.Controls.Add(goBack);

            trSubmit.Cells.Add(CreateTableCell(panel));
            tabForm.Controls.Add(trSubmit);
        }
예제 #24
0
        /// <summary>
        /// Sets the causes validation property to false, if such a property exists in the m_cToTest.
        /// This is needed because for controls that cause validation, the ValidationControls on the page
        /// generate a client side script.
        /// That feature is not working properly in GrassHopper, and is not the main issue of this test.
        /// It will be testes specificly in the Validation control tests.
        /// </summary>
        private void HandleCausesValidation()
        {
            //HtmlButton:
            HtmlButton hButton = m_cToTest as HtmlButton;

            if (hButton != null)
            {
                hButton.CausesValidation = false;
            }
            //HtmlInputButton
            HtmlInputButton hInputButton = m_cToTest as HtmlInputButton;

            if (hInputButton != null)
            {
                hInputButton.CausesValidation = false;
            }
            //HtmlInputImage
            HtmlInputImage hInputImage = m_cToTest as HtmlInputImage;

            if (hInputImage != null)
            {
                hInputImage.CausesValidation = false;
            }
            //Button:
            Button button = m_cToTest as Button;

            if (button != null)
            {
                button.CausesValidation = false;
            }
            //ImageButton
            ImageButton imageButton = m_cToTest as ImageButton;

            if (imageButton != null)
            {
                imageButton.CausesValidation = false;
            }
            //LinkButton
            LinkButton linkButton = m_cToTest as LinkButton;

            if (linkButton != null)
            {
                linkButton.CausesValidation = false;
            }
        }
예제 #25
0
        protected void deleteClick(Object sender, EventArgs e)
        {
            HtmlInputButton b = sender as HtmlInputButton;

            int    c_pos  = b.ID.IndexOf('c');
            int    r_pos  = b.ID.IndexOf('r');
            string rowval = b.ID.Substring(r_pos + 1, (c_pos - r_pos - 1));
            string colval = b.ID.Substring(c_pos + 1);
            int    b_id   = Convert.ToInt32(b.ID.Substring(1, r_pos - 1));

            int row = Convert.ToInt32(rowval);
            int col = Convert.ToInt32(colval);

            var date     = days[col];
            var timeslot = timeSlots[row];

            string     makeBooking = "DELETE FROM [Booking] WHERE [booking_id] = @booking_id";
            SqlCommand booking_cmd = new SqlCommand(makeBooking, con);

            int facility_id = Convert.ToInt32(DropDownList.SelectedValue);

            booking_cmd.Parameters.AddWithValue("@booking_id", b_id);

            int rows_affected = booking_cmd.ExecuteNonQuery();

            if (rows_affected > 0)
            {
                Response.Write("<script>alert('Delete Successful');</script>");

                tableContent.Rows[row + 1].Cells[col + 1].BgColor = "White";
                tableContent.Rows[row + 1].Cells[col + 1].Controls.Clear();

                HtmlInputButton input = new HtmlInputButton();
                input.ID           = "f" + facility_id + "r" + row + "c" + col;
                input.Value        = "Book";
                input.ServerClick += buttonClick;
                input.Attributes.Add("autopostback", "false");

                tableContent.Rows[row + 1].Cells[col + 1].Controls.Add(input);
            }
            else
            {
                Response.Write("<script>alert('Delete UnSuccessful');</script>");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                gridViewAtelier.DataSource = GetAtelierRecord();
                gridViewAtelier.DataBind();
            }

            foreach (var tag in AtelierDataContext.Tags)
            {
                HtmlInputButton newButton = CreateTagButton(tag);

                pnTags.Controls.Add(newButton);
            }

            hiddenMessage.Attributes.Add("class", "hiddenMessage");
            btnAjouter.Click += AtelierCreation_Click;
        }
예제 #27
0
 //取消按钮控件
 void CreateCancelButton(string keyID, string controlName, TableCell cell)
 {
     System.Web.UI.HtmlControls.HtmlInputButton button = new HtmlInputButton();
     button.Value = "取消";
     button.ID    = keyID + "_" + controlName;
     button.Style.Add("BORDER-RIGHT", "medium none");
     button.Style.Add("BORDER-TOP", "medium none");
     button.Style.Add("FONT-SIZE", "8pt");
     button.Style.Add("BACKGROUND-IMAGE", "url(../images/btnShort.gif)");
     button.Style.Add("BORDER-LEFT", "medium none");
     button.Style.Add("WIDTH", "40px");
     button.Style.Add("CURSOR", "hand");
     button.Style.Add("BORDER-BOTTOM", "medium none");
     button.Style.Add("HEIGHT", "25px");
     button.Attributes["onclick"] = string.Format("return CancelData('{0}');", keyID);
     button.Style.Add("display", "none");
     cell.Controls.Add(button);
 }
예제 #28
0
        /// <summary>
        /// tests ecent editing UI
        /// </summary>
        public void editEventTest()
        {
            #region Variable Declarations
            HtmlInputButton uILogintocontinueButton = this.UIHomePageTrailMixInteWindow.UIHomePageTrailMixDocument.UILogintocontinueButton;
            HtmlEdit        uIUsernameEdit          = this.UIHomePageTrailMixInteWindow.UILoginTrailMixDocument.UIUsernameEdit;
            HtmlEdit        uIPasswordEdit          = this.UIHomePageTrailMixInteWindow.UILoginTrailMixDocument.UIPasswordEdit;
            HtmlInputButton uILoginButton           = this.UIHomePageTrailMixInteWindow.UILoginTrailMixDocument.UILoginFormCustom.UILoginButton;
            HtmlHyperlink   uIManageEventsHyperlink = this.UIHomePageTrailMixInteWindow.UIHomePageTrailMixDocument.UIManageEventsHyperlink;
            HtmlHyperlink   uIEditHyperlink         = this.UIHomePageTrailMixInteWindow.UIEventsTrailMixDocument.UIEditHyperlink;
            HtmlEdit        uIEventLocationEdit     = this.UIHomePageTrailMixInteWindow.UIEditTrailMixDocument.UIEventLocationEdit;
            HtmlInputButton uISaveButton            = this.UIHomePageTrailMixInteWindow.UIEditTrailMixDocument.UISaveButton;
            HtmlCell        uIMississauga12Cell     = this.UIHomePageTrailMixInteWindow.UIEventsTrailMixDocument.UIItemTable.UIMississauga12Cell;
            #endregion

            // Click 'Login to continue' button
            Mouse.Click(uILogintocontinueButton, new Point(274, 53));

            // Type 'admin' in 'User name' text box
            uIUsernameEdit.Text = this.editEventTestParams.UIUsernameEditText;

            // Type '{Tab}' in 'User name' text box
            Keyboard.SendKeys(uIUsernameEdit, this.editEventTestParams.UIUsernameEditSendKeys, ModifierKeys.None);

            // Type '********' in 'Password' text box
            uIPasswordEdit.Password = this.editEventTestParams.UIPasswordEditPassword;

            // Click 'Log in' button
            Mouse.Click(uILoginButton, new Point(23, 57));

            // Click 'Manage Events' link
            Mouse.Click(uIManageEventsHyperlink, new Point(313, 33));

            // Click 'Edit' link
            Mouse.Click(uIEditHyperlink, new Point(3, 13));

            // Type 'Mississauga12' in 'eventLocation' text box
            uIEventLocationEdit.Text = this.editEventTestParams.UIEventLocationEditText;

            // Click 'Save' button
            Mouse.Click(uISaveButton, new Point(79, 11));

            // Click 'Mississauga12' cell
            Mouse.Click(uIMississauga12Cell, new Point(79, 40));
        }
예제 #29
0
파일: UIMap.cs 프로젝트: vutrieuda/Space
        /// <summary>
        /// RecordedMethodCreate - Use 'RecordedMethodCreateParams' to pass parameters into this method.
        /// </summary>
        public void RecordedMethodCreate()
        {
            Playback.PlaybackSettings.LoggerOverrideState = HtmlLoggerState.AllActionSnapshot;

            #region Variable Declarations
            HtmlEdit        uIFirstNameEdit         = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UIFirstNameEdit;
            HtmlEdit        uILastNameEdit          = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UILastNameEdit;
            HtmlEdit        uIEmailEdit             = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UIEmailEdit;
            HtmlEdit        uIDateofBirthEdit       = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UIDateofBirthEdit;
            HtmlComboBox    uIItemComboBox          = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UIUidatepickerdivPane.UIItemComboBox;
            HtmlHyperlink   uIItem5Hyperlink        = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UIUidatepickerdivPane.UIItem5Hyperlink;
            HtmlInputButton uICreateButton          = this.UIIndexCodedUItestautoWindow.UICreateCodedUItestautDocument.UICreateButton;
            HtmlHyperlink   uIEmailAddressHyperlink = this.UIIndexCodedUItestautoWindow.UIIndexCodedUItestautoDocument.UIBobsmithsomedomaincoHyperlink;
            #endregion

            // Type 'Bob' in 'First Name' text box
            uIFirstNameEdit.Text = this.RecordedMethodCreateParams.UIFirstNameEditText;

            // Type '{Tab}' in 'First Name' text box
            Keyboard.SendKeys(uIFirstNameEdit, this.RecordedMethodCreateParams.UIFirstNameEditSendKeys, ModifierKeys.None);

            // Type 'Smith' in 'Last Name' text box
            uILastNameEdit.Text = this.RecordedMethodCreateParams.UILastNameEditText;

            // Type '{Tab}' in 'Last Name' text box
            Keyboard.SendKeys(uILastNameEdit, this.RecordedMethodCreateParams.UILastNameEditSendKeys, ModifierKeys.None);

            // Type '*****@*****.**' in 'Email' text box
            uIEmailEdit.Text = this.RecordedMethodCreateParams.UIEmailEditText;

            // Click 'Date of Birth' text box
            Mouse.Click(uIDateofBirthEdit, new Point(319, 29));

            // Type '03/05/1996' in 'Date of Birth' text box
            uIDateofBirthEdit.Text = this.RecordedMethodCreateParams.UIDateOfBirthEditText;

            // Click 'Create' button
            Mouse.Click(uICreateButton, new Point(56, 27));

            // Hover on email address link when the Index page reloads
            uIEmailAddressHyperlink.WaitForControlReady();
            Mouse.Hover(uIEmailAddressHyperlink);
        }
예제 #30
0
        public static void ClickInputButton()
        {
            var btn = new HtmlInputButton(browserWindow)
            {
                TechnologyName = "Web"
            };

            try
            {
                btn.SearchProperties.Add(CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
                btn.WaitForControlEnabled();
                btn.WaitForControlReady();
            }
            catch (Exception)
            {
                Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
            }
            Mouse.Click(btn);
        }
예제 #31
0
        public static void SelfIdentificationSurvey1()
        {
            //Create browserwindow
            BrowserWindow browind = new BrowserWindow();

            browind.SearchProperties[UITestControl.PropertyNames.Name] = "Self-Identification Survey";
            Mouse.MoveScrollWheel(-120);

            //Button "Save And Continue"

            HtmlInputButton SaveNContinue = new HtmlInputButton(browind);

            SaveNContinue.SearchProperties[HtmlButton.PropertyNames.Id] = "ForwardButton_button";



            // Progress Meter

            HtmlCustom progress = new HtmlCustom(browind);

            progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter";
            bool   availabilty   = (bool)progress.GetProperty(HtmlCustom.PropertyNames.Exists);
            string workflowEvent = PersonalInformation1.ReadData(1, "WORKFLOW");

            if (workflowEvent == "S1PROSPECT")
            {
                Assert.IsTrue(availabilty, "Progress Meter is not showing");

                HtmlSpan bar = new HtmlSpan(browind);
                bar.SearchProperties[HtmlSpan.PropertyNames.Id] = "meterlabel";
                string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText);
                Assert.AreEqual(percentage, "70%");
            }
            else
            {
                Assert.IsFalse(availabilty, "Progress Meter is showing");
            }

            //Click Save and Continue button
            Mouse.Click(SaveNContinue);

            browind.WaitForControlReady(2000);
        }
예제 #32
0
        private void AddPrintButton(HtmlGenericControl container)
        {
            using (HtmlGenericControl field = HtmlControlHelper.GetField())
            {
                field.Controls.Add(this.GetEmptyLabel());

                using (HtmlInputButton printButton = new HtmlInputButton())
                {
                    printButton.ID = "PrintButton";
                    printButton.Attributes.Add("class", "ui orange button");

                    printButton.Value = Titles.Print;

                    field.Controls.Add(printButton);
                }

                container.Controls.Add(field);
            }
        }
예제 #33
0
        protected void gvPlant_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                HtmlInputHidden key = (HtmlInputHidden)e.Row.Cells[0].FindControl("plantid");

                if ((HtmlInputButton)e.Row.Cells[7].FindControl("plantupdate") != null)
                {
                    HtmlInputButton btn = (HtmlInputButton)e.Row.Cells[7].FindControl("plantupdate");
                    btn.Attributes.Add("onclick", "javascript:PlantUpdate('" + key.Value + "');");
                }

                if ((LinkButton)e.Row.Cells[8].FindControl("delete") != null)
                {
                    LinkButton lb = (LinkButton)e.Row.Cells[8].FindControl("delete");
                    lb.Attributes.Add("onclick", "javascript:return confirm('确定删除吗?');");
                }
            }
        }
    protected new void Page_Init(object sender, EventArgs e)
    {
        this.BaseModule = new Module();
        this.BaseModule.ModuleNamespace = "PigeonCms";
        this.BaseModule.ModuleName = "ContentEditorControl";

        if (this.Configuration.ReadMoreButton)
        {
            var btn = new HtmlInputButton();
            btn.Value = base.GetLabel("ReadMore", "Read more");
            btn.Attributes["onclick"] = "insertReadmore();";
            btn.Attributes["class"] = "button";
            this.PanelButtons.Controls.Add(btn);
        }
        if (this.Configuration.PageBreakButton)
        {
            var btn = new HtmlInputButton();
            btn.Value = base.GetLabel("Pagebreak", "Page break");
            btn.Attributes["onclick"] = "insertPagebreak();";
            btn.Attributes["class"] = "button";
            this.PanelButtons.Controls.Add(btn);
        }
        if (this.Configuration.FileButton)
        {
            var btn = new HtmlInputButton();
            btn.Value = base.GetLabel("File", "File");
            btn.Attributes["onclick"] = "insertFile();";
            btn.Attributes["class"] = "button";
            this.PanelButtons.Controls.Add(btn);
        }
        //if (this.Configuration.ToggleEditor)
        //{
        //    var btn = new HtmlInputButton();
        //    btn.Value = base.GetLabel("Html", "Html");
        //    btn.Attributes["onclick"] = "toggleEditor();";
        //    btn.Attributes["class"] = "button";
        //    this.PanelButtons.Controls.Add(btn);
        //}

        base.Page_Init(sender, e);
    }
예제 #35
0
    private void updateCultura()
    {
        Label l = new Label();
        // bool auto = false;
        climaCultura.Visible = false;

        foreach (Ticket t in ticketList)
        {
            if (t.Avaliado != null)
            {
                if (t.Proprio.Email.Equals(t.Avaliado.Email) && t.ticketType == "CULTURA")
                {
                    // é o ticket de personalístico
                    if (t.completo)
                    {
                        l.Text = dic.getResource(56); //"Questionário de Clima e Cultura Completo";
                        climaCulturaEnd.Controls.Add(l);
                        climaCultura.Visible = false;
                    }
                    else
                    {
                        climaCulturaEnd.Visible = false;
                        climaCultura.Visible = true;

                        if (DateTime.Now.Date > t.Projecto.DataFim)
                        {
                            l.Text = dic.getResource(57); //"Questionário de Cultura  ->  Processo Encerrado";
                            climaCultura.Controls.Add(l);

                        }
                        else
                        {

                            l.Text = dic.getResource(58); //"Questionário de Cultura   -> ";
                            climaCultura.Controls.Add(l);
                            HtmlInputButton botStart = new HtmlInputButton("button");
                            if (t.DataInicio == DateTime.MinValue)
                            {
                                botStart.Value = dic.getResource(59); //"Iniciar o Questionário de Clima e Cultura";
                                botStart.Attributes.Add("onClick", "window.location='FO_TakeSurveyC.aspx?ticket=" + t.Chave + "';");
                            }
                            else
                            {
                                botStart.Style.Add(HtmlTextWriterStyle.Color, "#FF0000");
                                botStart.Value = dic.getResource(60); //"Continuar Questionário de Clima e Cultura";
                                botStart.Attributes.Add("onClick", "window.location='FO_TakeSurveyC.aspx?ticket=" + t.Chave + "';");
                            }
                            climaCultura.Controls.Add(botStart);
                        }
                    }
                    break;
                }
            }
        }
    }
예제 #36
0
 private void updateAutoAvaliacao()
 {
     Label l = new Label();
     // bool auto = false;
     foreach (Ticket t in ticketList.Where(a => a.dataEntrada <= DateTime.Now))
     {
         if (t.Avaliado != null)
         {
             if (t.Proprio.Email.Equals(t.Avaliado.Email) && (t.ticketType == "" || t.ticketType == null || t.ticketType == "360"))
             {
                 autoavaliacao = true;
                 // este é o ticket para a auto avaliação
                 // render o html para abrir a auto avaliação
                 // auto = true;
                 // verificar se a auto avaliação está concluída
                 if (t.completo)
                 {
                     l.Text =  dic.getResource(47) +  " [multiRater 360º]";
                     autoAvaliaDone.Controls.Add(l);
                     autoAvaliaContent.Visible = false;
                     autoAvaliaDone.Visible = true;
                 }
                 else
                 {
                     if (DateTime.Now.Date > t.Projecto.DataFim)
                     {
                         l.Text = dic.getResource(48) + " [multiRater 360º]  ->  " + dic.getResource(25);
                         autoAvaliaContent.Controls.Add(l);
                         autoAvaliaDone.Visible = false;
                     }
                     else
                     {
                         autoAvaliaDone.Visible = false;
                         l.Text = dic.getResource(48) + " [multiRater 360º]  -> ";
                         autoAvaliaContent.Controls.Add(l);
                         HtmlInputButton botStart = new HtmlInputButton("button");
                         if (t.DataInicio == DateTime.MinValue)
                         {
                             botStart.Value = dic.getResource(49); // "Iniciar a minha autoavaliação";
                             botStart.Attributes.Add("onClick", "window.location='FO_GetInstructions.aspx?ticket=" + t.Chave + "';");
                         }
                         else
                         {
                             botStart.Style.Add(HtmlTextWriterStyle.Color, "#FF0000");
                             botStart.Value = dic.getResource(50); //"Continuar a minha autoavaliação";
                             botStart.Attributes.Add("onClick", "window.location='FO_GetInstructions.aspx?ticket=" + t.Chave + "';");
                         }
                         autoAvaliaContent.Controls.Add(botStart);
                     }
                 }
                 break;
             }
         }
     }
     if (!autoavaliacao)
     {
         autoAvalia.Visible = false;
         autoAvaliaDone.Visible = false;
     }
 }
예제 #37
0
 public bool ButtonExist(string prefix, string id)
 {
     HtmlInputButton Button = new HtmlInputButton(Doc);
     Button.SearchProperties[HtmlInputButton.PropertyNames.Id] = prefix + id;
     if (Button.Id != "")
     {
         return true;
     }
     else
     {
         return false;
     }
 }
예제 #38
0
 public void ButtonClick(string prefix, string id, int num = 1)
 {
     HtmlInputButton btn = new HtmlInputButton(Doc);
     btn.SearchProperties[HtmlInputButton.PropertyNames.Id] = prefix + id;
     for (int i = 0; i < num; i++)
     {
         Mouse.Click(btn);
     }
 }
 private void ClickButton(UITestControl parent)
 {
     var button = new HtmlInputButton(parent);
     button.SearchProperties.Add(HtmlInputButton.PropertyNames.Id, "submit");
     Mouse.Click(button);
 }
예제 #40
0
		public Filter()
		{
			text = new TextBox();
			Controls.Add(text);

			button = new HtmlInputButton();
			button.Value = "...";
			Controls.Add(button);

			Controls.Add(new LiteralControl("<br/>"));
			
			label = new Label();
			Controls.Add(label);
		}
예제 #41
0
    private void updatePersonalistico()
    {
        Label l = new Label();
        // bool auto = false;
        personalistico.Visible = false;

        foreach (Ticket t in ticketList)
        {
            if (t.Avaliado != null)
            {
                if (t.Proprio.Email.Equals(t.Avaliado.Email) && t.ticketType == "PERS")
                {
                    // é o ticket de personalístico
                    if (t.completo)
                    {
                        l.Text = dic.getResource(51); //"Questionário de Personalidade Completo";
                        personalisticoDone.Controls.Add(l);
                        personalistico.Visible = false;
                        personalisticoDone.Visible = true;
                    }
                    else
                    {
                        personalisticoDone.Visible = false;
                        personalistico.Visible = true;

                        if (DateTime.Now.Date > t.Projecto.DataFim)
                        {
                            l.Text = dic.getResource(52); //"Questionário de Personalidade  ->  Processo Encerrado";
                            personalistico.Controls.Add(l);

                        }
                        else
                        {

                            l.Text = dic.getResource(53); //"Questionário de Personalidade   -> ";
                            personalistico.Controls.Add(l);
                            HtmlInputButton botStart = new HtmlInputButton("button");
                            if (t.DataInicio == DateTime.MinValue)
                            {
                                botStart.Value = dic.getResource(54); //"Iniciar o Questionário de Personalidade";
                                // botStart.Attributes.Add("onClick", "window.location='FO_GetInstructionsP.aspx?ticket=" + t.Chave + "';");
                                botStart.Attributes.Add("onClick", "window.location='FO_TakeSurveyP.aspx?ticket=" + t.Chave + "';");
                            }
                            else
                            {
                                botStart.Style.Add(HtmlTextWriterStyle.Color, "#FF0000");
                                botStart.Value = dic.getResource(55); //"Continuar Questionário de Personalidade";
                                botStart.Attributes.Add("onClick", "window.location='FO_TakeSurveyP.aspx?ticket=" + t.Chave + "';");
                            }
                            personalistico.Controls.Add(botStart);
                        }
                    }
                    break;
                }
            }
        }
        if (!autoavaliacao)
        {
            autoAvalia.Visible = false;
            autoAvaliaDone.Visible = false;
        }
    }
예제 #42
0
 public void ButtonClick(string prefix, string id)
 {
     HtmlInputButton Button = new HtmlInputButton(Doc);
     Button.SearchProperties[HtmlInputButton.PropertyNames.Id] = prefix + id;
     Mouse.Click(Button);
 }
예제 #43
0
 public static void ClickInputButton()
 {
     var btn = new HtmlInputButton(browserWindow) { TechnologyName = "Web" };
     try
     {
         btn.SearchProperties.Add(CSVReader.ControlType+".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
         btn.WaitForControlEnabled();
         btn.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
     }
     Mouse.Click(btn);
 }
예제 #44
0
 public WebInputButton(List<UIProperty> controlProps)
 {
     BrowserWindow window = this.GetBrowser(controlProps);
     inputbutton = new HtmlInputButton(window);
     controlProps.ForEach(property => inputbutton.SearchProperties[property.PropertyName] = property.PropertyValue);
 }
예제 #45
0
    private HtmlTableRow CreateRow(string title, string link, int sort, bool isDeletable)
    {
        HtmlTableRow row = new HtmlTableRow();

        //TITLE
        HtmlTableCell cell = new HtmlTableCell();
        cell.Align = "center";
        TextBox tbTitle = new TextBox();
        tbTitle.Columns = 31;
        tbTitle.Text = title;
        cell.Controls.Add(tbTitle);
        row.Cells.Add(cell);

        //LINK
        cell = new HtmlTableCell();
        cell.Align = "center";
        TextBox tbLink = new TextBox();
        tbLink.Columns = 31;
        tbLink.Text = link;
        cell.Controls.Add(tbLink);
		HtmlInputButton btLink = new HtmlInputButton();
		btLink.Value = "...";
		tbLink.PreRender += delegate(object sender, EventArgs e)
		{
			btLink.Attributes["onclick"] = string.Format("return SelectDirClick('{0}');", tbLink.ClientID);
		};
		cell.Controls.Add(btLink);
        row.Cells.Add(cell);

        //SORT
        cell = new HtmlTableCell();
        cell.Align = "center";
        TextBox tbSort = new TextBox();
        tbSort.Text = sort.ToString();
        tbSort.Columns = 3;
        tbSort.MaxLength = 3;
        cell.Controls.Add(tbSort);
        row.Cells.Add(cell);

        //DELETE
        cell = new HtmlTableCell();
        cell.Align = "center";
        CheckBox delete = new CheckBox();
        cell.Controls.Add(delete);
        delete.Visible = isDeletable;
        row.Cells.Add(cell);

        return row;
    }