示例#1
0
        public void SetCountry(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(CountryDropDwn, value);
        }
示例#2
0
 public void SelectEthnicity(string ethnicity)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageEthnicityInd, ethnicity);
 }
 // GET: Cities/Create
 public ActionResult Create()
 {
     ViewBag.DepartamentId = new SelectList(DropDownHelper.GetDepartaments(), "DepartamentId", "Name");
     ViewBag.ProvinceId    = new SelectList(DropDownHelper.GetProvinces(), "ProvinceId", "Name");
     return(View());
 }
示例#4
0
 public void SelectMaritalStatus(string status)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageMaritalStatusInd, status);
 }
示例#5
0
 public void SelectCitizenStatus(string citizenStatus)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageCitizenStatusInd, citizenStatus);
 }
示例#6
0
        private void BindDropDownControls()
        {
            var countryRepository = IoC.Resolve <ICountryRepository>();
            var countries         = countryRepository.GetAll();

            ddlCountry.DataSource     = countries;
            ddlCountry.DataTextField  = "Name";
            ddlCountry.DataValueField = "Id";
            ddlCountry.DataBind();
            ddlCountry.Items[0].Selected = true;
            //ddlCountry.Items.Insert(0, new ListItem("Select Country", "0"));

            var races = Race.None.GetNameValuePairs();

            ddlrace.Items.Clear();
            ddlrace.DataSource     = races;
            ddlrace.DataTextField  = "SecondValue";
            ddlrace.DataValueField = "FirstValue";
            ddlrace.DataBind();

            MarketingSourceDropDown.Items.Clear();
            var marketingSourceService = IoC.Resolve <IMarketingSourceService>();
            var marketingSources       = marketingSourceService.FetchMarketingSourceByZip(ZipCode);

            MarketingSourceDropDown.DataSource = marketingSources;
            MarketingSourceDropDown.DataBind();
            MarketingSourceDropDown.Items.Insert(0, new ListItem("", ""));

            BestTimeToCallDropdown.Items.Clear();
            var bestTimeToCallTypes = BestTimeToCall.Morning.GetNameValuePairs();

            BestTimeToCallDropdown.DataSource     = bestTimeToCallTypes;
            BestTimeToCallDropdown.DataTextField  = "SecondValue";
            BestTimeToCallDropdown.DataValueField = "FirstValue";
            BestTimeToCallDropdown.DataBind();
            BestTimeToCallDropdown.Items.Insert(0, (new ListItem("--Select--", "0")));

            PreferredLanguageDropDown.Items.Clear();
            var languageRepository = IoC.Resolve <ILanguageRepository>();
            var languages          = languageRepository.GetAll().OrderBy(x => x.Name);

            PreferredLanguageDropDown.DataSource     = languages;
            PreferredLanguageDropDown.DataTextField  = "Name";
            PreferredLanguageDropDown.DataValueField = "Id";
            PreferredLanguageDropDown.DataBind();
            PreferredLanguageDropDown.Items.Insert(0, (new ListItem("--Select--", "0")));
            PreferredLanguageDropDown.Items[0].Selected = true;

            ddlPreferredContactType.Items.Clear();
            var lookupReporsitory     = IoC.Resolve <ILookupRepository>();
            var preferredContactTypes = lookupReporsitory.GetByLookupId((long)PreferredContactType.Email);

            ddlPreferredContactType.DataSource     = preferredContactTypes.OrderBy(x => x.DisplayName);
            ddlPreferredContactType.DataTextField  = "DisplayName";
            ddlPreferredContactType.DataValueField = "Id";
            ddlPreferredContactType.DataBind();

            ddlPreferredContactType.Items.Insert(0, new ListItem("--Select--", "0"));

            ddlPatientConsentPrimary.Items.Clear();
            var consentDropDown = DropDownHelper.GetPatientPhoneConsent();

            ddlPatientConsentPrimary.DataSource     = consentDropDown;
            ddlPatientConsentPrimary.DataTextField  = "Text";
            ddlPatientConsentPrimary.DataValueField = "Value";
            ddlPatientConsentPrimary.DataBind();

            ddlPatientConsentOffice.Items.Clear();
            ddlPatientConsentOffice.DataSource     = consentDropDown;
            ddlPatientConsentOffice.DataTextField  = "Text";
            ddlPatientConsentOffice.DataValueField = "Value";
            ddlPatientConsentOffice.DataBind();

            ddlPatientConsentCell.Items.Clear();
            ddlPatientConsentCell.DataSource     = consentDropDown;
            ddlPatientConsentCell.DataTextField  = "Text";
            ddlPatientConsentCell.DataValueField = "Value";
            ddlPatientConsentCell.DataBind();
        }
