Beispiel #1
0
        public void TextArea(string prefix, string id, string value)
        {
            HtmlTextArea TextBox = new HtmlTextArea(Doc);

            TextBox.SearchProperties[HtmlTextArea.PropertyNames.Id] = prefix + id;
            TextBox.Text = value;
        }
Beispiel #2
0
 public void EnterText(object controlType, PropertyType type, string propertyValue, string text)
 {
     if (controlType is HtmlEdit)
     {
         HtmlEdit edit = new HtmlEdit(ParentWindow);
         if (type == PropertyType.Name)
         {
             edit.SearchProperties[HtmlEdit.PropertyNames.Name] = propertyValue;
         }
         else if (type == PropertyType.ID)
         {
             edit.SearchProperties[HtmlEdit.PropertyNames.Id] = propertyValue;
         }
         Keyboard.SendKeys(edit, text);
     }
     else if (controlType is HtmlTextArea)
     {
         HtmlTextArea textArea = new HtmlTextArea(ParentWindow);
         if (type == PropertyType.Name)
         {
             textArea.SearchProperties[HtmlTextArea.PropertyNames.Name] = propertyValue;
         }
         else if (type == PropertyType.ID)
         {
             textArea.SearchProperties[HtmlTextArea.PropertyNames.Id] = propertyValue;
         }
         Keyboard.SendKeys(textArea, text);
     }
 }
        //カレンダーに記録を書き込み
        public void BtInsert(object sender, EventArgs e)
        {
            HtmlTextArea mem  = (HtmlTextArea)(form1.FindControl("textarea2"));
            string       date = Calendar1.SelectedDate.ToString("yyyy/MM/dd");

            date = date.Substring(0, 10);
            date = date.Replace("/", "");
            string existCheck = "select TOP(1) * from test1 where date =" + date;

            com = new SqlCommand(existCheck, con);
            SqlDataReader reader = com.ExecuteReader();

            if (reader.HasRows)
            {
                reader.Close();
                string sqlUpdate = "update test1 set text = N'" + mem.Value + "' where date = '" + date + "'";
                com = new SqlCommand(sqlUpdate, con);
                com.ExecuteNonQuery();

                com.Dispose();
            }
            else
            {
                reader.Close();
                string sqlInsert = "insert into test1 (date, text) values ( " + "'" + date + "' , N'" + mem.Value + "')";
                com = new SqlCommand(sqlInsert, con);
                com.ExecuteNonQuery();

                com.Dispose();
            }
        }
Beispiel #4
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺消息");
            this.imglogo        = (HtmlImage)this.FindControl("imglogo");
            this.hdlogo         = (HtmlInputHidden)this.FindControl("hdlogo");
            this.txtstorename   = (HtmlInputText)this.FindControl("txtstorename");
            this.txtdescription = (HtmlTextArea)this.FindControl("txtdescription");
            this.txtacctount    = (HtmlInputText)this.FindControl("txtacctount");
            this.txtStoreTel    = (HtmlInputText)this.FindControl("txtStoreTel");
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId());

            if (userIdDistributors.ReferralStatus != 0)
            {
                HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                if (userIdDistributors != null)
                {
                    if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                    {
                        this.imglogo.Src = userIdDistributors.Logo;
                    }
                    this.hdlogo.Value         = userIdDistributors.Logo;
                    this.txtstorename.Value   = userIdDistributors.StoreName;
                    this.txtdescription.Value = userIdDistributors.StoreDescription;
                    this.txtacctount.Value    = userIdDistributors.RequestAccount;
                    this.txtStoreTel.Value    = currentMember.CellPhone;
                }
            }
        }
Beispiel #5
0
        private void AddStatementReferenceTextArea(HtmlGenericControl container)
        {
            using (HtmlGenericControl columnDiv = this.GetColumn(11))
            {
                using (HtmlGenericControl formGroup = this.GetFormGroup())
                {
                    using (HtmlGenericControl label = new HtmlGenericControl())
                    {
                        label.TagName = "label";
                        label.Attributes.Add("for", "StatementReferenceTextArea");
                        label.InnerText = Titles.StatementReference;
                        formGroup.Controls.Add(label);
                    }

                    using (HtmlTextArea statementReferenceTextArea = new HtmlTextArea())
                    {
                        statementReferenceTextArea.ID = "StatementReferenceTextArea";
                        statementReferenceTextArea.Attributes.Add("class", "form-control input-sm");
                        statementReferenceTextArea.Rows = 4;

                        formGroup.Controls.Add(statementReferenceTextArea);
                    }

                    columnDiv.Controls.Add(formGroup);
                }
                container.Controls.Add(columnDiv);
            }
        }
        /// <summary>
        /// 初始化用户输入框
        /// </summary>
        /// <param name="container"></param>
        private void InitOpinionInputBox(HtmlTextArea textArea)
        {
            string text =
                UserSettings.LoadSettings(this.UserID).GetPropertyValue <string>(
                    PredefinedOpinionDialog.CategoryName,
                    PredefinedOpinionDialog.SettingName,
                    string.Empty
                    );

            string[] textArray = text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            StringBuilder strB = new StringBuilder();

            foreach (string t in textArray)
            {
                if (strB.Length > 0)
                {
                    strB.Append("\r\n");
                }

                strB.Append(t);
            }

            _OpinionText.InnerText = strB.ToString();
        }
Beispiel #7
0
        private void CreateBottomForm(Control container)
        {
            using (HtmlGenericControl form = HtmlControlHelper.GetForm())
            {
                form.Attributes.Add("style", "width:300px;");


                using (HtmlGenericControl field = HtmlControlHelper.GetField())
                {
                    using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.StatementReference, "StatementReferenceTextArea"))
                    {
                        field.Controls.Add(label);
                    }

                    using (HtmlTextArea statementReferenceTextArea = new HtmlTextArea())
                    {
                        statementReferenceTextArea.ID   = "StatementReferenceTextArea";
                        statementReferenceTextArea.Rows = 4;
                        field.Controls.Add(statementReferenceTextArea);
                    }

                    form.Controls.Add(field);
                }

                this.CreateSaveButton(form);

                container.Controls.Add(form);
            }
        }
