Example #1
0
 private void AddInputControl(HtmlControl parent, HtmlControl control, Configuration.SearchInputFieldRow searchInputFieldRow, string className, string tip)
 {
   parent.Controls.Add(control);
   control.Attributes["class"] = "Input " + className;
   control.Attributes["data-id"] = searchInputFieldRow.FieldID;
   control.Attributes["title"] = tip;
 }
Example #2
0
 public void SelectByText(HtmlControl expandListButton, HtmlUnorderedList selectionList, string text)
 {
     expandListButton.Click();
     selectionList.Find
                  .ByContent<HtmlListItem>(text, ArtOfTest.WebAii.ObjectModel.FindContentType.InnerText)
                  .Click();
 }
 public void ClickCurrentButton(User currentUser, HtmlControl navigationButton)
 {
     this.NavigateToMainPage(currentUser);
     navigationButton.MouseClick();
     ExecutionDelayProvider.SleepFor(2000);
     this.Browser.RefreshDomTree();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = Resources.Page.Naslov + " - " + Resources.Page.NaslovHardware;
        jazik = "";
        if (Session["Lang"] != null)
        {
            if (Session["Lang"].ToString() == "EN")
            {
                jazik = "_EN";

            }
            else
            {
                jazik = "";
            }
        }

        pom = this.Master.slikiZaSlide;

        slikiSlide = "<div id=\"slikaHome\">\n";
        slikiSlide += "<a href=\"Hardware.aspx?ID=2\"><img src=\"Images/MsiWin.jpg\" alt=\"SlikaMsi\"/></a>";
        slikiSlide += "<a href=\"News.aspx\"><img src=\"Images/TaggyG.jpg\" alt=\"SlikaTaggy\"/></a>";
        slikiSlide += "<img src=\"Images/SlikaSymbol.jpg\" alt=\"SlikaInfoBiro\"/>\n";
        slikiSlide += "</div>\n";
        pom.Controls.Add((new LiteralControl(slikiSlide)));

        cnString = ConfigurationManager.ConnectionStrings["SqlServer"].ToString();
        Zapocni();
    }
Example #5
0
        public void GivenScientificCalculator()
        {
            Browser.NavigateTo("http://web2.0calc.com/");
            Browser.WaitUntilReady();
            Browser.RefreshDomTree();

            Calc = Browser.Find.ByAttributes<HtmlDiv>("class=calccontainer");
        }
 public static void ClickObject(HtmlControl objectToClick, bool clickToVisible=false) 
 {
     Manager.Current.ActiveBrowser.RefreshDomTree();
     Manager.Current.ActiveBrowser.WaitUntilReady();
     if (clickToVisible)
         objectToClick.ScrollToVisible();
     objectToClick.MouseClick(); 
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         frame = (HtmlControl)this.FindControl("FrmArea");
         frame.Attributes["src"] = String.Format("PatientForm.aspx?PatientId={0}&Type=InTab", pat.PersonId);
     }
 }
Example #8
0
 /// <summary>
 /// Simulate real typing by double clicking on the element and typing with the keyboard. Accepts html control, text and delay in milliseconds.
 /// </summary>
 /// <param name="control">Html control to type in</param>
 /// <param name="text">Text to type</param>
 /// <param name="delay">Delay between key strokes</param>
 public void SimulateRealTyping(HtmlControl control, string text, int delay = SimulateRealTypingDelay)
 {
     this.manager.ActiveBrowser.Window.SetFocus();
     control.Focus();
     control.MouseClick();
     control.MouseClick();
     this.manager.Desktop.KeyBoard.TypeText(text, delay);
     this.manager.Desktop.KeyBoard.KeyPress(Keys.Enter, delay);
 }
Example #9
0
 public static string GetText()
 {
     var textControl = new HtmlControl(browserWindow);
     try
     {
         textControl.SearchProperties.Add(CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
         textControl.WaitForControlEnabled();
         textControl.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find HtmlEdit Element - Element not Found");
     }
     return Text = textControl.InnerText;
 }
Example #10
0
 /// <summary>
 /// Gets the action controls.
 /// </summary>
 /// <param name="tableRow">The table row.</param>
 /// <returns></returns>
 public static IList<Element> GetActionControls(HtmlControl tableRow)
 {
     IList<Element> controls = new List<Element>();
     int actionCount = 0;
     ICollection<Element> cellList = tableRow.ChildNodes;
     foreach (Element cell in cellList)
     {
         if (cell.ChildNodes[0].TagName == "a")
         {
             actionCount = cell.Children.Count;
             for (int i = 0; i <= actionCount - 1; i++)
             {
                 controls.Add(cell.ChildNodes[i]);
             }
             return controls;
         }
     }
     return null;
 }
Example #11
0
   void RenderCustomEvents(HtmlControl oControl, List<string> oCustomEvents, string strClientEvent, string strCustomName)
   {
      string strArrayName = "arr" + strCustomName + "Events";
      string strArrayValues = "";

      foreach (string oValue in oCustomEvents)
      {
         if (oCustomEvents.IndexOf(oValue) != 0)
            strArrayValues += ",";

         strArrayValues += "'";
         strArrayValues += oValue.Replace("'", "\\'");
         strArrayValues += "'";
      }

      Page.ClientScript.RegisterArrayDeclaration(strArrayName, strArrayValues);

      oControl.Attributes.Add(strClientEvent, "fireEvents(" + strArrayName + ")");
   }
 /// <summary>
 /// Clicks available control
 /// </summary>
 /// <param name="viewName">from control.xml</param>
 /// <param name="controlName">from control.xml</param>
 /// <param name="waitTime"></param>
 /// <param name="dynamicVariable"></param>
 public static void Click(string viewName, string controlName, int waitTime = WaitTime.DefaultWaitTime, string dynamicVariable = "")
 {
     Control control = PopulateControl(viewName, controlName, dynamicVariable);
     Logger.InsertLogLine("Click on control: " + control.ControlName + " in View : " + viewName);
     if (control.ControlZone == "Native")
     {
         xamlControl = GetXamlControl(control, dynamicVariable, waitTime);
         xamlControl.WaitForControlExist(waitTime);
         Gesture.Tap(new Point(xamlControl.BoundingRectangle.X + xamlControl.BoundingRectangle.Width / 2, xamlControl.BoundingRectangle.Y + xamlControl.BoundingRectangle.Height / 2));
     }
     else if (control.ControlZone == "Web")
     {
         htmlControl = GetHtmlControl(control, dynamicVariable, waitTime);
         htmlControl.WaitForControlExist(waitTime);
         Gesture.Tap(new Point(htmlControl.BoundingRectangle.X + htmlControl.BoundingRectangle.Width / 2, htmlControl.BoundingRectangle.Y + htmlControl.BoundingRectangle.Height / 2));
         //Gesture.Tap(htmlControl);
     }
     else if (control.ControlZone == "DirectUI")
     {
         directUIControl = GetDirectUIControl(control, dynamicVariable, waitTime);
         Gesture.Tap(directUIControl);
     }
 }
Example #13
0
    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
        frame = (HtmlControl)this.FindControl("FrmArea");
        switch (e.Tab.Value)
        {
            case "patient":
                frame.Attributes["src"] = String.Format("CustomerForm.aspx?CustomerId={0}&Type=InTab", cus.PersonId);
                break;
            case "policy":
                frame.Attributes["src"] = String.Format("PolicyGrid.aspx?CustomerId={0}&Type=InTab", cus.PersonId);
                break;
            case "ticket":
                frame.Attributes["src"] = String.Format("TicketGrid.aspx?CustomerId={0}&Type=InTab", cus.PersonId);
                break;
            case "invoice":
                frame.Attributes["src"] = String.Format("InvoiceGrid.aspx?CustomerId={0}&Type=InTab", cus.PersonId);
                break;
            case "payment":
                frame.Attributes["src"] = String.Format("PaymentGrid.aspx?CustomerId={0}&Type=InTab", cus.PersonId);
                break;

        }
    }
Example #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         frame = (HtmlControl)this.FindControl("FrmArea");
         string url = "";
         if (visit == null)
         {
             url = String.Format("OphVisitForm.aspx?Type=InTab");
             if (patient != null) url = String.Format("OphVisitForm.aspx?Type=InTab&PatientId={0}",patientId);
             // make invisible tabs that aren't the general one
             for (int i = 1; i<=8;i++)
             {
                 RadTabStrip1.Tabs[i].Visible = false;
             }
             
         }
         else
         {
             url = String.Format("OphVisitForm.aspx?VisitId={0}&Type=InTab", visit.VisitId);
         }
         frame.Attributes["src"] = url;
     }
 }
        public void TC06_VerifyDeleteRow()
        {
            NavigateToMetersPage();
            int initialRowCount = Page.MetersTabPage.MetersTabGrid.Rows.Count;

            Thread.Sleep(2000);
            IList<Element> buttons = Page.MetersTabPage.MetersTabGrid.Rows.LastOrDefault().GetButtons();
            DialogHandler.ClickonOKButton();
            HtmlControl deleteButton = new HtmlControl(buttons[1]);
            deleteButton.Click();
            Thread.Sleep(2000);
            if (Page.MetersTabPage.MetersTabGrid.Rows.Count == initialRowCount)
            {
                Assert.Fail("Row deletion did not happen");
            }
            if (null != Page.ContactsTabPage.ErrorMsg)
            {
                if (!Page.ContactsTabPage.ErrorMsg.BaseElement.InnerText
                    .Equals(@"Contact deleted Successfully"))
                {
                    Assert.Fail("Incorrect error message is displayed,Expected: Contact deleted Successfully"
                                    + " but Actual:" + Page.ContactsTabPage.ErrorMsg.BaseElement.InnerText);
                }
            }
            else
            {
                Assert.Fail("Error message is not displayed");
            }

          

            //TODO: Add DB validation after manual test cases are updated
        }