示例#7
0
        public void DeleteClientOrProject(IQueryable <PROJECT> project, string type, int id)
        {
            // Delete all projects and child records associated with passed paramater project
            foreach (var p in project)
            {
                var labourSummary = db.LABOUR_SUMMARY
                                    .Where(labID => labID.projectID == p.ID);

                foreach (var l in labourSummary)
                {
                    int            lsID = l.ID;
                    LABOUR_SUMMARY ls   = db.LABOUR_SUMMARY.Find(lsID);
                    db.LABOUR_SUMMARY.Remove(ls);
                }

                var materialRequirement = db.MATERIAL_REQ
                                          .Where(matID => matID.projectID == p.ID);

                foreach (var m in materialRequirement)
                {
                    int          mID = m.ID;
                    MATERIAL_REQ mr  = db.MATERIAL_REQ.Find(mID);
                    db.MATERIAL_REQ.Remove(mr);
                }

                var labourRequirement = db.LABOUR_REQUIREMENT
                                        .Where(lrID => lrID.projectID == p.ID);

                foreach (var l in labourRequirement)
                {
                    int lID = l.ID;
                    LABOUR_REQUIREMENT lr = db.LABOUR_REQUIREMENT.Find(lID);
                    db.LABOUR_REQUIREMENT.Remove(lr);
                }

                var prodTeam = db.PROD_TEAM
                               .Where(ptID => ptID.projectID == p.ID);

                foreach (var pts in prodTeam)
                {
                    int       pteamID = pts.ID;
                    PROD_TEAM pt      = db.PROD_TEAM.Find(pteamID);
                    db.PROD_TEAM.Remove(pt);

                    var teamMember = db.TEAM_MEMBER
                                     .Where(tmID => tmID.teamID == pts.ID);

                    foreach (var ptm in teamMember)
                    {
                        int         teamMemberID = ptm.Id;
                        TEAM_MEMBER tm           = db.TEAM_MEMBER.Find(teamMemberID);
                        db.TEAM_MEMBER.Remove(tm);
                    }
                }
                db.PROJECTs.Remove(p);
            }
            if (type == "Client")
            {
                try
                {
                    //delete an existing record
                    CLIENT c = db.CLIENTs.Find(id);
                    db.CLIENTs.Remove(c);
                    db.SaveChanges();
                    DropDownHelper.PopulateClientList(ddlClientList);
                    deletedClient    = c.cliName;
                    deleteClientFlag = true;
                    Response.Redirect("~/Main.aspx", false);
                }
                catch (DataException dx)
                {
                    NotifyJS.DisplayNotification(this.Page, dx.InnerException.InnerException.Message, "danger");
                }
            }
            else
            {
                try
                {
                    db.SaveChanges();
                    Response.Redirect("~/Main.aspx", false);
                }
                catch (DataException dx)
                {
                    NotifyJS.DisplayNotification(this.Page, dx.InnerException.InnerException.Message, "danger");
                }
            }
        }
 public void SelectItemPerList(string number)
 {
     DropDownHelper.SelectItemPerList(number);
     GenericHelper.WaitForLoadingMask();
 }
 public void VerifyAddProgramIncentiveGrid(string gridXpath, string actvityCode, string descp, string activityType, string points)
 {
     DropDownHelper.SelectItemPerList("100");
     GridHelper.VerifyIncentiveGridEntry(gridXpath, actvityCode, descp, activityType, points);
 }
示例#10
0
        public void SetDamageInsurance(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(DamageInsuranceDropDwn, value);
        }
示例#11
0
        public void SetCourtesuCar(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(CourtesyCarDropDwn, value);
        }
示例#12
0
        public void SetMeritRating(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(MeritRatingDropDwn, value);
        }
示例#13
0
        public void SetInsuranceSum(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(InsuranceSunDropDwn, value);
        }
示例#14
0
        public void SetOccupation(string value)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(OccupationDropDwn, value);
        }
示例#15
0
 public void SelectPassenger()
 {
     DropDownHelper.SelectByValue(By.Name("passCount"), "2");
 }