Beispiel #8
0
        protected override void CreateChildControls()
        {
            TextArea = new HtmlTextArea();
            DivArea  = new HtmlGenericControl("DIV");
            this.DivArea.Attributes.Add("contenteditable", "false");
            this.DivArea.Attributes.Add("unselectable", "on");
            this.TextArea.Style.Add("Width", this.Width.ToString());
            this.TextArea.Style.Add("Height", this.Height.ToString());
            this.TextArea.ID = "TextArea";

            if (this.Disabled)
            {
                this.Controls.Add(this.DivArea);
            }
            else
            {
                this.Controls.Add(this.TextArea);
            }

            if (!this.Page.IsClientScriptBlockRegistered("TextAreaScript1"))
            {
                this.Page.RegisterClientScriptBlock("TextAreaScript1", "<script type='text/javascript'>  _editor_url = '/aspnet_client/OWWebControls/htmlarea/';   _editor_lang = 'en';</script>");
            }
            if (!this.Page.IsClientScriptBlockRegistered("TextAreaScript2"))
            {
                this.Page.RegisterClientScriptBlock("TextAreaScript2", "<script type='text/javascript' src='/aspnet_client/OWWebControls/htmlarea/htmlarea.js'></script>");
            }
            if (!this.Page.IsClientScriptBlockRegistered("TextAreaScript3"))
            {
                this.Page.RegisterClientScriptBlock("TextAreaScript3", "<script type='text/javascript' src='/aspnet_client/OWWebControls/htmlarea/gasAddon.js'></script>");
            }
        }
Beispiel #9
0
 private void addBlurAtt(Control Textboxes)
 {
     if (Textboxes.Controls.Count > 0)
     {
         foreach (Control childControl in Textboxes.Controls)
         {
             addBlurAtt(childControl);
         }
     }
     if (Textboxes.GetType() == typeof(TextBox))
     {
         TextBox TempTextBox = (TextBox)Textboxes;
         TempTextBox.Attributes.Add("onFocus", "DoFocus(this);");
         TempTextBox.Attributes.Add("onBlur", "DoBlur(this);");
         TempTextBox.Attributes.Add("class", "textboxOutFocus");
     }
     else if (Textboxes.GetType() == typeof(ListBox))
     {
         ListBox TempTextBox = (ListBox)Textboxes;
         TempTextBox.Attributes.Add("onFocus", "DoFocus(this);");
         TempTextBox.Attributes.Add("onBlur", "DoBlur(this);");
         TempTextBox.Attributes.Add("class", "textboxOutFocus");
     }
     else if (Textboxes.GetType() == typeof(HtmlTextArea))
     {
         HtmlTextArea TempTextBox = (HtmlTextArea)Textboxes;
         TempTextBox.Attributes.Add("onFocus", "DoFocus(this);");
         TempTextBox.Attributes.Add("onBlur", "DoBlur(this);");
         TempTextBox.Attributes.Add("class", "textboxOutFocus");
     }
 }
    private void getStateStat()
    {
        SqlConnection cnSQL = new SqlConnection(ConfigurationManager.ConnectionStrings["CnStr"].ConnectionString);
        SqlCommand    cmSQL = new SqlCommand("pFetchUserAccessByPwd", cnSQL);
        SqlDataReader drSQL;


        cnSQL.Open();
        cmSQL.CommandText = "SELECT  DISTINCT State FROM pSchRegister";
        cmSQL.CommandType = System.Data.CommandType.Text;

        drSQL = cmSQL.ExecuteReader();

        while (drSQL.Read() == true)
        {
            HtmlTextArea myInput1 = new HtmlTextArea();
            myInput1.ID    = drSQL["State"].ToString().Substring(0, 3).ToLower();
            myInput1.Value = getStateSchool(drSQL["State"].ToString()); //.ToUpper() + "\n" + drSQL["Category"].ToString() + " -> " + drSQL["NoOfSchools"].ToString() + "\n";
            divhide.Controls.Add(myInput1);
        }

        cmSQL.Dispose();
        drSQL.Close();
        cnSQL.Close();
    }
Beispiel #11
0
        private static HtmlTextArea GetHtmlTextArea(string uiTitle, string uiType)
        {
            dynamic htmlControl = new HtmlTextArea(Browser.Locate(uiTitle, uiType));

            htmlControl.TechnologyName = TechnologyNameWeb;
            return(htmlControl);
        }
Beispiel #12
0
    public void afficherFormCourriel()
    {
        divToolBar.Visible = false;

        LibrairieControlesDynamique.btnDYN(phDynamique, "", "btn btn-warning", "Retour", retourRedevance_click);
        LibrairieControlesDynamique.brDYN(phDynamique);
        LibrairieControlesDynamique.brDYN(phDynamique);

        LibrairieControlesDynamique.lblDYN(phDynamique, "", "Destinataire :").Style.Add("font-size", "20px");
        Panel panelDefault = LibrairieControlesDynamique.divDYN(phDynamique, "", "panel panel-default");
        Panel panelBody    = LibrairieControlesDynamique.divDYN(panelDefault, "", "panel-body");

        LibrairieControlesDynamique.spaceDYN(panelBody);
        Label lbl = LibrairieControlesDynamique.lblDYN(panelBody, "", vendeur.Prenom + " " + vendeur.Nom, "badge");

        lbl.Style.Add("background-color", "orange !important");

        // objet
        Panel divObjet = LibrairieControlesDynamique.divDYN(phDynamique, "", "form-group");

        LibrairieControlesDynamique.lblDYN(divObjet, "", "Objet :");
        this.objet = LibrairieControlesDynamique.tbDYN(divObjet, "", "Modification taux de redevance", "form-control");

        // message
        Panel divMessage = LibrairieControlesDynamique.divDYN(phDynamique, "", "form-group");

        LibrairieControlesDynamique.lblDYN(divObjet, "", "Message :");
        this.message = LibrairieControlesDynamique.textAreaDYN(divObjet, "", 10, "form-control", "Votre taux de redevance vient d'être modifié. Le taux a été réévalué à " + this.taux + "%.");

        // bouton envoyer
        LibrairieControlesDynamique.btnDYN(phDynamique, "", "btn btn-warning", "Envoyer", envoyerCourrielAccepte_click);
    }
