Example #1
0
        private void BtnDel_Click(object sender, EventArgs e)
        {
            if (DGVShowInfo.SelectedRows.Count > 0)
            {
                if (MessageBox.Show("确认删除这行数据吗?", "警告", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    //获取主键
                    string productID = DGVShowInfo.SelectedRows[0].Cells["ProductID"].Value.ToString();
                    string checkSql  = "select * from [Order Details] where ProductID = '" + productID + "'";

                    if (DBHelper.ExcuteExist(checkSql))
                    {
                        MessageBox.Show("已出售商品不允许删除!");
                        return;
                    }
                    else
                    {
                        string sql = "delete from Products where ProductID ='" + productID + "'";
                        int    cnt = DBHelper.ExecuteNonQuery(sql);
                        MessageBox.Show(cnt > 0 ? "删除成功!" : "删除出错!");
                        BtnSearch.PerformClick();
                    }
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的行!");
            }
        }
        internal void EditRequestMethod()
        {
            try
            {
                ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantMyRequest");
                //validate if User is on My requests page
                Driver.driver.PageSource.Contains("My Requests");

                //Get Job Description from Excel sheet and search
                TxtSearchBar.SendKeys(ExcelLib.ReadData(2, "Job Description"));
                BtnSearch.Click();
                Driver.wait(2);
                LnqSortBy.Click();

                //validate if Job Description is as selected
                string JobDescription = Driver.driver.FindElement(By.XPath("html/body/div/section/div[1]/div[5]/div[1]/div/div/div/div[2]/div[3]/div/div[2]/span")).Text;
                JobDescription.Contains(ExcelLib.ReadData(2, "Job Description"));

                //Edit the Job Description and Submit the form
                LnqEdit.Click();
                TxtDescription.SendKeys(ExcelLib.ReadData(2, "New Description"));
                BtnSave.Submit();

                //Validate the success message
                //string message = Driver.driver.FindElement(By.XPath("html/body/div/section/div[3]/div[2]/form")).Text;
                string message = Driver.driver.SwitchTo().Alert().Text;
                Assert.AreEqual(message, "Item edited successfully");
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Example #3
0
        private void Form_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F3)
            {
                txtSearch.Focus();
                txtSearch.SelectAll();
                e.Handled          = true;
                e.SuppressKeyPress = true;
                return;
            }


            if (ActiveControl.Name == txtSearch.Name && e.KeyCode == Keys.Enter)
            {
                BtnSearch.PerformClick();
                DataGrid.Focus();
                e.Handled          = true;
                e.SuppressKeyPress = true;
                return;
            }

            if (ActiveControl.Name == DataGrid.Name && e.KeyCode == Keys.Enter)
            {
                BtnOpen.PerformClick();
                e.SuppressKeyPress = true;
                e.Handled          = true;
            }
        }
Example #4
0
 //TextBoxban Enterrel is lenyomja a keresés gombot
 private void TxtBxAuthor_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Enter)
     {
         BtnSearch.PerformClick();
     }
 }
Example #5
0
 private void TbxInput_OnKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         BtnSearch.Focus();
         BtnSearch_Click(null, null);
     }
 }
Example #6
0
        public void SearchBook(string keyword)
        {
            var selectElement = new SelectElement(SearchDropdownBox);

            selectElement.SelectByText("Books");
            SearchBox.SendKeys(keyword);
            BtnSearch.Click();
        }
 private void txbSearch_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)    // nhấn enter
     {
         isSearched = true;
         BtnSearch.PerformClick();
     }
 }
Example #8
0
 private void txtSearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         e.Handled = true;
         BtnSearch.PerformClick();
     }
 }