示例#16
0
        public static void ExecuteScript(IPage pageObject, string xlPath, string sheetName)
        {
            var totalRow = ExcelReaderHelper.GetTotalRows(xlPath, sheetName);

            for (var i = 2; i < totalRow; i++)
            {
                var action = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 1);
                var webEle = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 2);

                if ((webEle == string.Empty) && (action == string.Empty))
                {
                    break;
                }

                if (webEle == string.Empty)
                {
                    continue;
                }

                var locator = pageObject.GetLocatorOfWebElement(webEle);
                Console.WriteLine("Action {0}, WebElement {1}, Locator {2} ", action, webEle, locator);
                switch (action)
                {
                case "SendKeys":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    TextBoxHelper.TypeInTextBox(locator, text);
                }
                break;

                case "ClearAndSendKeys":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    TextBoxHelper.ClearTextBox(locator);
                    TextBoxHelper.TypeInTextBox(locator, text);
                }
                break;

                case "Click":
                {
                    ButtonHelper.ClickButton(locator);
                }
                break;

                case "ClickIfExist":
                {
                    if (GenericHelper.IsElementPresentQuick(locator))
                    {
                        ButtonHelper.ClickButton(locator);
                    }
                }
                break;

                case "Select":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    DropDownHelper.SelectByVisibleText(locator, text);
                }
                break;

                case "SelectIndex":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    DropDownHelper.SelectByIndex(locator, Convert.ToInt32(text));
                }
                break;

                case "WaitForEle":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    if (text == string.Empty)
                    {
                        GenericHelper.WaitForElement(locator);
                    }
                    else
                    {
                        GenericHelper.WaitForElement(locator, Convert.ToInt32(text));
                    }
                }
                break;

                case "Sleep":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    Thread.Sleep(Convert.ToInt32(text));
                }
                break;

                case "SelectFile":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    pageObject.FileUpload(text);
                }
                break;

                case "AssertTitle":
                {
                    var text = ExcelReaderHelper.GetCellValue(xlPath, sheetName, i, 3);
                    Assert.AreEqual(text, ObjectRepository.Driver.Title);
                }

                break;

                case "PerformClick":
                {
                    MouseActionHelper.PerformClick(locator);
                }
                break;
                }
            }
        }
示例#17
0
 // GET: Users/Create/Doctor
 public ActionResult Doctor()
 {
     ViewBag.Gender = new SelectList(DropDownHelper.GetGenders(), "Value", "Text");
     return(View());
 }
示例#18
0
 public void SelectNewClaim(string claimName)
 {
     DropDownHelper.SelectByVisibleText(SelectPrmDropDown, claimName);
     GoBtn.Click();
     GenericHelper.WaitForLoadingMask();
 }
示例#19
0
 public ActionResult Dialog()
 {
     ViewBag.LocalType = EnumHelper.GetOptions <ELocalType>(0);
     ViewBag.Storage   = DropDownHelper.GetStorage(this.DefaultStorageNum, this.CompanyID);
     return(View());
 }
 public void SelectProgram(string name)
 {
     DropDownHelper.SelectByVisibleText(ProgramName, name);
     ArrowBtn.ScrollElementAndClick();
     GenericHelper.WaitForLoadingMask();
 }
示例#21
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="gridXpath"></param>
 /// <param name="value"></param>
 /// <param name="row"></param>
 /// <param name="column"></param>
 public void VerifyCreateGroup(string gridXpath, string value, int row, int column)
 {
     DropDownHelper.SelectItemPerList("100");
     GenericHelper.WaitForLoadingMask();
     GridHelper.VerifyInGridEntry(gridXpath, value, row, column);
 }
示例#22
0
 public void SelectMacByOption()
 {
     DropDownHelper.SelectElementByIndex(_sortByOption, 3);
 }
示例#23
0
 public void SelectDependants(string noDependants)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageDependants, noDependants);
 }
示例#24
0
 public void DisplayLimit()
 {
     DropDownHelper.SelectElementByIndex(_sortByRange, 3);
 }
示例#25
0
 public void SelectRace(string race)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageRace, race);
 }
示例#26
0
 public ActionResult SaleLocation()
 {
     ViewBag.StorageNum = DropDownHelper.GetStorage(string.Empty, this.CompanyID);
     return(View());
 }
示例#27
0
 public void SelectEnglishProficiency(string englishProficiency)
 {
     DropDownHelper.SelectByVisibleText(DemographicPageEnglishProficiency, englishProficiency);
 }
示例#28
0
 public ActionResult InventoryBook()
 {
     ViewBag.StorageNum = DropDownHelper.GetStorage(string.Empty, this.CompanyID);
     return(View());
 }
示例#29
0
 public ActionResult AddProduct()
 {
     ViewBag.Location = DropDownHelper.GetLocation(this.DefaultStorageNum, string.Empty, this.CompanyID);
     return(View());
 }
示例#30
0
        public void SetFuelType(string name)

        {
            WaitHelper.ThinkTime(1);
            DropDownHelper.SelectElement(Fueltype, name);
        }