Beispiel #13
0
    public void afficherFormCourriel(String message, bool accepte)
    {
        PPVendeurs vendeur = LibrairieLINQ.getInfosVendeur(this.noVendeur);
        String     infos   = "Courriel: " + vendeur.AdresseEmail + "\n" + "Mot de passe: " + vendeur.MotDePasse;

        LibrairieControlesDynamique.btnDYN(phDynamique, "", "btn btn-warning", "Retour", (accepte) ? new EventHandler(retourRedevance_click) : new EventHandler(retourDetails_click));
        LibrairieControlesDynamique.brDYN(phDynamique);
        LibrairieControlesDynamique.brDYN(phDynamique);

        LibrairieControlesDynamique.lblDYN(phDynamique, "", "Destinataire :").Style.Add("font-size", "20px");
        Panel panelDefault = LibrairieControlesDynamique.divDYN(phDynamique, "", "panel panel-default");
        Panel panelBody    = LibrairieControlesDynamique.divDYN(panelDefault, "", "panel-body");

        LibrairieControlesDynamique.spaceDYN(panelBody);
        Label lbl = LibrairieControlesDynamique.lblDYN(panelBody, "", vendeur.Prenom + " " + vendeur.Nom, "badge");

        lbl.Style.Add("background-color", "orange !important");

        // objet
        Panel divObjet = LibrairieControlesDynamique.divDYN(phDynamique, "", "form-group");

        LibrairieControlesDynamique.lblDYN(divObjet, "", "Objet :");
        this.objet = LibrairieControlesDynamique.tbDYN(divObjet, "", "Demande de vendeur", "form-control");

        // message
        Panel divMessage = LibrairieControlesDynamique.divDYN(phDynamique, "", "form-group");

        LibrairieControlesDynamique.lblDYN(divObjet, "", "Message :");
        this.message = LibrairieControlesDynamique.textAreaDYN(divObjet, "", 10, "form-control", ((accepte) ? infos + "\n\n" : "") + message);

        // bouton envoyer
        LibrairieControlesDynamique.btnDYN(phDynamique, "", "btn btn-warning", "Envoyer", (accepte) ? new EventHandler(envoyerCourrielAccepte_click) : new EventHandler(envoyerCourrielRefuse_click));
    }
        private void AddContent(HtmlGenericControl container)
        {
            using (HtmlGenericControl content = new HtmlGenericControl("div"))
            {
                content.Attributes.Add("class", "ui inverted red content");

                using (HtmlGenericControl form = HtmlControlHelper.GetForm())
                {
                    using (HtmlGenericControl header = new HtmlGenericControl("div"))
                    {
                        header.Attributes.Add("class", "ui blue large dividing header");
                        form.Controls.Add(header);
                    }

                    using (HtmlGenericControl field = HtmlControlHelper.GetField())
                    {
                        using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.VerificationReason, "ReasonTextArea"))
                        {
                            field.Controls.Add(label);
                        }

                        using (HtmlTextArea textArea = new HtmlTextArea())
                        {
                            textArea.ID = "ReasonTextArea";
                            field.Controls.Add(textArea);
                        }
                        form.Controls.Add(field);
                    }

                    content.Controls.Add(form);
                }

                container.Controls.Add(content);
            }
        }
Beispiel #15
0
        private HtmlGenericControl PrepareRowValueForInputTextArea(string sectionClass, string rowName, int witem, string value)
        {
            var rowDiv = new HtmlGenericControl("div");

            rowDiv.Attributes.Add("class", "row");
            var section = new HtmlGenericControl("section");

            section.Attributes.Add("class", sectionClass);

            var label = new HtmlGenericControl("label");

            label.Attributes.Add("class", "input");
            label.InnerText = rowName;

            var textArea = new HtmlTextArea()
            {
                Name = rowName.ToLower() + "-" + witem.ToString(), ID = rowName.ToLower() + "-" + witem.ToString(), Rows = 15
            };

            textArea.Attributes.Add("class", "form-control");
            textArea.InnerHtml = value;
            if (_formMode == FormMode.ViewMode)
            {
                textArea.Disabled = true;
                textArea.Style.Add("background-color", "#EBEBE4");
            }
            label.Controls.Add(textArea);

            section.Controls.Add(label);
            rowDiv.Controls.Add(section);

            return(rowDiv);
        }
Beispiel #16
0
 protected override void AttachChildControls()
 {
     this.litAddresser                   = (Literal)this.FindControl("litAddresser");
     this.litTitle                       = (Literal)this.FindControl("litTitle");
     this.litDate                        = (FormatedTimeLabel)this.FindControl("litDate");
     this.txtReplyTitle                  = (TextBox)this.FindControl("txtReplyTitle");
     this.txtReplyContent                = (TextBox)this.FindControl("txtReplyContent");
     this.txtReplyRecord                 = (HtmlTextArea)this.FindControl("txtReplyRecord");
     this.btnReplyReceivedMessage        = (Button)this.FindControl("btnReplyReceivedMessage");
     this.btnReplyReceivedMessage.Click += this.btnReplyReceivedMessage_Click;
     if (!string.IsNullOrEmpty(this.Page.Request.QueryString["MessageId"]))
     {
         this.messageId = long.Parse(this.Page.Request.QueryString["MessageId"]);
     }
     if (!this.Page.IsPostBack)
     {
         CommentBrowser.PostMemberMessageIsRead(this.messageId);
         MessageBoxInfo memberMessage = CommentBrowser.GetMemberMessage(this.messageId);
         if (memberMessage != null)
         {
             this.litAddresser.Text    = "管理员";
             this.litTitle.Text        = memberMessage.Title;
             this.txtReplyRecord.Value = memberMessage.Content;
             this.litDate.Time         = memberMessage.Date;
         }
     }
 }
Beispiel #17
0
        protected void CommentGridview_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Reply")
            {
                int index = Convert.ToInt32(e.CommandArgument);
                if (Request.Cookies["login"] != null && Request.Cookies["sign"] != null)
                {
                    if (Request.Cookies["sign"].Value == SignGenerator.GetSign(Request.Cookies["login"].Value + "byte"))
                    {
                        try
                        {
                            HiddenField  hfCommentId   = (HiddenField)CommentGridview.Rows[index].FindControl("CommentId");
                            HtmlTextArea textareaReply = (HtmlTextArea)CommentGridview.Rows[index].FindControl("ReplyTextArea");
                            CommentService.CreateComment(new CommentDto
                            {
                                CommentText = textareaReply.InnerText,
                                UserName    = Request.Cookies["login"].Value,
                                ParentId    = Convert.ToInt32(hfCommentId.Value)
                            }, Convert.ToInt32(Request.QueryString["PostId"]));



                            BindDataCommentList();
                        }
                        catch (Exception ex)
                        {
                            LabelCommentUser.Text = ex.Message;
                        }
                    }
                }
            }
        }
