/*--------------------------DRINK----------------------------------------*/ private void LoadDrinkTypeToComboBox() { ManageList <DrinkType> listType = new ManageList <DrinkType>(); BUS_DrinkType.Instance.GetList(listType); BUS_DrinkType.Instance.LoadDrinkTypeToComboBox(listType, cbDrinkType); }
/// <summary> /// opens the references saved from a previous Reference entry /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openRefrencesFromADataFileToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = "DAT Files|*.dat"; BinaryFormatter bin = new BinaryFormatter(); if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK) { List <ManageList> binData = new List <ManageList>(); if (File.Exists(open.FileName)) { try { FileStream stream = new FileStream(open.FileName, FileMode.Open, FileAccess.Read); binData = (List <ManageList>)bin.Deserialize(stream); stream.Close(); foreach (Reference refs in ManageList.getReferenceList()) { rtxtReferences.Text += refs.formatAPA(); } // rtxtReferences.Text = ManageList.getReferenceList().ToString(); } catch { MessageBox.Show("Error reading from file"); } } } }
internal void DeleteListing(IWebDriver driver) { //Wait untill driver find Manage listing tab CommomDriver.WaitForVisibility(driver, "LinkText", "Manage Listings", 2); //click on manage list ManageList.Click(); //Wait untill Driver finds Delete button to click CommomDriver.WaitForVisibility(driver, "XPath", "(//i[@class='remove icon'])[1]", 2); //Click on Delete icon Delete.Click(); //Wait untill Driver finds pop up YES or NO button to click CommomDriver.WaitForVisibility(driver, "XPath", "//div[@class='actions']/button[2]", 2); //Click on Yes or No button ClickAuctionButton.Click(); CommomDriver.WaitForVisibility(driver, "ClassName", "ns-box-inner", 2); try { //Assert - Get the pop up text in PopUpMsg Variable. String PopUpMsg = DeletePopUp.Text; //Assert that popUp will open and has not to be null(or Emplty) Assert.NotNull(PopUpMsg); } catch (Exception e) { Console.WriteLine(e.Message); } }
private void startNewRefrenceListToolStripMenuItem_Click(object sender, EventArgs e) { ManageList.clearList(); rtxtReferences.Clear(); MessageBox.Show("References have been cleared"); }
//Sap xep nhanh giam dan public void QuickSort(ManageList <Drink> list, int left, int right) { if (left <= right) { int i = left, j = right; Drink x = list[(left + right) / 2]; while (i <= j) { while (list[i].Price > x.Price) { i++; } while (list[j].Price < x.Price) { j--; } if (i <= j) { Drink temp = list[i]; list[i] = list[j]; list[j] = temp; i++; j--; } } if (left < j) { QuickSort(list, left, j); } if (i < right) { QuickSort(list, i, right); } } }
internal void ViewListing(IWebDriver driver) { //Wait untill driver find Manage listing tab CommomDriver.WaitForVisibility(driver, "LinkText", "Manage Listings", 2); //click on Manage Listing tab ManageList.Click(); //Wait untill driver find View button CommomDriver.WaitForVisibility(driver, "XPath", "(//i[@class='eye icon'])[1]", 2); //click on view - (eye icon) View.Click(); try { //Assert that if View icon to be clicked than URl Contains "ServiceDetail" String urlTitle = driver.Title; Console.WriteLine(urlTitle); //Assertion Assert.AreEqual("Service Detail", urlTitle); } catch (Exception e) { Console.WriteLine(e.Message); } }
public override void GetList(ManageList <Account> list) { list.Clear(); foreach (DataRow row in Read().Rows) { list.Add(new Account(row)); } }
public override void GetList(ManageList <Table> list) { list.Clear(); foreach (DataRow row in Read().Rows) { list.Add(new Table(row)); } }
public void GetList(ManageList <Bill> list, string TableName) { list.Clear(); foreach (DataRow row in Read(TableName).Rows) { list.Add(new Bill(row)); } }
//Load danh sach DrinkType vao ComboBox public void LoadDrinkTypeToComboBox(ManageList <DrinkType> list, ComboBox cb) { cb.Items.Clear(); for (int i = 0; i < list.Count; i++) { cb.Items.Add(list[i].Name); } }
//Tra ve Total cua ban bat ki public float getTotal(ManageList <Table> list, string TableName) { for (int i = 0; i < list.Count; i++) { if (list[i].Name == TableName) { return(list[i].Total); } } return(0); }
//Tao ra List cac do uong co Type mong muon public void getListDrinkWithManyType(ManageList <Drink> list, ManageList <Drink> chooseDrink, ManageList <string> Type) { chooseDrink.Clear(); for (int i = 0; i < list.Count; i++) { if (Type.Contains(list[i].Type)) { chooseDrink.Add(list[i]); } } }
//Gia tien cua Do uong public float getPrice(ManageList <Drink> list, string DrinkName) { for (int i = 0; i < list.Count; i++) { if (list[i].Name == DrinkName) { return(list[i].Price); } } return(0); }
//Danh sach cac ban co the chuyen den public void getAvailableTable(ManageList <Table> list, ComboBox cb) { cb.Items.Clear(); cb.Text = ""; for (int i = 0; i < list.Count; i++) { if (list[i].Total == 0) { cb.Items.Add(list[i].Name); } } }
//Them vao combobox nhung Do uong co kieu la Type public void AddDrinkToComboBoxFromType(ManageList <Drink> list, ComboBox cb, string Type) { cb.Items.Clear(); cb.Text = ""; for (int i = 0; i < list.Count; i++) { if (list[i].Type == Type) { cb.Items.Add(list[i].Name); } } }
internal void EditListing(IWebDriver driver) { //Wait untill driver find Manage listing tab CommomDriver.WaitForVisibility(driver, "LinkText", "Manage Listings", 2); //After Viewing Skills click on ManageList to go back to Manage Listing ManageList.Click(); //Wait untill driver finf Edit button CommomDriver.WaitForVisibility(driver, "XPath", "(//i[@class='outline write icon'])[1]", 2); //Get Text from Category and Title from Manage list before Edit Aucketion String TitleBeforEdit = TitleofManage.Text; String CategoryBeforeEdit = CategoryofManage.Text; //Click on Edit icon Edit.Click(); //Random Wait CommomDriver.Wait(2); //create page object of share skill and call EnterShareSkill function //to perform Edit function in manage Listing Page ShareSkillPage ShareskillObj = new ShareSkillPage(); ShareskillObj.EnterShareSkill(driver); //Get text from Category and Title from Manage list after Edit String TitleAfterEdit = TitleofManage.Text; String CategoryAfterEdit = CategoryofManage.Text; Console.WriteLine(TitleBeforEdit); Console.WriteLine(TitleAfterEdit); Console.WriteLine(CategoryBeforeEdit); Console.WriteLine(CategoryAfterEdit); try { //Assert that text from Befor Edit and After Edit dose not have to match Assert.AreNotEqual(TitleBeforEdit, TitleAfterEdit); Assert.AreNotEqual(CategoryBeforeEdit, CategoryAfterEdit); Console.WriteLine("pass"); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Fail"); } }
/// <summary> /// reacts when the radio buttons selected button is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rbtnViewMLA_CheckedChanged(object sender, EventArgs e) { string References = ""; if (rbtnViewMLA.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatMLA() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } if (rbtnViewAPA.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatAPA() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } if (rbtnViewLibMed.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatLibMed() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } }
private void btnAddtoReferenceList_Click(object sender, EventArgs e) { btnAddAnotherJournal.Enabled = true; ManageList.setMyList(myJournal); }
private void btnAddToReferenceList_Click(object sender, EventArgs e) { btnAddAnotherChapter.Enabled = true; ManageList.setMyList(myChapter); }
public override void GetList(ManageList <Bill> list) { throw new System.NotImplementedException(); }
internal void EditShareSkill(IWebDriver driver) { CommomDriver.Wait(2000); //Click on ShareSkill Button ShareSkillBtn.Click(); //Wait untill driver find title text Field CommomDriver.WaitForVisibility(driver, "Name", "title", 2); //populate login page data collection ExcelLibHelpers.PopulateInCollection(MarsResource.ExcelPath, "EditShareSkill"); //Give a Title Title.SendKeys(ExcelLibHelpers.ReadData(2, "Title")); //Give a Description Description.SendKeys(ExcelLibHelpers.ReadData(2, "Description")); //select one of the option from Category Category.SendKeys(ExcelLibHelpers.ReadData(2, "Category")); ////Select SubCategory Option SubCategory.SendKeys(ExcelLibHelpers.ReadData(2, "Sub Category")); //give input in Tag TextField Tag.SendKeys(ExcelLibHelpers.ReadData(2, "Tag") + Keys.Enter); Tag.SendKeys(ExcelLibHelpers.ReadData(3, "Tag") + Keys.Enter); //choose Radio button option ServiceType.Click(); //Choose Location Location.Click(); //Give StartDate StartDate.SendKeys(ExcelLibHelpers.ReadData(2, "Start Date")); //Give EndDate EndDate.SendKeys(ExcelLibHelpers.ReadData(2, "End Date")); for (int i = 2; i < 9; i++) { for (int j = 2; j < 9; j++) { IWebElement SatrtTime = driver.FindElement(By.XPath("//div[" + i + "]/div[2]/input")); IWebElement EndTime = driver.FindElement(By.XPath("//div[" + j + "]/div[3]/input")); if (i == 2 && j == 2) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(2, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(2, "End Time")); } if (i == 3 && j == 3) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(3, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(3, "End Time")); } if (i == 4 && j == 4) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(4, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(4, "End Time")); } if (i == 5 && j == 5) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(5, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(5, "End Time")); } if (i == 6 && j == 6) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(6, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(6, "End Time")); } if (i == 7 && j == 7) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(7, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(7, "End Time")); } if (i == 8 && j == 8) { SatrtTime.SendKeys(ExcelLibHelpers.ReadData(8, "Start Time")); EndTime.SendKeys(ExcelLibHelpers.ReadData(8, "End Time")); } else { continue; } } } //Click on Share Trade Radio Button SkillTrade.Click(); //give inpute Skill Exchange SkillExchange.SendKeys(ExcelLibHelpers.ReadData(2, "Skill Exchange") + Keys.Enter + ExcelLibHelpers.ReadData(3, "Skill Exchange") + Keys.Enter); //Click on Work Sample WorkSample.Click(); //Handle the window that not belongs to Browser -AutoIt - see blog for more info //below line execute the AutoIT script //Create an object for AutoIt AutoItX3 autoIt = new AutoItX3(); //This statement Active the window and perform set of auctions autoIt.WinActivate("Open"); Thread.Sleep(1000); //set the path to open the file on browser autoIt.Send(@"D:\scrummeeting.png"); Thread.Sleep(1000); //It will click on "Open" button autoIt.Send("{ENTER}"); //click on active radio button Active.Click(); //click on save button savebtn.Click(); CommomDriver.Wait(2); //For Assertion- Go to manage list ManageList.Click(); //Get the text from manage list of Title and Category String ManageTitle = TitleofManage.Text; String ManageListCategory = CategoryofManage.Text; try { //For Assertion - After Save Skills For varification, //Goto manage list page and match Title and Cetegory with Excel Enter Skill Assert.AreEqual(ManageTitle, ExcelLibHelpers.ReadData(2, "Title")); Assert.AreEqual(ManageListCategory, ExcelLibHelpers.ReadData(2, "Category")); } catch (Exception e) { Console.WriteLine(e.Message); } }