Example #16
0
 /// <summary>The find range.</summary>
 /// <param name="htmlControl">The html control.</param>
 /// <param name="count">The count.</param>
 /// <param name="startIndex">The start index.</param>
 /// <param name="containingControl">The containing control.</param>
 /// <typeparam name="T"></typeparam>
 /// <returns>The <see cref="IEnumerable"/>.</returns>
 public abstract IEnumerable <T> FindRange <T>(T htmlControl, int count, int startIndex = 0, HtmlControl containingControl = null)
     where T : HtmlControl, new();
Example #17
0
 /// <summary>The find controls by tag name.</summary>
 /// <param name="tagName">The tag name.</param>
 /// <param name="parentControl">The parent control.</param>
 /// <returns>The <see cref="ReadOnlyCollection"/>.</returns>
 public abstract ReadOnlyCollection <HtmlControl> FindControlsByTagName(string tagName, HtmlControl parentControl = null);
Example #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                if (Convert.ToInt16(Session["UserRoleID"]) == 4)         // Checking role of user by UserRoleID ( 4=Sys Admin)
                {
                    #region
                    //Only User tab is Visible for Sys admin
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = true;
                    }

                    HtmlControl hcauser = Page.Master.FindControl("auser") as HtmlControl;
                    if (hcauser != null)
                    {
                        (Page.Master.FindControl("auser") as HtmlControl).Attributes.Add("class", "active");
                    }
                    //Hides the tabs other than User for Sys Admin role
                    HtmlControl hcliadminWO = Page.Master.FindControl("liadminWO") as HtmlControl;
                    if (hcliadminWO != null)
                    {
                        (Page.Master.FindControl("liadminWO") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminCR = Page.Master.FindControl("liadminCR") as HtmlControl;
                    if (hcliadminCR != null)
                    {
                        (Page.Master.FindControl("liadminCR") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPM = Page.Master.FindControl("liadminPM") as HtmlControl;
                    if (hcliadminPM != null)
                    {
                        (Page.Master.FindControl("liadminPM") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPD = Page.Master.FindControl("liadminPD") as HtmlControl;
                    if (hcliadminPD != null)
                    {
                        (Page.Master.FindControl("liadminPD") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminRP = Page.Master.FindControl("liadminRP") as HtmlControl;
                    if (hcliadminRP != null)
                    {
                        (Page.Master.FindControl("liadminRP") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminR = Page.Master.FindControl("liadminR") as HtmlControl;
                    if (hcliadminR != null)
                    {
                        (Page.Master.FindControl("liadminR") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminBD = Page.Master.FindControl("liadminBD") as HtmlControl;
                    if (hcliadminBD != null)
                    {
                        (Page.Master.FindControl("liadminBD") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPL = Page.Master.FindControl("liadminPL") as HtmlControl;
                    if (hcliadminPL != null)
                    {
                        (Page.Master.FindControl("liadminPL") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminRL = Page.Master.FindControl("liadminRL") as HtmlControl;
                    if (hcliadminRL != null)
                    {
                        (Page.Master.FindControl("liadminRL") as HtmlControl).Style.Add("display", "none");
                    }
                    #endregion
                }
                else if (Convert.ToInt16(Session["UserRoleID"]) == 1)
                {
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = true;
                    }

                    HtmlControl hcauser = Page.Master.FindControl("auser") as HtmlControl;
                    if (hcauser != null)
                    {
                        (Page.Master.FindControl("auser") as HtmlControl).Attributes.Add("class", "active");
                    }
                }
                else
                {
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = false;
                    }
                }
            }
            FirstName.Focus();

            if (!Page.IsPostBack)
            {
                BindDropDownRole();  // Method to bind the roles in the DropDownList
                ShowUser();          // Method to show the user details
            }

            FirstName.Attributes.Add("onkeypress", "return CheckTextValue(event,this);");
        }
    protected void LoadData(Refractometry rf)
    {
        // Load patient data
        rdcPatient.Items.Clear();
        rdcPatient.Items.Add(new RadComboBoxItem(rf.Patient.FullName, rf.Patient.PersonId.ToString()));
        rdcPatient.SelectedValue = rf.Patient.PersonId.ToString();

        // Load Examination data
        rdcExamination.Items.Clear();
        rdcExamination.Items.Add(new RadComboBoxItem(rf.Examination.Name, rf.Examination.ExaminationId.ToString()));
        rdcExamination.SelectedValue = rf.Examination.ExaminationId.ToString();

        // Now we must load tabstrip
        frame = (HtmlControl)this.FindControl("FrmArea");
        if (refractometry.WithoutGlassesTests.Count() == 0)
            frame.Attributes["src"] = String.Format("WithoutGlassesForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
        else
            frame.Attributes["src"] = String.Format("WithoutGlassesForm.aspx?RefractometryId={0}&WithoutGlassesId={1}", 
                refractometry.ExaminationAssignedId, refractometry.WithoutGlassesTests[0].Id);

        rdpExaminationDate.SelectedDate = rf.ExaminationDate;
        txtComments.Text = rf.Comments;
    }
Example #20
0
        public CreateCharSelectionCityGump(byte profession, LoginScene scene) : base(0, 0)
        {
            CanMove = false;
            CanCloseWithRightClick = false;
            CanCloseWithEsc        = false;

            _scene = scene;
            _selectedProfession = profession;

            CityInfo city;

            if (Client.Version >= ClientVersion.CV_70130)
            {
                city = scene.GetCity(0);
            }
            else
            {
                city = scene.GetCity(3);

                if (city == null)
                {
                    city = scene.GetCity(0);
                }
            }

            if (city == null)
            {
                Log.Error("No city found. Something wrong with the received cities.");
                Dispose();
                return;
            }

            uint map = 0;

            if (city.IsNewCity)
            {
                map = city.Map;
            }

            _facetName = new Label("", true, 0x0481, font: 0, style: FontStyle.BlackBorder)
            {
                X = 240,
                Y = 440
            };


            if (Client.Version >= ClientVersion.CV_70130)
            {
                Add(new GumpPic(62, 54, (ushort)(0x15D9 + map), 0));
                Add(new GumpPic(57, 49, 0x15DF, 0));
                _facetName.Text = _cityNames[map];
            }
            else
            {
                Add(new GumpPic(57, 49, 0x1598, 0));
                _facetName.IsVisible = false;
            }

            if (CUOEnviroment.IsOutlands)
            {
                _facetName.IsVisible = false;
            }

            Add(_facetName);


            Add(new Button((int)Buttons.PreviousScreen, 0x15A1, 0x15A3, 0x15A2)
            {
                X            = 586,
                Y            = 445,
                ButtonAction = ButtonAction.Activate
            });

            Add(new Button((int)Buttons.Finish, 0x15A4, 0x15A6, 0x15A5)
            {
                X            = 610,
                Y            = 445,
                ButtonAction = ButtonAction.Activate
            });


            _htmlControl = new HtmlControl(452, 60, 175, 367, true, true, ishtml: true, text: city.Description);
            Add(_htmlControl);

            if (CUOEnviroment.IsOutlands)
            {
                _htmlControl.IsVisible = false;
            }

            for (int i = 0; i < scene.Cities.Length; i++)
            {
                CityInfo c = scene.GetCity(i);

                if (c == null)
                {
                    continue;
                }

                int x = 0;
                int y = 0;

                if (c.IsNewCity)
                {
                    uint cityFacet = c.Map;

                    if (cityFacet > 5)
                    {
                        cityFacet = 5;
                    }

                    x = 62 + Utility.MathHelper.PercetangeOf(MapLoader.Instance.MapsDefaultSize[cityFacet, 0] - 2048, c.X, 383);
                    y = 54 + Utility.MathHelper.PercetangeOf(MapLoader.Instance.MapsDefaultSize[cityFacet, 1], c.Y, 384);
                }
                else if (i < _townButtonsText.Length)
                {
                    x = _townButtonsText[i].X;
                    y = _townButtonsText[i].Y;
                }

                CityControl control = new CityControl(c, x, y, i);
                Add(control);
                _cityControls.Add(control);

                if (CUOEnviroment.IsOutlands)
                {
                    control.IsVisible = false;
                }
            }

            SetCity(city);
        }
Example #21
0
        /// <summary>
        /// Load chili document
        /// </summary>
        /// <param name="isFlashEditor"></param>
        private void LoadChiliDocument(bool isFlashEditor)
        {
            try
            {
                var getEditorUrlResponse = new XmlDocument();

                ChiliProcessor chili = new ChiliProcessor();

                //get the workspace id from database
                var workspaceID = "2ec4fc0a-cc3b-4f57-973a-8cfe5c0c8e4b";

                //get the viewpreference from database
                var viewPrefsID = "";// "f67b53b6-6ad4-4cc9-a1dd-bd1ac8acdd8d";

                long menuId = Convert.ToInt64(Session["CURRENTID"]);

                Session["MENUIDFORNOTIFICATION"] = menuId;

                var menuTemplate = _menuManagement.GetMenuTemplate(menuId);
                var menu         = _menuManagement.GetMenuById(menuId);

                workspaceID = WorkspaceAssignmentBasedOnRoles(workspaceID, menu);

                var userId   = Convert.ToInt32(Session["USERID"]);
                var userdata = _accountManagement.GetUserTypeByUserid(userId);

                if (menuTemplate != null && !string.IsNullOrEmpty(menuTemplate.ChiliDocumentID))
                {
                    if (!isFlashEditor)
                    {
                        getEditorUrlResponse.LoadXml(chili.WebService.DocumentGetHTMLEditorURL(chili.ApiKey, menuTemplate.ChiliDocumentID, workspaceID, viewPrefsID, "", false, false));
                    }
                    else
                    {
                        getEditorUrlResponse.LoadXml(chili.WebService.DocumentGetEditorURL(chili.ApiKey, menuTemplate.ChiliDocumentID, workspaceID, viewPrefsID, "", false, false));
                    }

                    if (menu.ApprovalStatusName == "Approved" /*&& userdata != "ESP"*/)
                    {
                        if (!isFlashEditor)
                        {
                            getEditorUrlResponse.LoadXml(chili.WebService.DocumentGetHTMLEditorURL(chili.ApiKey, menuTemplate.ChiliDocumentID, workspaceID, viewPrefsID, "", true, true));
                        }
                        else
                        {
                            getEditorUrlResponse.LoadXml(chili.WebService.DocumentGetEditorURL(chili.ApiKey, menuTemplate.ChiliDocumentID, workspaceID, viewPrefsID, "", true, true));
                        }
                    }

                    //create url and assign source
                    var editorUrl = getEditorUrlResponse.DocumentElement.GetAttribute("url") + "&d=approve4print.co.uk";

                    if (!isFlashEditor)
                    {
                        editorUrl = getEditorUrlResponse.DocumentElement.GetAttribute("url") + "&d=approve4print.co.uk &fullWs=true";
                    }

                    //set the iframesource as editor url
                    HtmlControl iframe = (HtmlControl)this.FindControl("iframeChiliProof");

                    if (iframe != null)
                    {
                        iframe.Attributes["src"] = editorUrl;
                    }
                }
            }
            catch (Exception ex)
            {
                //write to Elma
                ErrorSignal.FromCurrentContext().Raise(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ProjectDashBoardEditId = Request.QueryString["ProjectDashEditId"].ToString() != " " ? Convert.ToInt32(Request.QueryString["ProjectDashEditId"]) : 0;
            projectId = Request.QueryString["projectID"] != null?Convert.ToInt32(Request.QueryString["projectID"]) : 0;

            projectName = Request.QueryString["projectName"] != null ? Request.QueryString["projectName"] : "";

            if (Session["UserName"] == null)
            {
                Response.Redirect("Default.aspx");
            }

            else
            {
                if (Convert.ToInt16(Session["UserRoleID"]) == 4) // Checking role of user by UserRoleID ( 4=Sys Admin)
                {
                    #region
                    //Only User tab is Visible for Sys admin
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = true;
                    }

                    HtmlControl hcauser = Page.Master.FindControl("auser") as HtmlControl;
                    if (hcauser != null)
                    {
                        (Page.Master.FindControl("auser") as HtmlControl).Attributes.Add("class", "active");
                    }
                    //Hides the tabs other than User for Sys Admin role
                    HtmlControl hcliadminWO = Page.Master.FindControl("liadminWO") as HtmlControl;
                    if (hcliadminWO != null)
                    {
                        (Page.Master.FindControl("liadminWO") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminCR = Page.Master.FindControl("liadminCR") as HtmlControl;
                    if (hcliadminCR != null)
                    {
                        (Page.Master.FindControl("liadminCR") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPM = Page.Master.FindControl("liadminPM") as HtmlControl;
                    if (hcliadminPM != null)
                    {
                        (Page.Master.FindControl("liadminPM") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPD = Page.Master.FindControl("liadminPD") as HtmlControl;
                    if (hcliadminPD != null)
                    {
                        (Page.Master.FindControl("liadminPD") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminRP = Page.Master.FindControl("liadminRP") as HtmlControl;
                    if (hcliadminRP != null)
                    {
                        (Page.Master.FindControl("liadminRP") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminR = Page.Master.FindControl("liadminR") as HtmlControl;
                    if (hcliadminR != null)
                    {
                        (Page.Master.FindControl("liadminR") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminBD = Page.Master.FindControl("liadminBD") as HtmlControl;
                    if (hcliadminBD != null)
                    {
                        (Page.Master.FindControl("liadminBD") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminPL = Page.Master.FindControl("liadminPL") as HtmlControl;
                    if (hcliadminPL != null)
                    {
                        (Page.Master.FindControl("liadminPL") as HtmlControl).Style.Add("display", "none");
                    }

                    HtmlControl hcliadminRL = Page.Master.FindControl("liadminRL") as HtmlControl;
                    if (hcliadminRL != null)
                    {
                        (Page.Master.FindControl("liadminRL") as HtmlControl).Style.Add("display", "none");
                    }
                    #endregion
                    Response.Redirect("AccessDenied.aspx");
                }
                else if (Convert.ToInt16(Session["UserRoleID"]) == 1) // Checking role of user by UserRoleID ( 1 = ProjectOwner , 2 = ProjectManager )
                {
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = true;
                    }

                    HtmlControl hcauser = Page.Master.FindControl("auser") as HtmlControl;
                    if (hcauser != null)
                    {
                        (Page.Master.FindControl("auser") as HtmlControl).Attributes.Add("class", "");
                    }
                }
                else
                {
                    HtmlControl hcliuser = Page.Master.FindControl("liuser") as HtmlControl;
                    if (hcliuser != null)
                    {
                        (Page.Master.FindControl("liuser") as HtmlControl).Visible = false;
                    }
                }
            }

            if (!Page.IsPostBack)
            {
                DataTable dtDataSession = (DataTable)Session["dtDatas1"];
                if (dtDataSession != null && dtDataSession.Rows.Count > 0)
                {
                    Session["dayfrom"]     = dtDataSession.Rows[0].ItemArray[0];
                    Session["dayto"]       = dtDataSession.Rows[0].ItemArray[1];
                    Session["dashboardID"] = Convert.ToInt64(dtDataSession.Rows[0].ItemArray[2]);
                    Session["status"]      = dtDataSession.Rows[0].ItemArray[3];
                    Session["ProjectName"] = projectName != null?projectName:"";
                    lblheading.Text        = "Project:" + ' ' + Session["ProjectName"];
                    Session["dayfrom"]     = Convert.ToDateTime(Session["dayfrom"]).ToString("dd/MM/yyyy");
                    Session["dayto"]       = Convert.ToDateTime(Session["dayto"]).ToString("dd/MM/yyyy");
                    lblDates.Text          = "From:" + ' ' + Session["dayfrom"].ToString() + ' ' + '-' + ' ' + "To:" + ' ' + Session["dayto"].ToString();
                }

                if (ProjectDashBoardEditId != 0)
                {
                    GetDashBoardDetails(); // Method to get dashboard entries...
                }
                lblMsg.Text = string.Empty;
            }

            GetFinaliseddashBoard(); // Method to find the Finalised DashBoard ...
        }
 protected abstract void InstantiateControlIn(HtmlControl container);
Example #24
0
 /// <summary>The set value.</summary>
 /// <param name="htmlControl">The html control.</param>
 /// <param name="value">The value.</param>
 /// <param name="clearFirst">The clear first.</param>
 public abstract void SetValue(HtmlControl htmlControl, string value, bool clearFirst);
Example #25
0
        private void SetLinkToPagePatientData(Object Sender, RepeaterItemEventArgs e, HtmlControl ctrl)
        {
            // if the patient ID for this row is empty, clicking the row will cause a javascript alert.
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                if (((DataRowView)e.Item.DataItem)["patientId"].ToString().Length > 0)
                {
                    string localPatientId = ((DataRowView)e.Item.DataItem)["patientId"].ToString();

                    ctrl.Style["cursor"] = "pointer";

                    if (localPatientId == "")
                    {
                        ctrl.Attributes.Add("onClick", "javascript:alert('This patient is not in the database.  No information about this patient beyond the data listed on this page is currently available.');");
                    }
                    else
                    {
                        string urlVars = "epid=" + CustomCryptoHelper.Encrypt(localPatientId) + "&patientList=yes";
                        string url     = Page.ResolveUrl("~/Core/DataEntryForms/Index.aspx?findClicked=true&epid=" + CustomCryptoHelper.Encrypt(localPatientId)) + "&patientList=yes";
                        ctrl.Attributes.Add("onClick", "top.location='" + url + "';");
                    }
                }
            }
        }
Example #26
0
 /// <summary>The set value.</summary>
 /// <param name="htmlControl"></param>
 /// <param name="value">The value.</param>
 public abstract void SetValue(HtmlControl htmlControl, string value);
Example #27
0
 /// <summary>The scroll to middle.</summary>
 /// <param name="htmlControl">The html control.</param>
 public abstract void ScrollToMiddle(HtmlControl htmlControl);
Example #28
0
 /// <summary>The perform refresh.</summary>
 /// <param name="htmlControl">The html control.</param>
 /// <returns>The <see cref="bool"/>.</returns>
 public abstract bool PerformRefresh(HtmlControl htmlControl);
Example #29
0
 public void EditListItemClick(HtmlControl control, string strText)
 {
     MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
     Thread.Sleep(3000);
     control.Focus();
     ICollection<Element> ele = control.ChildNodes;
     foreach (Element e in ele)
     {
         if (e.InnerText == strText)
         {
             (new HtmlControl(e)).Click();
             MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
             break;
         }
     }
 }
Example #30
0
        public static void eReg_Reference()
        {
            /*****************/
            //Create browserwindow
            /*****************/
            BrowserWindow browind = new BrowserWindow();

            browind.SearchProperties[UITestControl.PropertyNames.Name] = "References";

            //Verify References pane is available
            HtmlControl ReferencesPane = new HtmlControl(browind);

            ReferencesPane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "References";



            // References 1
            /*References1 Name*/
            HtmlSpan Reference1Name = new HtmlSpan(browind);

            Reference1Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_name";
            Reference1Name.DrawHighlight();

            //Reference1 Type
            HtmlComboBox Ref1type = new HtmlComboBox(browind);

            Ref1type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref1_type";
            Ref1type.DrawHighlight();
            // string ReferenceType = (string)Ref1type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem);

            //Ref1 Current Title
            HtmlSpan RefTitle = new HtmlSpan(browind);

            RefTitle.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_title";
            RefTitle.DrawHighlight();

            //Ref1 Company Name
            HtmlSpan Ref1CompanyName = new HtmlSpan(browind);

            Ref1CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_company";
            Ref1CompanyName.DrawHighlight();

            //Ref1 Location (City, State/Prov, and Country)
            HtmlSpan RefLocation = new HtmlSpan(browind);

            RefLocation.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_location";
            RefLocation.DrawHighlight();

            //Ref1Area Code
            HtmlSpan RefAreaCode = new HtmlSpan(browind);

            RefAreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_phone_areacode";
            RefAreaCode.DrawHighlight();

            //Ref1 Phone
            HtmlSpan Ref1Phone = new HtmlSpan(browind);

            Ref1Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_phone";
            Ref1Phone.DrawHighlight();

            //Ref1 Phone Ext
            HtmlSpan Ref1PhoneExt = new HtmlSpan(browind);

            Ref1PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_ext";
            Ref1PhoneExt.DrawHighlight();

            //Ref1 Fax No
            HtmlSpan Ref1FaxNo = new HtmlSpan(browind);

            Ref1FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_fax";
            Ref1FaxNo.DrawHighlight();

            //Ref1 Email Address
            HtmlSpan Ref1EmailAddress = new HtmlSpan(browind);

            Ref1EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref1_email";
            Ref1EmailAddress.DrawHighlight();


            //*******************
            // References 2
            //*******************

            /*References2 Name*/
            HtmlSpan Reference2Name = new HtmlSpan(browind);

            Reference2Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_name";
            Reference2Name.DrawHighlight();

            //Reference2 Type
            HtmlComboBox Ref2type = new HtmlComboBox(browind);

            Ref2type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref2_type";
            Ref2type.DrawHighlight();
            // string eRegstate = (string)Ref2type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem);

            //Ref2 Current Title
            HtmlSpan Ref2Title = new HtmlSpan(browind);

            Ref2Title.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_title";
            Ref2Title.DrawHighlight();

            //Ref2 Company Name
            HtmlSpan Ref2CompanyName = new HtmlSpan(browind);

            Ref2CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_company";
            Ref2CompanyName.DrawHighlight();

            //Ref2 Location (City, State/Prov, and Country)
            HtmlSpan Ref2Location = new HtmlSpan(browind);

            Ref2Location.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_location";
            Ref2Location.DrawHighlight();

            //Ref2 Area Code
            HtmlSpan Ref2AreaCode = new HtmlSpan(browind);

            Ref2AreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_phone_areacode";
            Ref2AreaCode.DrawHighlight();

            //Ref2 Phone
            HtmlSpan Ref2Phone = new HtmlSpan(browind);

            Ref2Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_phone";
            Ref2Phone.DrawHighlight();

            //Ref2 Phone Ext
            HtmlSpan Ref2PhoneExt = new HtmlSpan(browind);

            Ref2PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_ext";
            Ref2PhoneExt.DrawHighlight();

            //Ref2 Fax No
            HtmlSpan Ref2FaxNo = new HtmlSpan(browind);

            Ref2FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_fax";
            Ref2FaxNo.DrawHighlight();

            //Ref2 Email Address
            HtmlSpan Ref2EmailAddress = new HtmlSpan(browind);

            Ref2EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref2_email";
            Ref2EmailAddress.DrawHighlight();

            //*******************
            // References 3
            //*******************

            /*References3 Name*/
            HtmlSpan Reference3Name = new HtmlSpan(browind);

            Reference3Name.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_name";
            Reference1Name.DrawHighlight();

            //Reference3 Type
            HtmlComboBox Ref3type = new HtmlComboBox(browind);

            Ref3type.SearchProperties[HtmlComboBox.PropertyNames.Id] = "Ref3_type";
            Ref3type.DrawHighlight();
            // string eRegstate = (string)Ref3type.GetProperty(HtmlComboBox.PropertyNames.SelectedItem);

            //Ref3 Current Title
            HtmlSpan Ref3Title = new HtmlSpan(browind);

            Ref3Title.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_title";
            Ref3Title.DrawHighlight();

            //Ref3 Company Name
            HtmlSpan Ref3CompanyName = new HtmlSpan(browind);

            Ref3CompanyName.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_company";
            Ref3CompanyName.DrawHighlight();

            //Ref3 Location (City, State/Prov, and Country)
            HtmlSpan Ref3Location = new HtmlSpan(browind);

            Ref3Location.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_location";
            Ref3Location.DrawHighlight();

            //Ref3 Area Code
            HtmlSpan Ref3AreaCode = new HtmlSpan(browind);

            Ref3AreaCode.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_phone_areacode";
            Ref3AreaCode.DrawHighlight();

            //Ref3 Phone
            HtmlSpan Ref3Phone = new HtmlSpan(browind);

            Ref3Phone.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_phone";
            Ref3Phone.DrawHighlight();

            //Ref3 Phone Ext
            HtmlSpan Ref3PhoneExt = new HtmlSpan(browind);

            Ref3PhoneExt.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_ext";
            Ref3PhoneExt.DrawHighlight();

            //Ref3 Fax No
            HtmlSpan Ref3FaxNo = new HtmlSpan(browind);

            Ref3FaxNo.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_fax";
            Ref3FaxNo.DrawHighlight();

            //Ref3 Email Address
            HtmlSpan Ref3EmailAddress = new HtmlSpan(browind);

            Ref3EmailAddress.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Ref3_email";
            Ref3EmailAddress.DrawHighlight();


            /*****************/
            /* Progress Meter*/
            /*****************/
            HtmlCustom progress = new HtmlCustom(browind);

            progress.SearchProperties[HtmlCustom.PropertyNames.Id] = "progressmeter";
            progress.DrawHighlight();
            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] = "meterdiv";
                bar.DrawHighlight();
                string percentage = (string)bar.GetProperty(HtmlSpan.PropertyNames.InnerText);
                Assert.AreEqual(percentage, "55%");
            }
            else
            {
                Assert.IsFalse(availabilty, "Progress Meter is showing");
            }


            //Click button Save And Continue
            HtmlSpan SaveAndCountinue = new HtmlSpan(browind);

            SaveAndCountinue.SearchProperties[HtmlSpan.PropertyNames.Id] = "ForwardButton_button";
            SaveAndCountinue.DrawHighlight();
            Mouse.Click(SaveAndCountinue);

            browind.WaitForControlReady(2000);
        }
Example #31
0
 /// <summary>The perform click.</summary>
 /// <param name="htmlControl">The html control.</param>
 /// <param name="clickAction">The click action.</param>
 /// <param name="waitForBehavior">The wait for behavior.</param>
 public abstract void PerformClick(HtmlControl htmlControl, ClickAction clickAction, Func <Browser, bool> waitForBehavior = null);
Example #32
0
    protected void templateRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        ClearTemplateSelection();

        //change style of selected item
        HtmlControl li = (HtmlControl)e.Item.FindControl("listItem");

        if (string.IsNullOrEmpty(li.Attributes["class"]))
        {
            li.Attributes["class"] = "selectedTemplate";
        }
        else
        {
            li.Attributes["class"] += " selectedTemplate";
        }

        //get image file and regions
        string file = null;
        List <NamedRectangleRegion> regions = new List <NamedRectangleRegion>();

        System.Globalization.NumberFormatInfo numberInfo = new System.Globalization.NumberFormatInfo();
        numberInfo.NumberDecimalSeparator = ".";

        string templatesListFile = Path.Combine(_templateFolder, "Templates.xml");

        if (File.Exists(templatesListFile))
        {
            using (FileStream fs = new FileStream(templatesListFile, FileMode.Open, FileAccess.Read))
            {
                System.Xml.XPath.XPathDocument doc = new System.Xml.XPath.XPathDocument(fs);
                foreach (XPathNavigator nav in
                         doc.CreateNavigator().Select("/Templates/TemplateItem"))
                {
                    string fileName = Path.IsPathRooted(nav.GetAttribute("FileName", nav.NamespaceURI)) ? nav.Value : Path.Combine(_templateFolder, nav.GetAttribute("FileName", nav.NamespaceURI));
                    if (fileName.GetHashCode().ToString() == e.CommandArgument.ToString())
                    {
                        file = fileName;
                        foreach (XPathNavigator regionNavigator in nav.Select("Regions/Region"))
                        {
                            string name = regionNavigator.GetAttribute("Name", regionNavigator.NamespaceURI);
                            float  left = float.Parse(
                                regionNavigator.GetAttribute("Left", regionNavigator.NamespaceURI), numberInfo);
                            float top = float.Parse(
                                regionNavigator.GetAttribute("Top", regionNavigator.NamespaceURI), numberInfo);
                            float width = float.Parse(
                                regionNavigator.GetAttribute("Width", regionNavigator.NamespaceURI), numberInfo);
                            float height = float.Parse(
                                regionNavigator.GetAttribute("Height", regionNavigator.NamespaceURI), numberInfo);

                            regions.Add(new NamedRectangleRegion(name,
                                                                 new System.Drawing.RectangleF(left, top, width, height)));
                        }
                        break;
                    }
                }
            }
        }

        if (!string.IsNullOrEmpty(file) && File.Exists(file))
        {
            photoLabel.CanvasViewer.Canvas.History.Enable = photoLabel.CanvasViewer.Canvas.History.TrackingEnabled = false;

            photoLabel.BackgroundImage = file;

            //remove previous regions
            photoLabel.RemoveAllRegions();

            //add new regions
            photoLabel.AddRegions(regions);
            //select last region
            photoLabel.CurrentRegion = regions[regions.Count - 1];

            //clear canvas history
            photoLabel.CanvasViewer.Canvas.History.Clear();
            photoLabel.CanvasViewer.Canvas.History.Enable = photoLabel.CanvasViewer.Canvas.History.TrackingEnabled = true;
        }
    }
Example #33
0
 private void chkAllowTabs_CheckedChanged(object sender, EventArgs e)
 {
     HtmlControl.SetInternetFeatureEnabled(
         InternetFeatureList.FEATURE_TABBED_BROWSING,
         SetFeatureFlag.SET_FEATURE_ON_PROCESS, chkAllowTabs.Checked);
 }
Example #34
0
 /// <summary>The mouse leave.</summary>
 /// <param name="htmlControl">The html control.</param>
 public abstract void MouseLeave(HtmlControl htmlControl);
        protected void Page_Load(object sender, EventArgs e)
        {
            userSesion = (Usuario)Session["userSesion"];

            if (userSesion != null)
            {
                if (userSesion.Persona.TipoPersona == Persona.TiposPersona.Administrativo)
                {
                    Response.Redirect("~/Home.aspx");
                }
                else if (userSesion.Persona.TipoPersona == Persona.TiposPersona.Docente)
                {
                    Response.Redirect("~/Home.aspx");
                }
                else if (userSesion.Persona.TipoPersona == Persona.TiposPersona.Alumno)
                {
                    if (Request.QueryString["IdMateria"] != null)
                    {
                        try
                        {
                            if (int.Parse(Request.QueryString["IdMateria"]) > 0)
                            {
                                MateriaLogic ml = new MateriaLogic();
                                materia = ml.GetOne(int.Parse(Request.QueryString["IdMateria"]));

                                if (materia != null)
                                {
                                    if (materia.Plan.ID == userSesion.Persona.Plan.ID)
                                    {
                                        InscripcionLogic         il = new InscripcionLogic();
                                        List <AlumnoInscripcion> inscripcionesDelAlumno = il.GetInscripcionesDelAlumno(userSesion.Persona);

                                        foreach (AlumnoInscripcion alumnoInsc in inscripcionesDelAlumno)
                                        {
                                            if (alumnoInsc.Curso.Materia.ID == materia.ID &&
                                                (alumnoInsc.Condicion == AlumnoInscripcion.Condiciones.Aprobada ||
                                                 alumnoInsc.Condicion == AlumnoInscripcion.Condiciones.Inscripto))
                                            {
                                                materia.CondicionAlumno = alumnoInsc.Condicion;
                                                materia.NotaAlumno      = alumnoInsc.Nota;
                                                break;
                                            }

                                            if (alumnoInsc.Curso.Materia.ID == materia.ID &&
                                                alumnoInsc.Condicion == AlumnoInscripcion.Condiciones.Regular)
                                            {
                                                materia.CondicionAlumno = alumnoInsc.Condicion;
                                                materia.NotaAlumno      = alumnoInsc.Nota;
                                            }
                                        }

                                        if (materia.CondicionAlumno != AlumnoInscripcion.Condiciones.Aprobada)
                                        {
                                            VerificarMateriasCorrelativasLogic vmcl = new VerificarMateriasCorrelativasLogic();

                                            if (vmcl.PuedeInscribirse(userSesion.Persona, materia))
                                            {
                                                HtmlControl lbl = (HtmlControl)Master.FindControl("lblInscripcionCursosAlumno");
                                                lbl.Attributes["style"] = "color: orange;";

                                                LoadGrid();
                                            }
                                            else
                                            {
                                                Response.Redirect("~/InscripcionCursos.aspx");
                                            }
                                        }
                                        else
                                        {
                                            Response.Redirect("~/InscripcionCursos.aspx");
                                        }
                                    }
                                    else
                                    {
                                        Response.Redirect("~/InscripcionCursos.aspx");
                                    }
                                }
                                else
                                {
                                    Response.Redirect("~/InscripcionCursos.aspx");
                                }
                            }
                            else
                            {
                                Response.Redirect("~/InscripcionCursos.aspx");
                            }
                        }
                        catch (Exception)
                        {
                            Response.Redirect("~/InscripcionCursos.aspx");
                        }
                    }
                    else
                    {
                        Response.Redirect("~/InscripcionCursos.aspx");
                    }
                }
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
        }
Example #36
0
 /// <summary>The get attribute.</summary>
 /// <param name="htmlControl">The html Control.</param>
 /// <param name="attribute">The attribute.</param>
 /// <returns>The <see cref="string"/>.</returns>
 public abstract string GetAttribute(HtmlControl htmlControl, string attribute);
Example #37
0
 /// <summary>
 /// Makes a control transparent.  Works with several browsers.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="opacity">The opacity amount.</param>
 private static void MakeTransparent(HtmlControl control, int opacity)
 {
     control.SetStyleAttribute("filter", "alpha(opacity=" + opacity + ")");
     control.SetStyleAttribute("-moz-opacity", "." + opacity);
     control.SetStyleAttribute("opacity", "." + opacity);
 }
        public void TC05_VerifyUpdateCancel()
        {
            NavigateToMetersPage();
            Thread.Sleep(2000);
            IList<Element> buttons = Page.MetersTabPage.MetersTabGrid.Rows.FirstOrDefault().GetButtons();
            HtmlControl updateButton = new HtmlControl(buttons.LastOrDefault());
            updateButton.Click();

            Page.MetersTabPage.MeterName.Text = "";
            KeyBoardSimulator.KeyPress(Keys.Tab);
            Page.MetersTabPage.MeterName.Focus();
            Page.MetersTabPage.MeterName.ExtendedMouseClick();            
            KeyBoardSimulator.SetText("TrialText");
            Page.MetersTabPage.EditMeterCancelButton.Click();
                                    
            Assert.False(Page.MetersTabPage.MetersTabGrid.Rows.FirstOrDefault().InnerText.Contains("TrialText"));
            
        }
 protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
 {
     if (refractometry == null) return;
     frame = (HtmlControl)this.FindControl("FrmArea");
     switch (e.Tab.Value)
     {
         case "T1":
             if (refractometry.WithoutGlassesTests.Count() == 0)
                 frame.Attributes["src"] = String.Format("WithoutGlassesForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("WithoutGlassesForm.aspx?RefractometryId={0}&WithoutGlassesId={1}",
                     refractometry.ExaminationAssignedId, refractometry.WithoutGlassesTests[0].Id);
             break;
         case "T2":
             if (refractometry.GlassesTests.Count() == 0)
                 frame.Attributes["src"] = String.Format("GlassesTestForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("GlassesTestForm.aspx?RefractometryId={0}&GlassesTestId={1}",
                     refractometry.ExaminationAssignedId, refractometry.GlassesTests[0].Id);
             break;
         case "T3":
             if (refractometry.ContactLensesTests.Count() == 0)
                 frame.Attributes["src"] = String.Format("ContactLensesTestForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("ContactLensesTestForm.aspx?RefractometryId={0}&ContactLensesTestId={1}",
                     refractometry.ExaminationAssignedId, refractometry.ContactLensesTests[0].Id);
             break;
         case "T4":
             if (refractometry.OpticalObjectiveExaminations.Count() == 0)
                 frame.Attributes["src"] = String.Format("OpticalObjectiveExaminationForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("OpticalObjectiveExamination.aspx?RefractometryId={0}&OpticalObjectiveExaminationId={1}",
                     refractometry.ExaminationAssignedId, refractometry.ContactLensesTests[0].Id);
             break;
         case "T5":
             if (refractometry.SubjectiveOpticalExaminations.Count() == 0)
                 frame.Attributes["src"] = String.Format("SubjectiveOpticalExaminationForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("SubjectiveOpticalExaminationForm.aspx?RefractometryId={0}&SubjectiveOpticalExaminationId={1}",
                     refractometry.ExaminationAssignedId, refractometry.SubjectiveOpticalExaminations[0].Id);
             break;
         case "T6":
             if (refractometry.PrescriptionGlasses.Count() == 0)
                 frame.Attributes["src"] = String.Format("PrescriptionGlassesForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("PrescriptionGlassesForm.aspx?RefractometryId={0}&PrescriptionGlassesId={1}",
                     refractometry.ExaminationAssignedId, refractometry.PrescriptionGlasses[0].Id);
             break;
         case "T7":
             if (refractometry.Cycloplegias.Count() == 0)
                 frame.Attributes["src"] = String.Format("CycloplegiaForm.aspx?RefractometryId={0}", refractometry.ExaminationAssignedId);
             else
                 frame.Attributes["src"] = String.Format("CycloplegiaForm.aspx?RefractometryId={0}&CycloplegiaId={1}",
                     refractometry.ExaminationAssignedId, refractometry.Cycloplegias[0].Id);
             break;
     }
 }
    /// <summary>
    /// Sets the step contorls.
    /// </summary>
    /// <param name="lblStepName">Name of the LBL step.</param>
    /// <param name="divStep">The div step.</param>
    /// <param name="step">The step.</param>
    /// <param name="visited">if set to <c>true</c> [visited].</param>
    private void SetStepControls(Label lblStepName, HtmlControl divStep, WizardStep step, bool visited)
    {
        if (lblStepName != null)
        {
            lblStepName.Text = step.Title;
            if (wzdImportLeads.ActiveStep.ID == step.ID)
            {
                lblStepName.Attributes.Add("class", "lblActive");
                lblStepName.Enabled = true;
            }
            else
            {
                if (visited)
                {
                    lblStepName.Attributes.Add("class", "lblVisited");
                    lblStepName.Enabled = true;
                }
                else
                {
                    lblStepName.Attributes.Add("class", "lblNotVisited");
                    lblStepName.Enabled = false;
                }
            }
        }

        if (divStep != null)
        {
            if (wzdImportLeads.ActiveStep.ID == step.ID)
                divStep.Attributes.Add("class", "Active");
            else
            {
                if (visited)
                    divStep.Attributes.Add("class", "Visited");
                else
                    divStep.Attributes.Add("class", "NotVisited");
            }
        }
    }
Example #41
0
 /// <summary>The find parent.</summary>
 /// <param name="childControl">The child control.</param>
 /// <typeparam name="T">The type of HtmlControl.</typeparam>
 /// <returns>The <see cref="T"/>.</returns>
 public abstract T FindParent <T>(HtmlControl childControl) where T : HtmlControl, new();
Example #42
0
 public static void WaitForElement(this Browser browser, HtmlControl element, int timeout)
 {
     browser.WaitForEvent(() => element != null, timeout);
 }
Example #43
0
        private Lead ProcessDetailView(Browser detailbrowser)
        {
            var lead = new Lead();

            try
            {
                lead.Recordeddate = GetNextSiblingText(detailbrowser, e => e.TextContent.Contains("Filed Date"));
                lead.Debt = GetNextSiblingText(detailbrowser, e => e.TextContent.Contains("Consideration Amt")); //  detailbrowser.Find.ByCustom(e => e.TextContent.Contains("Consideration Amt"));
                  lead.Id = GetNextSiblingText(detailbrowser, e => e.TextContent.Contains("Document Number"));
                  lead.Book = GetNextSiblingText(detailbrowser, e => e.TextContent.Contains("Book Number"));
                  lead.Page = GetNextSiblingText(detailbrowser, e => e.TextContent.Contains("Page Number"));

                //# of Pages
                var docpages = GetNextSibling(detailbrowser, e => e.TextContent.Contains("# of Pages"));// detailbrowser.Find.ByCustom(e => e.TextContent.Contains("# of Pages"));
                if (docpages != null)
                {
                    try
                    {
                        lead.Document.Pages = Convert.ToInt32(docpages.TextContent);
                    }
                    catch (Exception)
                    {
                    }
                }
                var headers = detailbrowser.Find.AllByAttributes("class=clsDetailSubHead");
                foreach (var headertable in headers.Select(header => GetFirstParentByTagName(header, "table")))
                {

                    if (headertable.InnerText.Contains("Property Address"))
                    {
                        //haven't seen one with a property address yet.
                    }

                    else if (headertable.InnerText.IsEmpty())
                    {
                        var htmlnametable = new HtmlControl(headertable);
                        var namecells = htmlnametable.Find.AllByAttributes("class=clsdetaildata");
                        var name = "";
                        if (namecells.Count > 0)
                        {
                            name = namecells[0].InnerText.UnEscapeXml();
                            if (name.Contains(","))
                            {
                                var names = name.Split(',');
                                if (names.Length > 1)
                                    lead.First = names[1];

                                lead.Last = names[0];
                            }
                            else
                                lead.Businessname = name;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                lead.Status = LeadStatus.Error;
                lead.Messages.Add(new Message() { Content = e.Message, Messagetype = MessageType.Error });
            }

            return lead;
        }
Example #44
0
 /// <summary>The focus.</summary>
 /// <param name="htmlControl">The html Control.</param>
 public abstract void Focus(HtmlControl htmlControl);
Example #45
0
    protected void Page_Init(object sender, EventArgs e)
    {
        divFilter = View.FindControl("EkActivityFeedPrefenceSelection") as HtmlControl;
        PageBuilder p = Page as PageBuilder;
        _host = Ektron.Cms.Widget.WidgetHost.GetHost(this);
        _host.LoadWidgetDataMembers();
        _host.Title = "Activity Stream";

        string sitepath = new CommonApi().SitePath;
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        JS.RegisterJSInclude(this, sitepath + "widgets/ActivityStream/js/jquery.autocomplete.js", "EktronWidgetAutocompleteJS");
        JS.RegisterJSInclude(this, sitepath + "widgets/ActivityStream/js/activityStream.js", "EktronWidgetActivityStreamJS");
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronInputLabelJS);
        JS.RegisterJSBlock(this, String.Format("Ektron.Widgets.ActivityFeed.Init('{0}', '{1}');", View.FindControl("query").ClientID, ClientID), ClientID + "JS");
        Css.RegisterCss(this, sitepath + "widgets/ActivityStream/css/activityStream.css", "EktronAFWidgetCSS");
        Css.RegisterCss(this, sitepath + "widgets/ActivityStream/css/activityStream.ltIE7.css", "EktronAFWidgetIE7CSS", Css.BrowserTarget.LessThanEqualToIE7);
        Css.RegisterCss(this, sitepath + "widgets/ActivityStream/css/activityStream.IE6.css", "EktronAFWidgetIE6CSS", Css.BrowserTarget.IE6);

        hdnClientId.Value = this.ClientID;

        _host.Maximize += new MaximizeDelegate(delegate() { Visible = true; });
        _host.Minimize += new MinimizeDelegate(delegate() { Visible = false; });
        _host.Edit += new EditDelegate(EditEvent);
        _host.Create += new CreateDelegate(delegate() { EditEvent(""); });
        if (!(_host.IsEditable))
        {
            btnFilter.Visible = false;
        }
        if (p != null)
        {
            btnFilter.Visible = false;
        }
        else
        {
            checkDashboard();
        }
        SetProperties();
        PreRender += new EventHandler(delegate(object PreRenderSender, EventArgs Evt) {
            if (ViewSet.GetActiveView() != Edit) SetActivityFeed();
        });
        ViewSet.SetActiveView(View);
        if (p == null)
        {
            rowobjectid.Visible = false;
            rowfeedtype.Visible = false;
            cmsActivityFeed.DynamicObjectParameter = "id,groupid,profileid";
            LoadFriendGroupList();
            UpdateFriends();
        }
        if (Page.IsCallback && Preferences.Count > 0)
        {

            if (Request.Form[UniqueID + "$hdnCurrentPageNumber"] != null)
            {
                string pageNumber = Request.Form[UniqueID + "$hdnCurrentPageNumber"].ToString();
                currentPageNumber = String.IsNullOrEmpty(pageNumber) ? 1 : Int32.Parse(pageNumber);
            }
            SetActivityFeed();

        }
    }
        private static void PrintPreview(Page page, WebControl ctrlWeb, HtmlControl ctrlHtml, string title, string theme, bool runCustomHideScript, GridView grid, string removeColumns, params string[] divIDs)
        {
            string script =
                @"  
                function getPrint(pp, print_area, gridViewID, removeColumns, runCustomHideScript)
                {
                    var strArray = print_area.split("","");
                    pp.document.writeln(""<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"");
                    pp.document.writeln(""<html xmlns='http://www.w3.org/1999/xhtml'>"");
                    pp.document.writeln(""<HEAD>"");
                    pp.document.writeln(""<link href='../App_Themes/" +
                theme + "/" + theme +
                @".css' type='text/css' rel='stylesheet' /><\/link>"");                    
                    pp.document.writeln(""<title>" +
                title +
                @"<\/title>"");                    
                    pp.document.writeln(""<base target='_self'>"");
                    pp.document.writeln(""<script type='text/javascript'>"");
                    pp.document.writeln(""function expandTA(ta) {"");
                    pp.document.writeln(""try {"");
                    pp.document.writeln(""var minRows = ta.minRows != null ? ta.minRows : 1;"");
                    pp.document.writeln(""while (ta.rows > minRows && ta.scrollHeight < ta.offsetHeight){"");
	                pp.document.writeln(""ta.rows--;"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""var h=0;"");
                    pp.document.writeln(""while (ta.scrollHeight > ta.offsetHeight && h!==ta.offsetHeight)"");
                    pp.document.writeln(""{"");
	                pp.document.writeln(""h=ta.offsetHeight;"");
	                pp.document.writeln(""ta.rows++;"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""ta.rows++;"");          
                    pp.document.writeln(""}"");
                    pp.document.writeln(""catch (ex) { }"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""function expandAllTA() {"");
                    pp.document.writeln(""try {"");
                    pp.document.writeln(""var items = document.getElementsByTagName('textarea');"");
                    pp.document.writeln(""for (var i = 0; i < items.length; i++) {"");
                    pp.document.writeln(""expandTA(items[i]);"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""catch (ex) { }"");
                    pp.document.writeln(""}"");   
                    pp.document.writeln(""<\/script"");
                    pp.document.writeln(""<\/HEAD>"");
                    pp.document.writeln(""<body MS_POSITIONING='GridLayout' bottomMargin='0'"");
                    pp.document.writeln(""leftMargin='0' topMargin='0' rightMargin='0'>"");
                    pp.document.writeln(""<form method='post'>"");
                    //Writing print area of the calling page
                    var columns = removeColumns.split("","");
                    var grid = document.getElementById(gridViewID);
                    if(grid != null)
                    {
                        for(var i = 0; i < grid.rows.length; i++)
                        {
                            for(var j = columns.length-1; j >= 0; j--)
                            {
                                grid.rows[i].deleteCell(Number(columns[j]));                                                                 
                            }
                        }
                    }
                    for(var i=0; i<strArray.length;i++) 
                    {
                        if(document.getElementById(strArray[i]) != null)
                        {
                            pp.document.writeln(document.getElementById(strArray[i]).innerHTML);
                        }
                    }
                    function expandTA1(ta) 
                    {
                        try {
                            var minRows = ta.minRows != null ? ta.minRows : 1;
                            while (ta.rows > minRows && ta.scrollHeight < ta.offsetHeight){
	                            ta.rows--;
                            }
                            var h=0;
                            while (ta.scrollHeight > ta.offsetHeight && h!==ta.offsetHeight)
                            {
	                            h=ta.offsetHeight;
	                            ta.rows++;
                            }
                            ta.rows++;
                        }
                        catch (ex) 
                        {
                        }
                    }
                    function expandAllTA1() {
                        try {
                            var items = document.getElementsByTagName(""textarea"");
                            for (var i = 0; i < items.length; i++) {
                                expandTA1(items[i]);
                            }
                        }
                        catch (ex) 
                        {
                        }
                    }
                    expandAllTA1(); 
                    pp.document.writeln(""<script type='text/javascript'>"");
                    pp.document.writeln(""var spans = document.getElementsByTagName('span');"");
                    pp.document.writeln(""for (var i = 0; i < spans.length; i++) {"");
                    pp.document.writeln(""spans[i].style.color = 'black'"");
                    pp.document.writeln(""}"");
                    pp.document.writeln(""expandAllTA();"");
                    if(runCustomHideScript == ""true"")
                    {
                        pp.document.writeln(""try{hideFromPrint();}catch(ex){}"");
                    }
                    pp.document.writeln(""if (window.print) {setTimeout('window.print();', 2000); }"");
                    pp.document.writeln(""<\/script"");
                    pp.document.writeln(""<\/form>"");
                    pp.document.writeln(""<\/body>"");
                    pp.document.writeln(""<\/HTML>"");
                } 
                ";

            if (!page.ClientScript.IsClientScriptBlockRegistered("getPrint_script"))
            {
                page.ClientScript.RegisterStartupScript(typeof(Page), "getPrint_script", script + "\r\n", true);
            }
            string divID = "";

            foreach (string s in divIDs)
            {
                divID += s + ",";
            }
            divID = divID.Length > 0 ? divID.Substring(0, divID.Length - 1) : "";
            string gridID      = (grid != null ? grid.ClientID : null);
            string columns     = (removeColumns != null ? removeColumns : "");
            string eventName   = "onClick";
            string eventScript = "var pp = window.open();getPrint(pp, \"" + divID + "\", \"" + gridID + "\", \"" + columns + "\", \"" + (runCustomHideScript ? "true" : "false") + "\");return false;";

            if (ctrlWeb != null)
            {
                EventJS.SetWebControlEvent(ctrlWeb, eventName, eventScript);
            }
            else if (ctrlHtml != null)
            {
                EventJS.SetWebControlEvent(ctrlHtml, eventName, eventScript);
            }
        }
 public void ChooseModule(HtmlControl htmlElement)
 {
     htmlElement.Click();
 }
Example #48
0
 /// <summary>The mouse over.</summary>
 /// <param name="htmlControl">The html Control.</param>
 public abstract void MouseOver(HtmlControl htmlControl);
 /// <summary>
 /// Adds the specified JavaScript to the specified event handler of the specified control. Do not pass null for script. Use JsWritingMethods constants for events.
 /// To add an onsubmit event, use ClientScript.RegisterOnSubmitStatement instead.
 /// A semicolon will be added to the end of the script.
 /// </summary>
 public static void AddJavaScriptEventScript(this HtmlControl control, string jsEventConstant, string script)
 {
     control.Attributes[jsEventConstant] += script + ";";
 }
 /// <summary>
 /// Used to apply class attribute to HtmlControls. Ensures that no empty classes are applied;
 /// </summary>
 /// <param name="control"></param>
 /// <param name="cssClass"></param>
 private static void ApplyCssClass(HtmlControl control, string cssClass)
 {
     if (!String.IsNullOrEmpty(cssClass))
     {
         control.Attributes.Add("class", cssClass);
     }
 }
Example #51
0
    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
        if (visit == null) return;

        frame = (HtmlControl)this.FindControl("FrmArea");
        switch (e.Tab.Value)
        {
            case "general":
                frame.Attributes["src"] = String.Format("OphVisitForm.aspx?VisitId={0}&Type=InTab",visit.VisitId);
                break;
            case "motappend":
                frame.Attributes["src"] = String.Format("MotAppendForm.aspx?OphVisitId={0}&Type=InTab", visit.VisitId);
                break;
            case "antsegment":
                frame.Attributes["src"] = String.Format("AntSegmentForm.aspx?OphVisitId={0}&Type=InTab", visit.VisitId);
                break;
            case "fundus":
                frame.Attributes["src"] = String.Format("FundusForm.aspx?OphVisitId={0}&Type=InTab", visit.VisitId);
                break;
            case "diagnosticassigned":
                frame.Attributes["src"] = String.Format("DiagnosticAssignedGrid.aspx?VisitId={0}&Type=InTab" , visit.VisitId);
                break;
            case "treatment":
                frame.Attributes["src"] = String.Format("TreatmentGrid.aspx?VisitId={0}&Type=InTab" , visit.VisitId);
                break;
            case "examination":
                frame.Attributes["src"] = String.Format("ExaminationAssignedGrid.aspx?VisitId={0}&Type=InTab" , visit.VisitId);
                break;
            case "labtestassigned":
                frame.Attributes["src"] = String.Format("LabTestAssignedGrid.aspx?VisitId={0}&Type=InTab" , visit.VisitId);
                break;
            case "procedureassigned":
                frame.Attributes["src"] = String.Format("ProcedureAssignedGrid.aspx?VisitId={0}&Type=InTab", visit.VisitId);
                break;
        }
    }
Example #52
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null != Request.QueryString["positionlabel"])
            {
                getPositionName = (Request.QueryString["positionlabel"]).ToLower();
            }
            Response response = AmazonDynamoDBIdentityTable.Instance.GetAllDataInDynamoDb();
            List <IdentityDataModel> Identities = response.IdentityDataModel;
            int itemnmber = 0;

            if (null != Identities)
            {
                foreach (IdentityDataModel Identity in Identities)
                {
                    IdentityDataModel identity = Identity;
                    identity = AmazonDynamoDBIdentityTable.Instance.ConvertToTitleCase(identity);
                    var tr = new HtmlTableRow();
                    tr.ID = identity.Email;
                    HtmlTableCell      checkbox = new HtmlTableCell();
                    HtmlGenericControl element  = new HtmlGenericControl("input");
                    element.Attributes.Add("type", "checkbox");
                    element.Attributes.Add("name", "chkbox[]");
                    element.Attributes.Add("runat", "server");
                    element.Attributes.Add("id", identity.Email + "checkbox");
                    element.Attributes.Add("onchange", "checkAll(this,'" + identity.Email + "')");
                    checkbox.Controls.Add(element);
                    checkbox.Attributes.Add("class", "tablecolumn");
                    tr.Cells.Add(checkbox);

                    HtmlTableCell affiliate = new HtmlTableCell();
                    affiliate.InnerText = identity.Affiliate;
                    affiliate.Attributes.Add("class", "tablecolumn");
                    tr.Cells.Add(affiliate);
                    HtmlTableCell name = new HtmlTableCell();
                    name.InnerText = identity.FirstName + " " + identity.LastName;
                    name.Attributes.Add("class", "tablecolumn");
                    tr.Cells.Add(name);
                    HtmlTableCell email = new HtmlTableCell();
                    email.InnerText = identity.Email;
                    email.Attributes.Add("class", "tablecolumn");
                    tr.Cells.Add(email);
                    HtmlTableCell country = new HtmlTableCell();
                    country.ID        = identity.CountryOfResidence + itemnmber;
                    country.InnerText = identity.CountryOfResidence;
                    country.Attributes.Add("class", "tablecolumn");
                    tr.Cells.Add(country);


                    //HtmlAnchor _edit = new HtmlAnchor();
                    //_edit.HRef = "#";
                    //_edit.Attributes.CssStyle.Add("margin-left", "0px");
                    //HtmlImage editimage = new HtmlImage();
                    //editimage.Attributes.Add("src", "../Images/edit.png");
                    //editimage.Attributes.CssStyle.Add("width", "15px");
                    //_edit.Controls.Add(editimage);
                    //_edit.Attributes.Add("onclick", "editCustomTaskValue('" + email.InnerText + "')");
                    //_edit.Attributes.Add("id", "edit" + email.InnerText);
                    //HtmlAnchor _delete = new HtmlAnchor();
                    //_delete.HRef = "#";
                    //_delete.Attributes.CssStyle.Add("margin-left", "30%");
                    //HtmlImage deleteimage = new HtmlImage();
                    //deleteimage.Attributes.Add("src", "../Images/delete.png");
                    //deleteimage.Attributes.CssStyle.Add("width", "30px");
                    //_delete.Attributes.Add("onclick", "deleteCustomTaskValue('" + email.InnerText + "')");
                    //_delete.Attributes.Add("id", "delete" + email.InnerText);
                    //_delete.Controls.Add(deleteimage);
                    //HtmlTableCell actioncell = new HtmlTableCell();
                    //actioncell.Controls.Add(_edit);
                    //actioncell.Controls.Add(_delete);
                    //actioncell.Attributes.Add("class", "tablecolumn");
                    //tr.Cells.Add(actioncell);

                    taskIdentities.Rows.Add(tr);
                    foreach (WebsiteDataModel website in identity.WebsiteDataModel)
                    {
                        var item = selectwebsite.Items.FindByText(website.WebsiteName);
                        if (null == item)
                        {
                            selectwebsite.Items.Add(website.WebsiteName);
                        }
                    }
                    itemnmber++;
                }

                if (null != getPositionName)
                {
                    response = AmazonDynamoDBPositionTable.Instance.GetDataInDynamoDb(getPositionName);
                    if (null != (response.PositionData))
                    {
                        positionData = response.PositionData.FirstOrDefault();
                        positionData = AmazonDynamoDBPositionTable.Instance.ConvertToTitleCase(positionData);
                        //find identity from azure table and render content in fields.
                        positionlabel.Value   = positionData.PositionLabel;
                        selectselection.Value = positionData.SelectSelection;
                        starttime.Value       = positionData.StartTime;
                        endtime.Value         = positionData.EndTime;
                        startdate.Value       = positionData.StartDate;
                        enddate.Value         = positionData.EndDate;
                        int tasknumber = 3;
                        for (int j = 0; j < positionData.SelectTasks.Count; j++)
                        {
                            if (null != positionData.SelectTasks[j] && j == 0)
                            {
                                step1.Value = positionData.SelectTasks[j];
                            }
                            if (null != positionData.SelectTasks[j] && j == 1)
                            {
                                step2.Value = positionData.SelectTasks[j];
                            }
                            if (null != positionData.SelectTasks[j] && j == 2)
                            {
                                step3.Value = positionData.SelectTasks[j];
                            }
                            if (j > 2)
                            {
                                tasknumber++;
                                HtmlTableRow  tRow = new HtmlTableRow();
                                HtmlTableCell tb1  = new HtmlTableCell();
                                tb1.InnerText = tasknumber.ToString() + ".";
                                tRow.Controls.Add(tb1);
                                HtmlTableCell      tb2          = new HtmlTableCell();
                                HtmlGenericControl inputelement = new HtmlGenericControl("input");
                                inputelement.Attributes.Add("type", "text");
                                inputelement.Attributes.Add("name", "step" + tasknumber);
                                inputelement.Attributes.Add("value", positionData.SelectTasks[j]);
                                inputelement.Attributes.Add("id", "step" + tasknumber);
                                inputelement.Style.Add("width", "80%");
                                inputelement.Style.Add("height", "10%");
                                tb2.Style.Add("width", "80%");
                                tb2.Style.Add("height", "10%");
                                tb2.Controls.Add(inputelement);
                                tRow.Controls.Add(tb2);
                                task.Rows.Add(tRow);
                            }
                        }
                        for (int j = 0; j < positionData.SelectCountries.Count; j++)
                        {
                            HtmlGenericControl iDiv = new HtmlGenericControl("div");
                            iDiv.Attributes.Add("id", positionData.SelectCountries[j]);
                            iDiv.Attributes.Add("class", "form-control");
                            iDiv.Attributes.CssStyle.Add("height", "auto");
                            iDiv.InnerHtml = positionData.SelectCountries[j] + "&nbsp<button class=\"glyphicon glyphicon-remove\" style=\"display:inline;background-color:white\" onclick=\"deleteCountry(\'" + positionData.SelectCountries[j] + "\')\" />";
                            addcountry.Controls.Add(iDiv);
                        }
                        notes.Value = positionData.Note.ToString();
                        ListItem Selectedwebsite = selectwebsite.Items.FindByText(positionData.PositionWebsite);
                        if (null == Selectedwebsite)
                        {
                            selectwebsite.Items.Add(positionData.PositionWebsite);
                            Selectedwebsite = selectwebsite.Items.FindByText(positionData.PositionWebsite);
                        }
                        Selectedwebsite.Selected = true;
                        List <string> selectedIdentities = new List <string>();
                        int           i = 0;
                        for (var j = 1; j < taskIdentities.Rows.Count; j++)
                        {
                            foreach (var positionEmail in positionData.SelectedIdentities)
                            {
                                var row = taskIdentities.Rows[j];
                                if (row.ID == positionEmail)
                                {
                                    var htmlcontrol = row.Cells[0];
                                    //foreach ( HtmlTableCell item in row.Cells )
                                    //    {
                                    HtmlControl object1 = (HtmlControl)row.Cells[0].Controls[0];
                                    if (null != object1)
                                    {
                                        object1.Attributes.Add("checked", "checked");
                                        if (!(selectedIdentities.Contains(positionEmail)))
                                        {
                                            selectedIdentities.Add(positionEmail);
                                            i++;
                                            break;
                                        }
                                    }
                                    //}
                                }
                            }    //foreach 2nd
                        }
                    }
                    Count = Identities.Count;
                }
                countDiv.InnerText = DashBoard.Count.ToString();
            }
        }
        public IList<Lead> ProcessMultiple()
        {
            IList<Element> details = _find.AllByAttributes("href=~javascript:goNextSubmit('sr"); // _find.AllByCustom(e => e.Content.Contains("INTERNAL REVENUE"));

            foreach (var element in details)
            {
                var lead = new Lead();
                try
                {
                    _main.Actions.Click(element);
                    //moves browser forward 1

                    _main.Actions.InvokeScript(@"goNextSubmit('sr',1)");
                    //moves broswer forward 1

                    ///html/body/table[2]/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2]/form/div/table/tbody/tr[3]/td/table/tbody/tr[3]/td/table

                    var filingelement = _find.ByTagIndex("table", 7);
                    var htmlfilingelement = new HtmlControl(filingelement);

                    var fnumber = htmlfilingelement.Find.ByXPath("//tr[2]/td[1]");
                    if (fnumber != null)
                    {
                        lead.Id = fnumber.InnerText.Substring(0, fnumber.InnerMarkup.ToLower().IndexOf("<br>"));
                    }
                    var date = htmlfilingelement.Find.ByXPath("//tr[2]/td[3]");
                    if (date != null)
                        lead.Recordeddate = date.InnerText;

                    //var imagelink = htmlfilingelement.Find.ByXPath("//tr[2]/td[5]");
                    var imagelink = _find.ByAttributes("href=~javascript:goNextSubmit('sr");

                    //get name
                    // /html/body/table[2]/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2]/form/div/table/tbody/tr[5]/td/table/tbody/tr[3]/td/table/tbody/tr[2]/td

                    var nameelement = _find.ByXPath("//html/body/table[2]/tbody/tr[2]/td/table/tbody/tr[2]/td/table/tbody/tr[4]/td[2]/form/div/table/tbody/tr[5]/td/table/tbody/tr[3]/td/table/tbody/tr[2]/td");
                    if (nameelement != null)
                    {
                        var a =new string[1] ;
                        a[0] = "<br>";
                        string[] split = nameelement.InnerMarkup.ToLower().Split(a, StringSplitOptions.None);

                        if (split.Length == 3)
                        {
                            var name = split[0];
                            if (name.Contains(","))
                            {
                                var names = name.Split(',');
                                if (names.Length > 1)
                                {
                                    if (names[0].Split(' ').Length > 1)
                                        lead.Businessname = name;
                                    else
                                    {
                                        lead.First = names[1];
                                        lead.Last = names[0];
                                    }
                                }
                                else
                                    lead.Businessname = name;
                            }
                            else
                                lead.Businessname = name;

                            lead.Address.Streetaddress1 = split[1];

                            //city, co zip

                            var ad2 = split[2];

                            var s2 = ad2.Split(',');
                            if (s2.Length == 2)
                            {
                                lead.Address.City = s2[0];
                                var s3 = s2[1].Split(' ');

                                if (s3.Length == 2)
                                {
                                    lead.Address.State = s3[0];
                                    lead.Address.Zip = s3[1];
                                }
                            }
                        }
                    }

                    if (imagelink != null)
                    {
                        lead.Document.Url = imagelink.InnerText;
                        if (GetDocument(imagelink, ref lead))
                        {
                            lead.Document.Disklocation = _imagelocation;
                            PerformOCR(ref lead,LeadType.Federal);
                        }
                    }

                    _main.GoBack();
                    _main.GoBack();

                }
                catch (Exception ex)
                {
                    lead.Messages.Add(new Message() { Content = ex.Message, Messagetype = MessageType.Error });
                }
                _leads.Add(lead);
            }
            return _leads;
        }
 public static void PrintPreview(Page page, HtmlControl ctrl, string title, string theme, params string[] divIDs)
 {
     PrintPreview(page, ctrl, title, theme, false, null, "", divIDs);
 }
Example #55
0
 protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
 {
     frame = (HtmlControl)this.FindControl("FrmArea");
     int idx = e.Tab.Index;
     switch (e.Tab.Value)
     {
         case "HA":
             frame.Attributes["src"] = String.Format("PolicyGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "HC":
             frame.Attributes["src"] = String.Format("VisitGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                     , pat.PersonId);
             break;
         case "patient":
             frame.Attributes["src"] = String.Format("PatientForm.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "policy":
             frame.Attributes["src"] = String.Format("PolicyGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "ticket":
             frame.Attributes["src"] = String.Format("TicketGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "servnote":
             frame.Attributes["src"] = String.Format("ServiceNoteGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "anesnote":
             frame.Attributes["src"] = String.Format("AnestheticServiceNoteGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "invoice":
             frame.Attributes["src"] = String.Format("InvoiceGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "payment":
             frame.Attributes["src"] = String.Format("PaymentGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "appointment":
             frame.Attributes["src"] = String.Format("AppointmentGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "docs":
             frame.Attributes["src"] = String.Format("DocumentsPatient.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "diagnosticassigned":
             frame.Attributes["src"] = String.Format("DiagnosticAssignedGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "treatment":
             frame.Attributes["src"] = String.Format("TreatmentGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "examination":
             frame.Attributes["src"] = String.Format("ExaminationAssignedGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "labtestassigned":
             frame.Attributes["src"] = String.Format("LabTestAssignedGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "procedureassigned":
             frame.Attributes["src"] = String.Format("ProcedureAssignedGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "visit":
             frame.Attributes["src"] = String.Format("VisitGrid.aspx?PatientId={0}&Type=InTab&CustomerId=" + customerId
                                                     , pat.PersonId);
             break;
         case "previousmedicalrecord":
             frame.Attributes["src"] = String.Format("PreviousMedicalrecordForm.aspx?PatientId={0}&Type=InTab", pat.PersonId);
             break;
         case "backpersonal": 
         case "backgrounds":
             frame.Attributes["src"] = String.Format("BackPersonalForm.aspx?PatientId={0}&Type=InTab", pat.PersonId);
             break;
         case "backfamily":
             frame.Attributes["src"] = String.Format("BackFamilyForm.aspx?PatientId={0}&Type=InTab", pat.PersonId);
             break;
         case "backginecology":
             frame.Attributes["src"] = String.Format("BackGinecologyForm.aspx?PatientId={0}&Type=InTab", pat.PersonId);
             break;
     }
 }
 public static void PrintPreview(Page page, HtmlControl ctrl, string title, string theme, bool runCustomHideScript, params string[] divIDs)
 {
     PrintPreview(page, ctrl, title, theme, runCustomHideScript, null, "", divIDs);
 }
 private void HideControl(HtmlControl ctrl)
 {
     ctrl.Style["visibility"] = "hidden";
     ctrl.Style["display"] = "none";
 }
 public static void PrintPreview(Page page, HtmlControl ctrl, string title, string theme, bool runCustomHideScript, GridView grid, string removeColumns, params string[] divIDs)
 {
     PrintPreview(page, null, ctrl, title, theme, runCustomHideScript, grid, removeColumns, divIDs);
 }
Example #59
0
    /// <summary>
    /// Sets the step contorls.
    /// </summary>
    /// <param name="lblStepName">Name of the LBL step.</param>
    /// <param name="divStep">The div step.</param>
    /// <param name="step">The step.</param>
    /// <param name="visited">if set to <c>true</c> [visited].</param>
    private void SetStepControls(Label lblStepName, HtmlControl divStep, WizardStep step, bool visited)
    {
        if (lblStepName != null)
        {
            lblStepName.Text = step.Title;
            if (wzdDeDup.ActiveStep.ID == step.ID)
            {
                lblStepName.CssClass = "lblWizardActive";
                lblStepName.Enabled = true;
            }
            else
            {
                if (visited)
                {
                    lblStepName.CssClass = "lblWizardVisited";
                    lblStepName.Enabled = true;
                }
                else
                {
                    lblStepName.CssClass = "lblWizardNotVisited";
                    lblStepName.Enabled = false;
                }
            }
        }

        if (divStep != null)
        {
            if (wzdDeDup.ActiveStep.ID == step.ID)
                divStep.Attributes.Add("class", "wizardActive");
            else
            {
                divStep.Attributes.Add("class", visited ? "wizardVisited" : "wizardNotVisited");
            }
        }
    }
 public static void PrintPreview(Page page, HtmlControl ctrl, string title, string theme, GridView grid, string removeColumns, params string[] divIDs)
 {
     PrintPreview(page, null, ctrl, title, theme, false, grid, removeColumns, divIDs);
 }