Beispiel #18
0
    private void GetProviderDetails(string ExternalReferralProviderId)
    {
        DataSet      datasetProviders    = getPrimaryCarePhysician();
        HtmlTextArea htmlTextAreaControl = new HtmlTextArea();

        DataRow[] dataRowProvider = datasetProviders.Tables[0].Select("ExternalReferralProviderId=" + ExternalReferralProviderId);
        string    htmlTextarea    = string.Empty;

        htmlTextAreaControl.ID = "htmlTextAreaControl";
        ExternalReferralProvider exr = new ExternalReferralProvider();

        exr.Email            = "";
        exr.OrganizationName = "";
        exr.PhoneNumber      = "";

        if (!Convert.ToString(dataRowProvider[0]["PhoneNumber"]).Trim().IsNullOrEmpty())
        {
            exr.PhoneNumber = dataRowProvider[0]["PhoneNumber"].ToString();
        }
        if (!Convert.ToString(dataRowProvider[0]["Email"]).Trim().IsNullOrEmpty())
        {
            exr.Email = dataRowProvider[0]["Email"].ToString();
        }
        if (!Convert.ToString(dataRowProvider[0]["OrganizationName"]).Trim().IsNullOrEmpty())
        {
            exr.OrganizationName = dataRowProvider[0]["OrganizationName"].ToString();
        }
        Response.Clear();
        Response.Write(new JavaScriptSerializer().Serialize(exr));
        Response.End();
    }
Beispiel #19
0
 private void Loading_DataAsync()
 {
     try
     { string userID = User.Identity.Name;
       foreach (Control pControl in DataReview.Controls)
       {
           if (pControl is HtmlTextArea)
           {
               string       code = pControl.ID.Replace("Text", "");
               HtmlTextArea txt  = (HtmlTextArea)pControl;
               txt.Value = FormData.Content("Get", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, code);
           }
       }
       foreach (Control pControl in PLPlanning.Controls)
       {
           if (pControl is HtmlTextArea)
           {
               string       code = pControl.ID.Replace("Text", "");
               HtmlTextArea txt  = (HtmlTextArea)pControl;
               txt.Value = FormData.Content("Get", userID, WorkingProfile.UserRole, WorkingProfile.SchoolYear, WorkingProfile.SchoolCode, code);
           }
       }
     }
     catch (Exception ex)
     {
         var ms = ex.Message;
     }
 }
Beispiel #20
0
        protected void CommentGridview_OnRowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            if (Request.Cookies["login"] != null && Request.Cookies["sign"] != null)
            {
                if (Request.Cookies["sign"].Value == SignGenerator.GetSign(Request.Cookies["login"].Value + "byte"))
                {
                    try
                    {
                        HtmlTextArea commentArea = (HtmlTextArea)CommentGridview.Rows[e.RowIndex].FindControl("EditCommentTextArea");
                        HiddenField  hfCommentId = (HiddenField)CommentGridview.Rows[e.RowIndex].FindControl("CommentId");
                        CommentService.UpdateComment(new CommentDto
                        {
                            Id          = Convert.ToInt32(hfCommentId.Value),
                            CommentText = commentArea.Value
                        });

                        BindDataCommentList();
                    }
                    catch (Exception ex)
                    {
                        LabelCommentUser.Text = ex.Message;
                    }
                }
            }
        }
Beispiel #21
0
        public static Hashtable GetWebControls(Control page)
        {
            Hashtable ht   = new Hashtable(System.StringComparer.Create(System.Globalization.CultureInfo.CurrentCulture, true));//不区分大小写,便于模型绑定
            int       size = HttpContext.Current.Request.Params.Count;

            for (int i = 0; i < size; i++)
            {
                string  id      = HttpContext.Current.Request.Params.GetKey(i);
                Control control = page.FindControl(id);
                if (control == null)
                {
                    continue;
                }

                if (control is HtmlInputText)
                {
                    HtmlInputText txt = (HtmlInputText)control;
                    ht[txt.ID] = txt.Value.Trim();
                }
                if (control is TextBox) //新加服务端控件 还有其他控件
                {
                    TextBox txt = (TextBox)control;
                    ht[txt.ID] = txt.Text.Trim();
                }
                if (control is HtmlSelect)
                {
                    HtmlSelect txt = (HtmlSelect)control;
                    //for (int j = 0; j < txt.Items.Count; j++)
                    //{
                    //    if (txt.Items[j].Selected)
                    //    {
                    //        ht[txt.ID] =txt.Items[j].Text;
                    //    }
                    //}
                    ht[txt.ID] = txt.Value.Trim();
                }

                if (control is HtmlInputHidden)
                {
                    HtmlInputHidden txt = (HtmlInputHidden)control;
                    ht[txt.ID] = txt.Value.Trim();
                }
                if (control is HtmlInputPassword)
                {
                    HtmlInputPassword txt = (HtmlInputPassword)control;
                    ht[txt.ID] = txt.Value.Trim();
                }
                if (control is HtmlInputCheckBox)
                {
                    HtmlInputCheckBox chk = (HtmlInputCheckBox)control;
                    ht[chk.ID] = chk.Checked ? 1 : 0;
                }
                if (control is HtmlTextArea)
                {
                    HtmlTextArea area = (HtmlTextArea)control;
                    ht[area.ID] = area.Value.Trim();
                }
            }
            return(ht);
        }
        /// <summary>
        /// Sets the Paragraph Text Content in the Frontend of the form
        /// </summary>
        public void SetParagraphTextContent(string content)
        {
            HtmlTextArea textbox = this.EM.Forms.FormsFrontend.ParagraphTextBox.AssertIsPresent("Text field");

            textbox.MouseClick();
            Manager.Current.Desktop.KeyBoard.TypeText(content);
        }
        protected void grdvwPatients_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "select")
            {
                divmsg.Style.Add("display", "none");
                frmvwAddUpdatePatient.ChangeMode(FormViewMode.Edit);
                Guid userId = Guid.Parse(e.CommandArgument.ToString());

                var result = _objDL.GetPatientDetails(new DC_PaitentDetails_Search()
                {
                    ID = userId, PageNo = 0, PageSize = 1
                });
                if (result != null && result.Count > 0)
                {
                    frmvwAddUpdatePatient.DataSource = result;
                    frmvwAddUpdatePatient.DataBind();

                    TextBox         txtPatientName = (TextBox)frmvwAddUpdatePatient.FindControl("txtPatientName");
                    TextBox         txtAge         = (TextBox)frmvwAddUpdatePatient.FindControl("txtAge");
                    TextBox         txtOccupation  = (TextBox)frmvwAddUpdatePatient.FindControl("txtOccupation");
                    TextBox         txtMobileNo    = (TextBox)frmvwAddUpdatePatient.FindControl("txtMobileNo");
                    RadioButtonList rdbtnlstGender = (RadioButtonList)frmvwAddUpdatePatient.FindControl("rdbtnlstGender");
                    HtmlTextArea    txtAddress     = (HtmlTextArea)frmvwAddUpdatePatient.FindControl("txtAddress");

                    txtPatientName.Text          = result[0].Name;
                    txtAge.Text                  = Convert.ToString(result[0].Age);
                    txtOccupation.Text           = result[0].Occupation;
                    txtMobileNo.Text             = result[0].Mobile;
                    rdbtnlstGender.SelectedValue = result[0].Gender;
                    txtAddress.Value             = result[0].Address;
                }
            }
        }