Example #9
0
 public virtual void CheckSearch()
 {
     foreach (var drl in SearchFormDropDowns)
     {
         SeleniumSetMethods.SelectDropDown(drl, 1);
         SeleniumGetMethod.WaitForPageLoad(driver);
         Thread.Sleep(2000);
     }
     foreach (var field in SearchFormInputs)
     {
         field.SendKeys(Helpers.Randomizer.String(7));
     }
     SeleniumGetMethod.WaitForPageLoad(driver);
     Thread.Sleep(3000);
     for (int i = 0; i < SearchFormCreatedDate.Count; i++)
     {
         SeleniumGetMethod.WaitForElement(driver, SearchFormCreatedDate[i]);
         SearchFormCreatedDate[i].Click();
         try
         {
             foreach (var date in CalendarBoxFromTo)
             {
                 if (date.Displayed)
                 {
                     date.Clear();
                     date.SendKeys(WindowsMessages.GetCurDate(1));
                     SeleniumGetMethod.WaitForPageLoad(driver);
                 }
             }
             if (BtnApply[i].Displayed)
             {
                 SeleniumGetMethod.WaitForElement(driver, BtnApply[i]);
                 BtnApply[i].Click();
                 SeleniumGetMethod.WaitForPageLoad(driver);
                 Thread.Sleep(1000);
                 SeleniumGetMethod.WaitForPageLoad(driver);
             }
         }
         catch (Exception msg)
         {
             PropertiesCollection._reportingTasks.Log(Status.Info, "Can't manipulate calendarboxes..<br>" + msg.ToString());
         }
     }
     Thread.Sleep(2000);
     BtnSearch.Click();
     SeleniumGetMethod.WaitForPageLoad(driver);
     Thread.Sleep(2000);
     try
     {
         xClearAllFilters.Click();
         Thread.Sleep(2000);
     }
     catch (Exception msg)
     {
         PropertiesCollection._reportingTasks.Log(Status.Info, "Can't set null filters uisng x(cross) link...<br>" + msg.ToString());
     }
     SeleniumGetMethod.WaitForPageLoad(driver);
 }
Example #10
0
 private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (isSearchButtonDisabled)
     {
         if (TxtSearch.Text.Length > -1)
         {
             BtnSearch.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
         }
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (BtnSearch != null)
            {
                BtnSearch.Dispose();
                BtnSearch = null;
            }

            if (TblResult != null)
            {
                TblResult.Dispose();
                TblResult = null;
            }
        }
 internal void SearchMethod()
 {
     try
     {
         ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails");
         SearchBar.SendKeys(ExcelLib.ReadData(2, "PropertyName"));
         BtnSearch.Click();
         Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Property Searched Using Search Menu");
     }
     catch
     {
         Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "issue in Search Method");
         throw;
     }
 }
 internal void SearchMethod()
 {
     try
     {
         ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails");
         TxtSearch.SendKeys(ExcelLib.ReadData(4, "PropertyName"));
         Driver.wait(2);
         BtnSearch.Click();
         string PropName  = Driver.driver.FindElement(By.XPath("html/body/div/section/div[1]/div[4]/div[1]/div/div/div/div[2]/div[2]/div[1]/div[2]/div[1]")).Text;
         bool   bPropName = PropName.Contains(ExcelLib.ReadData(4, "PropertyName"));
         if (bPropName)
         {
             Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Property searched is:" + PropName);
         }
         else
         {
             Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Property searched failed as:" + PropName);
         }
     }
     catch (Exception Ex)
     { string errormessage = Ex.Message; }
 }
Example #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.HomePage);

            BtnSearch.Text    = LocalizedStrings.SearchButtonTitle;
            EtCitySearch.Hint = LocalizedStrings.SearchTextFieldPlaceholder;

            setUiParams();

            BtnSearch.SetCommand(ViewModel.SearchCommand);
            bindings.Add(this.SetBinding(
                             () => ViewModel.SearchText,
                             () => EtCitySearch.Text,
                             BindingMode.TwoWay));

            bindings.Add(this.SetBinding(
                             () => ViewModel.IsLoading,
                             () => IvIcon.IsRotating,
                             BindingMode.OneWay));
        }
Example #15
0
 public void ClickSearch()
 {
     BtnSearch.Click();
 }
Example #16
0
 protected void txtSearch_TextChanged(object sender, EventArgs e)
 {
     BtnSearch.Focus();
 }