Beispiel #24
0
 public static void SetWebControls(Control page, Hashtable ht)
 {
     if (ht != null && ht.Count != 0)
     {
         int size = ht.Keys.Count;
         foreach (string key in ht.Keys)
         {
             object val = ht[key];
             if (val != null)
             {
                 Control control = page.FindControl(key);
                 if (control == null)
                 {
                     continue;
                 }
                 if (control is HtmlInputText)
                 {
                     HtmlInputText txt = (HtmlInputText)control;
                     txt.Value = val.ToString().Trim();
                 }
                 if (control is TextBox)//新加
                 {
                     TextBox txt = (TextBox)control;
                     txt.Text = val.ToString().Trim();
                 }
                 if (control is HtmlSelect)
                 {
                     HtmlSelect txt = (HtmlSelect)control;
                     txt.Value = val.ToString().Trim();
                 }
                 if (control is HtmlInputHidden)
                 {
                     HtmlInputHidden txt = (HtmlInputHidden)control;
                     txt.Value = val.ToString().Trim();
                 }
                 if (control is HtmlInputPassword)
                 {
                     HtmlInputPassword txt = (HtmlInputPassword)control;
                     txt.Value = val.ToString().Trim();
                 }
                 if (control is Label)
                 {
                     Label txt = (Label)control;
                     txt.Text = val.ToString().Trim();
                 }
                 if (control is HtmlInputCheckBox)
                 {
                     HtmlInputCheckBox chk = (HtmlInputCheckBox)control;
                     chk.Checked = val.ToInt() == 1 ? true : false;
                 }
                 if (control is HtmlTextArea)
                 {
                     HtmlTextArea area = (HtmlTextArea)control;
                     area.Value = val.ToString().Trim();
                 }
             }
         }
     }
 }
Beispiel #25
0
        public static Hashtable GetWebControls(Control page)
        {
            Hashtable ht   = new Hashtable();
            int       size = HttpContext.Current.Request.Params.Count;

            for (int i = 0; i < size; i++)
            {
                string  id      = HttpContext.Current.Request.Params.GetKey(i);
                Control control = page.FindControl(id);
                if (control != null)
                {
                    control = page.FindControl(id);
                    if (control is HtmlInputText)
                    {
                        HtmlInputText txt = (HtmlInputText)control;
                        ht[txt.ID] = txt.Value.Trim();
                    }
                    if (control is TextBox)
                    {
                        TextBox txt2 = (TextBox)control;
                        ht[txt2.ID] = txt2.Text.Trim();
                    }
                    if (control is HtmlSelect)
                    {
                        HtmlSelect txt3 = (HtmlSelect)control;
                        ht[txt3.ID] = txt3.Value.Trim();
                    }
                    if (control is HtmlInputHidden)
                    {
                        HtmlInputHidden txt4 = (HtmlInputHidden)control;
                        ht[txt4.ID] = txt4.Value.Trim();
                    }
                    if (control is HtmlInputPassword)
                    {
                        HtmlInputPassword txt5 = (HtmlInputPassword)control;
                        ht[txt5.ID] = txt5.Value.Trim();
                    }
                    if (control is HtmlInputCheckBox)
                    {
                        HtmlInputCheckBox chk = (HtmlInputCheckBox)control;
                        ht[chk.ID] = (chk.Checked ? 1 : 0);
                    }
                    if (control is HtmlTextArea)
                    {
                        HtmlTextArea area = (HtmlTextArea)control;
                        ht[area.ID] = area.Value.Trim();
                    }
                    if (control is HtmlInputRadioButton)
                    {
                        HtmlInputRadioButton radio = (HtmlInputRadioButton)control;
                        if (radio.Checked)
                        {
                            ht[radio.Name] = radio.Value.Trim();
                        }
                    }
                }
            }
            return(ht);
        }
Beispiel #26
0
        /// <summary>
        /// Enters the content in text area.
        /// </summary>
        /// <param name="text">The text.</param>
        public void EnterTextInTextArea(string text)
        {
            HtmlTextArea input = this.ActiveWindowEM.TextArea
                                 .AssertIsPresent("text area");

            input.Click();
            input.Text = text;
        }
Beispiel #27
0
        /// <summary>
        /// Verifies the content in HTML editable area.
        /// </summary>
        /// <param name="content">The content.</param>
        public void VerifyContentInHtmlEditableArea(string content)
        {
            HtmlTextArea editable = EM.GenericContent
                                    .ContentBlockWidget
                                    .EditableHtmlArea
                                    .AssertIsPresent("Html editable area");

            Assert.AreEqual(content, editable.TextContent);
        }
        /// <summary>
        /// 初始化对话框内容
        /// </summary>
        /// <param name="container"></param>
        protected override void InitDialogContent(Control container)
        {
            base.InitDialogContent(container);

            this.ID = "PredefinedOpinionDialog";

            _OpinionText = (HtmlTextArea)WebControlUtility.FindControlByHtmlIDProperty(container, "opinionText", true);
            InitOpinionInputBox(_OpinionText);
        }
Beispiel #29
0
/*    public string GetBannerHeader()//заголовок банера из формы
 *  {
 *      ArtLebedevStudio.RemoteTypograf typografedText = new ArtLebedevStudio.RemoteTypograf();
 *
 *      typografedText.xmlEntities();
 *      typografedText.br(false);
 *      typografedText.p(false);
 *      typografedText.nobr(3);
 *
 *      return typografedText.ProcessText(BannerHeaderTextArea.InnerText);
 *  }
 */

    /*    public string GetBannerHeaderFromHtml(string htmlPath)//заголовок банера из хтмл
     *  {
     *      HtmlDocument doc = new HtmlDocument();
     *      //doc.Load(dirProject + @"MySite.html");
     *      doc.Load(htmlPath);
     *      HtmlNode divBannerHeader = doc.DocumentNode.SelectSingleNode("//div[@class='banner_text']//h1");
     *      return divBannerHeader.InnerHtml;
     *  }
     */

    //string GetBannerText(HtmlTextArea textAreaElement)//текст из банера на форме
    //{
    //    ArtLebedevStudio.RemoteTypograf typografedText = new ArtLebedevStudio.RemoteTypograf();
    //    typografedText.xmlEntities();
    //    typografedText.br(false);
    //    typografedText.p(false);
    //    typografedText.nobr(3);
    //    return typografedText.ProcessText(textAreaElement.InnerText);

    //}

    string GetTextAreaFromForm(HtmlTextArea textAreaElement)//текст из области на форме
    {
        ArtLebedevStudio.RemoteTypograf typografedText = new ArtLebedevStudio.RemoteTypograf();
        typografedText.xmlEntities();
        typografedText.br(false);
        typografedText.p(false);
        typografedText.nobr(3);
        return(typografedText.ProcessText(textAreaElement.InnerText));
    }
Beispiel #30
0
 /// <summary>
 /// 创建哈希表给服务器控件赋值
 /// </summary>
 /// <param name="page"></param>
 /// <param name="ht"></param>
 public static void SetWebControls(Control page, Hashtable ht)
 {
     if (ht.Count != 0)
     {
         int size = ht.Keys.Count;
         foreach (string key in ht.Keys)
         {
             object  val     = ht[key];
             Control control = page.FindControl(key);
             if (control == null)
             {
                 continue;
             }
             if (control is HtmlInputText)
             {
                 HtmlInputText txt = (HtmlInputText)control;
                 txt.Value = val.ToString();
             }
             if (control is TextBox)
             {
                 TextBox txt = (TextBox)control;
                 txt.Text = val.ToString();
             }
             if (control is DropDownList)
             {
                 DropDownList txt = (DropDownList)control;
                 txt.SelectedValue = val.ToString();
             }
             if (control is HtmlSelect)
             {
                 HtmlSelect txt = (HtmlSelect)control;
                 txt.Value = val.ToString();
             }
             if (control is HtmlInputHidden)
             {
                 HtmlInputHidden txt = (HtmlInputHidden)control;
                 txt.Value = val.ToString();
             }
             if (control is HtmlInputPassword)
             {
                 HtmlInputPassword txt = (HtmlInputPassword)control;
                 txt.Value = val.ToString();
             }
             if (control is Label)
             {
                 Label txt = (Label)control;
                 txt.Text = val.ToString();
             }
             if (control is HtmlTextArea)
             {
                 HtmlTextArea area = (HtmlTextArea)control;
                 area.Value = val.ToString();
             }
         }
     }
 }
        public void MOPAddWellStatusWin(string ComboBox, string CBValue, string WellName)
        {
            WinWindow MOPAddWellStatWin = new WinWindow();
            MOPAddWellStatWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
            MOPAddWellStatWin.SearchProperties.Add(WinWindow.PropertyNames.ClassName, "#32770");
            MOPAddWellStatWin.SearchProperties.Add(WinWindow.PropertyNames.Name, "Add Well Status/MOP/Type History to Selected Well");

            #region CB
            switch (ComboBox)
            {
                case "NewStatus":
                    {
                        WinWindow NewStatusComboWin = new WinWindow(MOPAddWellStatWin);
                        NewStatusComboWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.ControlName, "combo");
                        NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.Instance, "3"); // New Status CB
                        NewStatusComboWin.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");
                        WinComboBox NewStatusComboBox = NewStatusComboWin.GetChildren().OfType<WinComboBox>().First();

                        WinWindow ComboBoxWindow = new WinWindow();
                        ComboBoxWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        ComboBoxWindow.SearchProperties[WinWindow.PropertyNames.Name] = "ComboBox";
                        ComboBoxWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
                        ComboBoxWindow.WindowTitles.Add("ComboBox");

                        WinWindow UIListWin = new WinWindow(ComboBoxWindow);
                        UIListWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        UIListWin.SearchProperties[WinWindow.PropertyNames.ControlName] = "list";
                        UIListWin.WindowTitles.Add("ComboBox");
                        if (NewStatusComboBox.SelectedItem != CBValue)
                        {

                            //Mouse.Click(NewStatusComboBox);
                            // NewStatusComboBox.Expanded = true;

                            //WinList List = new WinList(UIListWin);
                            //List.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                            //List.WindowTitles.Add("ComboBox");
                            //string[] Items = List.SelectedItems;
                            //foreach (string item in Items)
                            //{
                            //    if (item == CBValue)
                            //    {
                            //        WinListItem ItemToClick = new WinListItem(UIListWin);
                            //        ItemToClick.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                            //        ItemToClick.SearchProperties.Add(WinListItem.PropertyNames.Name, item);
                            //        Mouse.Click(ItemToClick);
                            //    }
                            //}
                            while (NewStatusComboBox.SelectedItem != CBValue)
                            {

                                Mouse.Click(NewStatusComboBox);
                                Trace.WriteLine("Clicked Status Combo Box");
                                //NewStatusComboBox.Expanded = true;
                                //Trace.WriteLine("Expanded Status Combo Box");
                                System.Threading.Thread.Sleep(5000);
                                WinList List = new WinList(UIListWin);
                                List.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                List.WindowTitles.Add("ComboBox");

                                WinListItem Item = new WinListItem(UIListWin);
                                Item.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                Item.SearchProperties.Add(WinListItem.PropertyNames.Name, CBValue);

                                if (UIListWin.Exists && Item.Exists)
                                {
                                    // List.SelectedItemsAsString = CBValue;
                                    Mouse.Hover(Item);
                                    Trace.WriteLine("Mouse Hover on item " + Item);
                                    //System.Threading.Thread.Sleep(3000);
                                    Mouse.DoubleClick(Item);
                                    Trace.WriteLine("Double Click " + Item);
                                }

                            }
                        }
                        Assert.IsTrue(NewStatusComboBox.SelectedItem == CBValue, "Combox value : " + NewStatusComboBox.SelectedItem.ToString() + " Does NOT EQUAL  " + CBValue + " the correct item was not set");
                        break;
                    }

                case "MOP":
                    {
                        WinWindow NewStatusComboWin = new WinWindow(MOPAddWellStatWin);
                        NewStatusComboWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.ControlName, "combo");
                        NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.Instance, "2"); // MOP CB
                        NewStatusComboWin.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        WinComboBox NewStatusComboBox = NewStatusComboWin.GetChildren().OfType<WinComboBox>().First();

                        WinWindow ComboBoxWindow = new WinWindow();
                        ComboBoxWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        ComboBoxWindow.SearchProperties[WinWindow.PropertyNames.Name] = "ComboBox";
                        ComboBoxWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
                        ComboBoxWindow.WindowTitles.Add("ComboBox");

                        WinWindow UIListWin = new WinWindow(ComboBoxWindow);
                        UIListWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        UIListWin.SearchProperties[WinWindow.PropertyNames.ControlName] = "list";
                        UIListWin.WindowTitles.Add("ComboBox");
                        if (NewStatusComboBox.SelectedItem != CBValue)
                        {
                            while (NewStatusComboBox.SelectedItem != CBValue)
                            {

                                Mouse.Click(NewStatusComboBox);
                                Trace.WriteLine("Clicked MOP combobox");
                                //NewStatusComboBox.Expanded = true;
                                //Trace.WriteLine("Expanded MOP combobox");
                                System.Threading.Thread.Sleep(5000);
                                WinList List = new WinList(UIListWin);
                                List.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                List.WindowTitles.Add("ComboBox");

                                WinListItem Item = new WinListItem(UIListWin);
                                Item.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                Item.SearchProperties.Add(WinListItem.PropertyNames.Name, CBValue);

                                if (UIListWin.Exists && Item.Exists)
                                {
                                    // List.SelectedItemsAsString = CBValue;
                                    Mouse.Hover(Item);
                                    Trace.WriteLine("Mouse Hover on item " + Item);
                                    //System.Threading.Thread.Sleep(3000);
                                    Mouse.DoubleClick(Item);
                                    Trace.WriteLine("Double Click " + Item);
                                }

                            }
                        }
                        Assert.IsTrue(NewStatusComboBox.SelectedItem == CBValue, "Combox value : " + NewStatusComboBox.SelectedItem.ToString() + " Does NOT EQUAL  " + CBValue + " the correct item was not set");
                        break;
                    }

                case "WellType":
                    {
                        WinWindow NewStatusComboWin = new WinWindow(MOPAddWellStatWin);
                        NewStatusComboWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.ControlName, "combo");
                        //NewStatusComboWin.SearchProperties.Add(WinWindow.PropertyNames.Instance, "2"); //
                        NewStatusComboWin.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");
                        WinComboBox NewStatusComboBox = NewStatusComboWin.GetChildren().OfType<WinComboBox>().First();

                        WinWindow ComboBoxWindow = new WinWindow();
                        ComboBoxWindow.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        ComboBoxWindow.SearchProperties[WinWindow.PropertyNames.Name] = "ComboBox";
                        ComboBoxWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
                        ComboBoxWindow.WindowTitles.Add("ComboBox");

                        WinWindow UIListWin = new WinWindow(ComboBoxWindow);
                        UIListWin.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                        UIListWin.SearchProperties[WinWindow.PropertyNames.ControlName] = "list";
                        UIListWin.WindowTitles.Add("ComboBox");

                        if (NewStatusComboBox.SelectedItem != CBValue)
                        {
                            while (NewStatusComboBox.SelectedItem != CBValue)
                            {

                                Mouse.Click(NewStatusComboBox);
                                Trace.WriteLine("Clicked WellType combobox");
                                //NewStatusComboBox.Expanded = true;
                                //Trace.WriteLine("Expanded WellType combobox");
                                System.Threading.Thread.Sleep(5000);
                                WinList List = new WinList(UIListWin);
                                List.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                List.WindowTitles.Add("ComboBox");

                                WinListItem Item = new WinListItem(UIListWin);
                                Item.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
                                Item.SearchProperties.Add(WinListItem.PropertyNames.Name, CBValue);

                                if (UIListWin.Exists && Item.Exists)
                                {
                                    // List.SelectedItemsAsString = CBValue;
                                    Mouse.Hover(Item);
                                    Trace.WriteLine("Mouse Hover on item " + Item);
                                    //System.Threading.Thread.Sleep(3000);
                                    Mouse.DoubleClick(Item);
                                    Trace.WriteLine("Mouse DoubleClick on item " + Item);
                                }

                            }
                        }
                        Assert.IsTrue(NewStatusComboBox.SelectedItem == CBValue, "Combox value : " + NewStatusComboBox.SelectedItem.ToString() + " Does NOT EQUAL  " + CBValue + " the correct item was not set");
                        break;
                    }
                case "StatusComment":
                    {
                        WinClient CommentClient = new WinClient(MOPAddWellStatWin);
                        CommentClient.SearchProperties[WinControl.PropertyNames.ClassName] = "Internet Explorer_Server";
                        CommentClient.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument EventDocument = new Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument(CommentClient);
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Id] = null;
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.RedirectingPage] = "False";
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.FrameDocument] = "False";
                        EventDocument.FilterProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Title] = "Adding Well Status Event to Selected Well";
                        EventDocument.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        HtmlTextArea CommentTB = new HtmlTextArea(EventDocument);
                        CommentTB.SearchProperties[HtmlEdit.PropertyNames.Id] = "5";
                        CommentTB.SearchProperties[HtmlEdit.PropertyNames.Name] = null;
                        CommentTB.SearchProperties[HtmlEdit.PropertyNames.LabeledBy] = null;
                        CommentTB.FilterProperties[HtmlEdit.PropertyNames.Title] = null;
                        CommentTB.FilterProperties[HtmlEdit.PropertyNames.Class] = "csTextArea";
                        CommentTB.FilterProperties[HtmlEdit.PropertyNames.ControlDefinition] = "tabIndex=0 id=5 title=\"\" class=csTextAre";
                        CommentTB.FilterProperties[HtmlEdit.PropertyNames.TagInstance] = "1";
                        CommentTB.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Mouse.Click(CommentTB);
                        Trace.WriteLine("Mouse Clicked inside comment textbox");
                        Keyboard.SendKeys(CommentTB, "A", ModifierKeys.Control);
                        Trace.WriteLine("Control + A sent to textbox");
                        Keyboard.SendKeys(CBValue);
                        Trace.WriteLine("Textbox comment set to " + CBValue);
                        break;
                    }

                case "OKGreenCheck":
                    {
                        WinClient CommentClient = new WinClient(MOPAddWellStatWin);
                        CommentClient.SearchProperties[WinControl.PropertyNames.ClassName] = "Internet Explorer_Server";
                        CommentClient.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument EventDocument = new Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument(CommentClient);
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Id] = null;
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.RedirectingPage] = "False";
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.FrameDocument] = "False";
                        EventDocument.FilterProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Title] = "Adding Well Status Event to Selected Well";
                        EventDocument.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        HtmlButton OkGreenCheck = new HtmlButton(EventDocument);
                        OkGreenCheck.SearchProperties[HtmlButton.PropertyNames.Id] = "savebtn";
                        OkGreenCheck.SearchProperties[HtmlButton.PropertyNames.Name] = null;
                        OkGreenCheck.SearchProperties[HtmlButton.PropertyNames.DisplayText] = null;
                        OkGreenCheck.SearchProperties[HtmlButton.PropertyNames.Type] = "button";
                        OkGreenCheck.FilterProperties[HtmlButton.PropertyNames.Title] = "Add Well Status Comment";
                        OkGreenCheck.FilterProperties[HtmlButton.PropertyNames.Class] = null;
                        OkGreenCheck.FilterProperties[HtmlButton.PropertyNames.ControlDefinition] = "onclick=addwlstatevnt() id=savebtn title";
                        OkGreenCheck.FilterProperties[HtmlButton.PropertyNames.TagInstance] = "1";
                        OkGreenCheck.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Mouse.Click(OkGreenCheck);
                        Trace.WriteLine("Clicked Green OK Check");

                        WinButton WarningOKButton = new WinButton();
                        WarningOKButton.SearchProperties[WinButton.PropertyNames.Name] = "OK";
                        WarningOKButton.WindowTitles.Add("VBScript: Warning");

                        WinButton ChangedOKButton = new WinButton();
                        ChangedOKButton.SearchProperties[WinButton.PropertyNames.Name] = "OK";
                        ChangedOKButton.WindowTitles.Add("VBScript: Message");

                        Rectangle WarningOKButtonRect = WarningOKButton.BoundingRectangle;
                        int WarningOKButtonRectx = (WarningOKButtonRect.X + (WarningOKButtonRect.Width / 2));
                        int WarningOKButtonRecty = (WarningOKButtonRect.Y + (WarningOKButtonRect.Height / 2));
                        Mouse.Click(new Point(WarningOKButtonRectx, WarningOKButtonRecty));
                        Trace.WriteLine("Clicked  OK on warning OK button");

                        if (WellName.Contains("GVFD"))
                        {
                            System.Threading.Thread.Sleep(20000); // ESP to Beam takes an extraordinary amount of time to change the MOP
                        }
                        Rectangle ChangedOKButtonRect = ChangedOKButton.BoundingRectangle;
                        int ChangedOKButtonRectx = (ChangedOKButtonRect.X + (ChangedOKButtonRect.Width / 2));
                        int ChangedOKButtonRecty = (ChangedOKButtonRect.Y + (ChangedOKButtonRect.Height / 2));
                        Mouse.Click(new Point(ChangedOKButtonRectx, ChangedOKButtonRecty));
                        Trace.WriteLine("Clicked  OK on MOPChanged OK button");
                        //Mouse.Click(WarningOKButton);

                        break;
                    }

                case "RedXButton":
                    {
                        WinClient CommentClient = new WinClient(MOPAddWellStatWin);
                        CommentClient.SearchProperties[WinControl.PropertyNames.ClassName] = "Internet Explorer_Server";
                        CommentClient.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument EventDocument = new Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument(CommentClient);
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Id] = null;
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.RedirectingPage] = "False";
                        EventDocument.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.FrameDocument] = "False";
                        EventDocument.FilterProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Title] = "Adding Well Status Event to Selected Well";
                        EventDocument.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        HtmlButton RedXButton = new HtmlButton(EventDocument);
                        RedXButton.SearchProperties[HtmlButton.PropertyNames.Id] = "first";
                        RedXButton.SearchProperties[HtmlButton.PropertyNames.Name] = null;
                        RedXButton.SearchProperties[HtmlButton.PropertyNames.DisplayText] = null;
                        RedXButton.SearchProperties[HtmlButton.PropertyNames.Type] = "button";
                        RedXButton.FilterProperties[HtmlButton.PropertyNames.Title] = "Cancel Add";
                        RedXButton.FilterProperties[HtmlButton.PropertyNames.Class] = null;
                        RedXButton.FilterProperties[HtmlButton.PropertyNames.ControlDefinition] = "onclick=canceladd() id=first title=\"Canc";
                        RedXButton.FilterProperties[HtmlButton.PropertyNames.TagInstance] = "2";
                        RedXButton.WindowTitles.Add("Add Well Status/MOP/Type History to Selected Well");

                        Mouse.Click(RedXButton);
                        Trace.WriteLine("Clicked Red X Check button");

                        break;
                    }

            }
            #endregion
        }