Example #17
0
        private void InitializePosition()
        {
            // Set Extend Attribute
            this.ClientSize     = new System.Drawing.Size(800, 600);
            PanelMain.BackColor = Color.FromArgb(20, 0, 0, 0);
            //PanelMain.ClientSize = new System.Drawing.Size(697, 522);
            PanelA1.BackColor      = Color.FromArgb(180, 158, 33, 36);
            PanelA2.BackColor      = Color.FromArgb(150, 158, 33, 36);
            PanelB1.BackColor      = Color.FromArgb(180, 156, 77, 35);
            PanelB2.BackColor      = Color.FromArgb(150, 156, 77, 35);
            PanelC1.BackColor      = Color.FromArgb(180, 17, 147, 36);
            PanelC2.BackColor      = Color.FromArgb(150, 17, 147, 36);
            PanelAtas.BackColor    = Color.FromArgb(70, 0, 0, 0);
            PanelKiri.BackColor    = Color.FromArgb(50, 0, 0, 0);
            PanelSearch.BackColor  = Color.FromArgb(0, 255, 255, 255);
            PnlTxt.BackColor       = Color.FromArgb(0, 255, 255, 255);
            PnlBg.BackColor        = Color.FromArgb(80, 255, 255, 255);
            DGView.BackgroundColor = Color.Lavender;
            panel1.BackColor       = Color.Transparent;

            LblJudul1.BackColor = Color.Transparent;
            LblJudul2.BackColor = Color.Transparent;
            LblJudul3.BackColor = Color.Transparent;
            LblIsi1.BackColor   = Color.Transparent;
            LblIsi2.BackColor   = Color.Transparent;
            LblIsi3.BackColor   = Color.Transparent;

            LblSkala1.BackColor    = Color.Transparent;
            LblSkala2.BackColor    = Color.Transparent;
            LblSkala3.BackColor    = Color.Transparent;
            LblMag1.BackColor      = Color.Transparent;
            LblMag2.BackColor      = Color.Transparent;
            LblMag3.BackColor      = Color.Transparent;
            LblSR1.BackColor       = Color.Transparent;
            LblSR2.BackColor       = Color.Transparent;
            LblSR3.BackColor       = Color.Transparent;
            LblLokasi1.BackColor   = Color.Transparent;
            LblLokasi2.BackColor   = Color.Transparent;
            LblLokasi3.BackColor   = Color.Transparent;
            LblWaktu1.BackColor    = Color.Transparent;
            LblWaktu2.BackColor    = Color.Transparent;
            LblWaktu3.BackColor    = Color.Transparent;
            LblPTsunami1.BackColor = Color.Transparent;
            LblPTsunami2.BackColor = Color.Transparent;
            LblPTsunami3.BackColor = Color.Transparent;

            LblSkala1.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag1.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR1.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi1.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu1.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami1.Font = new Font("Segoe UI", 8, FontStyle.Bold);
            LblSkala2.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag2.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR2.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi2.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu2.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami2.Font = new Font("Segoe UI", 8, FontStyle.Bold);
            LblSkala3.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag3.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR3.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi3.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu3.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami3.Font = new Font("Segoe UI", 8, FontStyle.Bold);

            BtnMinimize.Text      = "";
            BtnMinimize.BackColor = Color.Transparent;
            BtnMinimize.FlatAppearance.BorderSize = 0;
            BtnMinimize.FlatStyle = FlatStyle.Flat;
            BtnMinimize.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnMinimize.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnClose.Text      = "";
            BtnClose.BackColor = Color.Transparent;
            BtnClose.FlatAppearance.BorderSize = 0;
            BtnClose.FlatStyle = FlatStyle.Flat;
            BtnClose.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnClose.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnTerkini.Text      = "";
            BtnTerkini.BackColor = Color.Transparent;
            BtnTerkini.FlatAppearance.BorderSize = 0;
            BtnTerkini.FlatStyle = FlatStyle.Flat;
            BtnTerkini.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnTerkini.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnMaps.Text      = "";
            BtnMaps.BackColor = Color.Transparent;
            BtnMaps.FlatAppearance.BorderSize = 0;
            BtnMaps.FlatStyle = FlatStyle.Flat;
            BtnMaps.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnMaps.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnSearch.Text      = "";
            BtnSearch.BackColor = Color.Transparent;
            BtnSearch.FlatAppearance.BorderSize = 0;
            BtnSearch.FlatStyle = FlatStyle.Flat;
            BtnSearch.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnSearch.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnCari.Text      = "";
            BtnCari.BackColor = Color.Transparent;
            BtnCari.FlatAppearance.BorderSize = 0;
            BtnCari.FlatStyle = FlatStyle.Flat;
            BtnCari.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnCari.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnBTempat.Text      = "";
            BtnBTempat.BackColor = Color.Transparent;
            BtnBTempat.FlatAppearance.BorderSize = 0;
            BtnBTempat.FlatStyle = FlatStyle.Flat;
            BtnBTempat.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnBTempat.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnBWaktu.Text      = "";
            BtnBWaktu.BackColor = Color.Transparent;
            BtnBWaktu.FlatAppearance.BorderSize = 0;
            BtnBWaktu.FlatStyle = FlatStyle.Flat;
            BtnBWaktu.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnBWaktu.FlatAppearance.MouseOverBackColor = Color.Transparent;


            //bound
            PanelAtas.SetBounds(0, 0, 800, 90);
            PanelKiri.SetBounds(0, 90, 80, 510);
            PanelMain.SetBounds(80, 90, 720, 510);
            PanelA1.SetBounds(0, 0, 240, 171);
            PanelA2.SetBounds(240, 0, 480, 171);
            PanelB1.SetBounds(0, 171, 240, 171);
            PanelB2.SetBounds(240, 171, 480, 171);
            PanelC1.SetBounds(0, 342, 240, 172);
            PanelC2.SetBounds(240, 342, 480, 171);
            PanelSearch.SetBounds(80, 90, 720, 510);
            PnlTxt.SetBounds(230, 70, 249, 24);
            DGView.SetBounds(230, 70, 249, 24);
            BtnBTempat.SetBounds(200, 20, 150, 25);
            BtnBWaktu.SetBounds(360, 20, 150, 25);
            BtnCari.SetBounds(430, 69, 39, 25);
            TxtCari.SetBounds(10, 1, 230, 25);
            WebMaps.SetBounds(80, 90, 720, 510);
            BtnMinimize.SetBounds(702, 0, 49, 21);
            BtnClose.SetBounds(751, 0, 49, 21);
            BtnTerkini.SetBounds(3, 20, 73, 73);
            BtnMaps.SetBounds(3, 104, 73, 73);
            BtnSearch.SetBounds(3, 188, 73, 73);
            DGView.SetBounds(35, 110, 650, 375);
            PnlBg.SetBounds(35, 110, 650, 375);
            DTPicker.SetBounds(230, 72, 200, 28);

            LblJudul1.SetBounds(5, 15, 230, 20);
            LblJudul2.SetBounds(5, 15, 230, 20);
            LblJudul3.SetBounds(5, 15, 230, 20);
            LblIsi1.SetBounds(5, 55, 230, 100);
            LblIsi2.SetBounds(5, 55, 230, 100);
            LblIsi3.SetBounds(5, 55, 230, 100);

            LblSkala1.SetBounds(5, 5, 73, 73);
            LblMag1.SetBounds(150, 30, 73, 73);
            LblSR1.SetBounds(300, 45, 73, 73);
            LblLokasi1.SetBounds(5, 145, 73, 73);
            LblWaktu1.SetBounds(350, 5, 73, 73);
            LblPTsunami1.SetBounds(335, 150, 73, 73);
            LblSkala2.SetBounds(5, 5, 73, 73);
            LblMag2.SetBounds(150, 30, 73, 73);
            LblSR2.SetBounds(300, 45, 73, 73);
            LblLokasi2.SetBounds(5, 145, 73, 73);
            LblWaktu2.SetBounds(350, 5, 73, 73);
            LblPTsunami2.SetBounds(335, 150, 73, 73);
            LblSkala3.SetBounds(5, 5, 73, 73);
            LblMag3.SetBounds(150, 30, 73, 73);
            LblSR3.SetBounds(300, 45, 73, 73);
            LblLokasi3.SetBounds(5, 145, 73, 73);
            LblWaktu3.SetBounds(350, 5, 73, 73);
            LblPTsunami3.SetBounds(335, 150, 73, 73);

            label44.SetBounds(10, 20, 31, 30);
            label43.SetBounds(50, 20, 295, 30);
            label42.SetBounds(350, 20, 186, 30);
            label41.SetBounds(540, 20, 100, 30);

            label1.SetBounds(10, 65, 31, 23);
            label2.SetBounds(50, 65, 295, 23);
            label3.SetBounds(350, 65, 186, 23);
            label4.SetBounds(540, 65, 100, 23);
            label5.SetBounds(10, 95, 31, 23);
            label6.SetBounds(50, 95, 295, 23);
            label7.SetBounds(350, 95, 186, 23);
            label8.SetBounds(540, 95, 100, 23);
            label12.SetBounds(10, 125, 31, 23);
            label11.SetBounds(50, 125, 295, 23);
            label10.SetBounds(350, 125, 186, 23);
            label9.SetBounds(540, 125, 100, 23);
            label16.SetBounds(10, 155, 31, 23);
            label15.SetBounds(50, 155, 295, 23);
            label14.SetBounds(350, 155, 186, 23);
            label13.SetBounds(540, 155, 100, 23);
            label20.SetBounds(10, 185, 31, 23);
            label19.SetBounds(50, 185, 295, 23);
            label18.SetBounds(350, 185, 186, 23);
            label17.SetBounds(540, 185, 100, 23);
            label24.SetBounds(10, 215, 31, 23);
            label23.SetBounds(50, 215, 295, 23);
            label22.SetBounds(350, 215, 186, 23);
            label21.SetBounds(540, 215, 100, 23);
            label28.SetBounds(10, 245, 31, 23);
            label27.SetBounds(50, 245, 295, 23);
            label26.SetBounds(350, 245, 186, 23);
            label25.SetBounds(540, 245, 100, 23);
            label32.SetBounds(10, 275, 31, 23);
            label31.SetBounds(50, 275, 295, 23);
            label30.SetBounds(350, 275, 186, 23);
            label29.SetBounds(540, 275, 100, 23);
            label36.SetBounds(10, 305, 31, 23);
            label35.SetBounds(50, 305, 295, 23);
            label34.SetBounds(350, 305, 186, 23);
            label33.SetBounds(540, 305, 100, 23);
            label40.SetBounds(10, 335, 31, 23);
            label39.SetBounds(50, 335, 295, 23);
            label38.SetBounds(350, 335, 186, 23);
            label37.SetBounds(540, 335, 100, 23);
            panel1.SetBounds(10, 5, 183, 74);



            this.BackgroundImage = global::Retakan.Properties.Resources.bg2;
            //PanelKiri.BackgroundImage = global::Retakan.Properties.Resources.kiri;
            //PanelAtas.BackgroundImage = global::Retakan.Properties.Resources.header;
            BtnClose.Image          = global::Retakan.Properties.Resources.close;
            BtnMinimize.Image       = global::Retakan.Properties.Resources.minim;
            BtnTerkini.Image        = global::Retakan.Properties.Resources.terkini_off;
            PanelA2.BackgroundImage = global::Retakan.Properties.Resources.merah_;
            PanelB2.BackgroundImage = global::Retakan.Properties.Resources.orange_;
            PanelC2.BackgroundImage = global::Retakan.Properties.Resources.hijau_;
            BtnMaps.Image           = global::Retakan.Properties.Resources.peta_off;
            BtnSearch.Image         = global::Retakan.Properties.Resources.cari_off;
            PnlTxt.BackgroundImage  = global::Retakan.Properties.Resources.caritxt;
            BtnCari.Image           = global::Retakan.Properties.Resources.btncari_off;
            BtnBTempat.Image        = global::Retakan.Properties.Resources.tempat_on;
            BtnBWaktu.Image         = global::Retakan.Properties.Resources.waktu_off;
            panel1.BackgroundImage  = global::Retakan.Properties.Resources.unnamed;
        }