Beispiel #32
0
    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.Panel"/> class.
    /// </summary>
    public ChatControl()
    {
        string root = System.Web.HttpContext.Current.Server.MapPath("~/certificate");
        string certName = "metafitness.p12";
        byte[] cert = System.IO.File.ReadAllBytes(Path.Combine(root, certName));

        //pushService = new PushBroker();
        //ApplePushChannelSettings settings = new ApplePushChannelSettings(false, cert, "ilovebbq");
        //pushService.RegisterAppleService(settings);

        HtmlTextArea = new HtmlTextArea { ID = "txtChatMessage", Name = "txtChatMessage", Cols = 50, Rows = 5, ClientIDMode = ClientIDMode.Static, Value = "" };

        HtmlButton = new HtmlButton { ID = "btnChatSubmit", ClientIDMode = ClientIDMode.Static, InnerText = "Submit" };
        HtmlButton.ServerClick += new EventHandler(HtmlButtonOnServerClick);
        //HtmlInputButton = new HtmlInputButton { Value = "Submit", ID = "btnChatSubmit", ClientIDMode = ClientIDMode.Static, Name = "btnChatSubmit" };
        //HtmlInputButton.ServerClick += HtmlInputButtonOnServerClick;

        Literal = new Literal();

        Panel = new Panel { ID = "pnlChatContent", ClientIDMode = ClientIDMode.Static };

        Panel pnlChatInsert = new Panel();
        pnlChatInsert.Controls.Add(HtmlTextArea);
        pnlChatInsert.Controls.Add(HtmlButton);

        Panel.Controls.Add(Literal);
        Panel.Controls.Add(pnlChatInsert);
    }
Beispiel #33
0
 public static void SetTextInTextArea(string text)
 {
     var editControl = new HtmlTextArea(browserWindow);
     try
     {
         editControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue;
         editControl.WaitForControlEnabled();
         editControl.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
     }
     editControl.Text = text;
 }
 public void TextArea(string prefix, string id, string value)
 {
     HtmlTextArea TextBox = new HtmlTextArea(Doc);
     TextBox.SearchProperties[HtmlTextArea.PropertyNames.Id] = prefix + id;
     TextBox.Text = value;
 }