void ReleaseDesignerOutlets() { if (AppraisalTableView != null) { AppraisalTableView.Dispose(); AppraisalTableView = null; } if (AppraisalTypeSegment != null) { AppraisalTypeSegment.Dispose(); AppraisalTypeSegment = null; } if (BtnAddNew != null) { BtnAddNew.Dispose(); BtnAddNew = null; } if (BtnCancel != null) { BtnCancel.Dispose(); BtnCancel = null; } if (VinSearch != null) { VinSearch.Dispose(); VinSearch = null; } }
private void FrmUdfMaster_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && this.ActiveControl != GridList) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { if (TxtListDescription.Visible == true) { GridControlMode(false); GridList.Focus(); } else if (BtnCancel.Enabled == true) { this.Tag = ""; BtnCancel.PerformClick(); } else if (BtnCancel.Enabled == false) { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
private void DgvOrders_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the order to returning { int id = Convert.ToInt32(DgvOrders.Rows[e.RowIndex].Cells[0].Value); _selectedIndex = e.RowIndex; _SelectedOrder = _orderService.Find(id); //actions done when order is not returned if (_SelectedOrder.Returned == false) { TxtReturningBook.Text = _SelectedOrder.Book.Title; if ((DateTime.Now - _SelectedOrder.OrderDate).Days < 1) { BtnReturn.Hide(); BtnCancel.Show(); } else if ((DateTime.Now - _SelectedOrder.MustReturnAt).Days > 0) { decimal Payment = (_SelectedOrder.Cost + ((DateTime.Now - _SelectedOrder.MustReturnAt).Days) * (_SelectedOrder.Cost * 5 / 1000)); TxtPayment.Text = Payment.ToString(); BtnReturn.Show(); BtnCancel.Hide(); } else { TxtPayment.Text = _SelectedOrder.Cost.ToString(); BtnReturn.Show(); BtnCancel.Hide(); } return; } MessageBox.Show("This Book Is already Returned"); TxtPayment.Text = string.Empty; TxtReturningBook.Text = string.Empty; }
private void BtnMenuMaintainence_Click(object sender, EventArgs e) { try { if (cmnService.J_UserMessage("Do you want to Maintainence your Database??", J_Var.J_pProjectName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) { BtnCancel.Select(); return; } cmnService.J_BusyMode(); dmlService.J_BeginTransaction(); dmlService.J_Commit(); dmlService.J_ClearDatabaseLog(); cmnService.J_NormalMode(); txtInfo.Visible = true; txtInfo.Text = "Database Maintainence is completed."; } catch (Exception err_handler) { cmnService.J_UserMessage(err_handler.Message); } }
private void FrmGodownTransfer_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && ActiveControl != Grid) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { if (TxtGridProductList.Visible == true) { //GridControlMode(false); Grid.Focus(); } else if (BtnCancel.Enabled == true) { _Tag = ""; TxtDate.Text = ""; BtnCancel.PerformClick(); } else if (BtnCancel.Enabled == false) { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
private void FrmKOT_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && ActiveControl != Grid) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { if (TxtGridWaiter.Visible == true || TxtGridUsedNo.Visible == true) { _GridControlMode = false; GridControlMode(false); _GridControlMode = true; Grid.Focus(); } else if (BtnCancel.Enabled == true) { this.Tag = ""; BtnCancel.PerformClick(); } else if (BtnCancel.Enabled == false) { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
public void Feed_Configuration_duplicate(string UName, string Paswd, string optionalName, string Action, string URL) { Entered_Username = UName; Entered_Password = Paswd; Entered_OPtionalName = optionalName; Entered_Url = URL; UserName.EnterText(UName); Password.EnterText(Paswd); OptionalName.EnterText(optionalName); if (provider == "others") { URL_Otherfeed.EnterText(URL); } if (Action == "Save" && UName != "" && Paswd != "") { BtnSave.WebClick(); DuplicateFeed_Msg.Wait_ElmToBeDisplayed(30); DuplicateMsg_ServiceProviderDataId = DuplicateFeed_Msg.GetText(); //bool a = DuplicateFeed_Msg.Displayed; // DuplicateFeed_Msg // PropertiesCollection.fluentWait("//div[contains(text(),'Error']", 20); } if (Action == "Cancel") { BtnCancel.WebClick(); } // System.Threading.Thread.Sleep(5000); }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Escape) { BtnCancel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); } }
/// <summary> /// Event handler for form closing /// Check if settings are changed, and ask the user if he wants to save settings if needed /// Then hides the settings form if this event comes from the close button, or completely exit if it comes from tray context menu "Exit" button /// </summary> /// <param name="sender"></param> /// <param name="e">The event object, will be used to cancel closing event if needed</param> private void Form_FormClosing(object sender, FormClosingEventArgs e) { //Cancel closing event if it is not from tray context menu if (!exiting) { e.Cancel = true; } //If the user changed any settings, ask him what to do if (settingsChanged) { if (MessageBox.Show("You have changed some settings, do you want to apply them? ", "Hourly Reminder", MessageBoxButtons.YesNo) == DialogResult.Yes) { //Yes clicked, apply BtnApply.PerformClick(); } else { //No clicked, cancel BtnCancel.PerformClick(); } } else { //Nothing changed, simply hide the form this.Hide(); } }
private void DgvManagers_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the manager to updating or deactiving { BtnAdd.Hide(); BtnUpdate.Show(); BtnDeactive.Show(); BtnCancel.Show(); TxtPassword.Hide(); LblPassword.Text = "New Password"; LblComment.Show(); TxtNewPassword.Show(); int Id = Convert.ToInt32(DgvManagers.Rows[e.RowIndex].Cells[0].Value); _selectedManager = _managerService.Find(Id); //index of selected manager on datagridview _selectedIndex = e.RowIndex; //fill the selected manager information to the textboxes TxtName.Text = _selectedManager.Name; TxtSurname.Text = _selectedManager.Surname; TxtPhone.Text = _selectedManager.Phone; TxtUsername.Text = _selectedManager.Username; if (_selectedManager.IsAdmin == true) { CmbPosition.SelectedIndex = 0; return; } CmbPosition.SelectedIndex = 1; }
private void FrmPurchaseIndent_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && ActiveControl != Grid) { SendKeys.Send("{Tab}"); ActiveControl.Select(); } else if (e.KeyCode == Keys.Escape) { if (TxtGridParticular.Visible == true) { _GridControlMode = false; GridControlMode(false); _GridControlMode = true; Grid.Focus(); } else if (BtnCancel.Enabled == true) { _Tag = ""; TxtDate.Text = ""; BtnCancel.PerformClick(); } else if (BtnCancel.Enabled == false) { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
private void ConfigMessage() { int LblTextLeft = LblText.Left; LblTitle.Text = _Title; LblText.Text = _Text; _formHeight = LblText.Size.Height + 120; Width = LblText.Size.Width + 100; LblTitle.MaximumSize = new Size(LblText.Size.Width, 24); LblTitle.Location = new Point(Width / 2 - LblTitle.Width / 2, LblTitle.Location.Y); if (LblText.Left != LblTextLeft) { LblText.Left = LblTextLeft - 5; } if (_MT == BeheshtMBox.MessageType.YesNo) { BtnCancel.Visible = true; BtnCancel.Select(); } else { BtnOK.Select(); } switch (_Icon) { case BeheshtMBox.Icon.Info: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Info; break; case BeheshtMBox.Icon.Warning: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Warning; break; case BeheshtMBox.Icon.Question: PicBoxIcon.Image = FactoryShahin.Properties.Resources.Question; break; } }
private void Reset()//reset the all changes on textboxes { TxtFullname.Text = string.Empty; TxtPhone.Text = string.Empty; BtnAdd.Show(); BtnDeactive.Hide(); BtnUpdate.Hide(); BtnCancel.Hide(); }
private void Button7_Click(object sender, System.EventArgs e) { if (UserNameIsNotTaken() && DataFilled() && HandleCheckboxChecked() && CheckAge()) { new AddWorkerDetails(this); new AddWorkerSecurity(this); BtnCancel.PerformClick(); } }
private void FrmCashPartyInfo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { BtnCancel.PerformClick(); } }
private void Reset()//reset the all changes on textboxes and numericupdown { TxtTitle.Text = string.Empty; NumPrice.Value = 0; TxtAuthor.Text = string.Empty; NmrcCount.Value = 0; BtnAdd.Show(); BtnDeactive.Hide(); BtnUpdate.Hide(); BtnCancel.Hide(); }
private void FilterRptSalesOrderRegister_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { BtnCancel.PerformClick(); } }
private void CbAccept_CheckedChanged(object sender, EventArgs e) { if (CbAccept.Checked) { BtnYes.Enabled = true; _ = BtnYes.Focus(); } else { BtnYes.Enabled = false; _ = BtnNo.Visible ? BtnNo.Focus() : BtnCancel.Focus(); } }
private void Window_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.Enter: BtnOk.SimulateClick(); break; case Key.Escape: BtnCancel.SimulateClick(); break; } }
private void FormMessageBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { if (BtnCancel.Focus()) { Result = BeheshtMBox.Result.No; CloseForm(); return; } CkeckResult(); } }
void ReleaseDesignerOutlets() { if (BtnCancel != null) { BtnCancel.Dispose(); BtnCancel = null; } if (BtnSave != null) { BtnSave.Dispose(); BtnSave = null; } if (LblGross != null) { LblGross.Dispose(); LblGross = null; } if (LblNet != null) { LblNet.Dispose(); LblNet = null; } if (LblVat != null) { LblVat.Dispose(); LblVat = null; } if (TxtGross != null) { TxtGross.Dispose(); TxtGross = null; } if (TxtNet != null) { TxtNet.Dispose(); TxtNet = null; } if (txtVat != null) { txtVat.Dispose(); txtVat = null; } }
private void DgvClients_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the client to updating or deactiving { BtnAdd.Hide(); BtnUpdate.Show(); BtnDeactive.Show(); BtnCancel.Show(); int Id = Convert.ToInt32(DgvClients.Rows[e.RowIndex].Cells[0].Value); //index of selected client on datagridview _selectedIndex = e.RowIndex; _selectedClient = _clientService.Find(Id); //fill the selected client information to the textboxes TxtFullname.Text = _selectedClient.Fullname; TxtPhone.Text = _selectedClient.Phone; }
private void FrmMerge_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendKeys.Send("{Tab}"); } else if (e.KeyCode == Keys.Escape) { if (BtnCancel.Enabled == true) { BtnCancel.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
private void FrmMenuPermissionGroup_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { if (BtnCancel.Enabled == true) { _Tag = ""; BtnCancel.PerformClick(); } else { BtnExit.PerformClick(); } DialogResult = DialogResult.Cancel; return; } }
private void DgvBooks_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)//select the book to updating or deactiving { BtnAdd.Hide(); BtnUpdate.Show(); BtnDeactive.Show(); BtnCancel.Show(); int Id = Convert.ToInt32(DgvBooks.Rows[e.RowIndex].Cells[0].Value); _selectedBook = _bookService.Find(Id); //index of selected book on datagridview _SelectedIndex = e.RowIndex; //fill the selected book information to the textboxes TxtTitle.Text = _selectedBook.Title; NumPrice.Value = _selectedBook.Price; TxtAuthor.Text = _selectedBook.Author; NmrcCount.Value = _selectedBook.Count; }
//for future testing public void CheckFilters() { CreateFiltA.Click(); Thread.Sleep(3000); for (int i = 0; i < FiltersDrls.Count; i++) { var allFlters = driver.FindElements(By.CssSelector("div.item.choosen-columns select[name]")); if (SeleniumGetMethod.GetQuantityOfOptionsInDropDown(allFlters[i]) < 2) { break; } SeleniumSetMethods.SelectDropDown(allFlters[i], i + 1); Thread.Sleep(2000); } BtnCancel.Click(); Thread.Sleep(2000); }
private void Reset()//reset the all changes on textboxes { TxtName.Text = string.Empty; TxtSurname.Text = string.Empty; TxtPhone.Text = string.Empty; TxtUsername.Text = string.Empty; TxtPassword.Text = string.Empty; TxtNewPassword.Text = string.Empty; CmbPosition.SelectedItem = null; BtnAdd.Show(); BtnDeactive.Hide(); BtnUpdate.Hide(); BtnCancel.Hide(); TxtNewPassword.Hide(); LblPassword.Text = "password"; TxtPassword.Show(); LblComment.Hide(); }
public void Feed_Configuration(string UName, string Paswd, string optionalName, string Action, string URL) { Entered_Username = UName; Entered_Password = Paswd; Entered_OPtionalName = optionalName; Entered_Url = URL; if (provider != "others") { App_URL = Feed_URL.GetText(); } Assert.AreEqual(true, UserName.Displayed, "Field Username is displayed"); Assert.AreEqual(true, Password.Displayed, "Field Username is displayed"); Assert.AreEqual(true, OptionalName.Displayed, "Field Username is displayed"); Assert.AreEqual(true, BtnSave.Displayed, "Field Username is displayed"); Assert.AreEqual(true, BtnCancel.Displayed, "Field Username is displayed"); UserName.EnterText(UName); Password.EnterText(Paswd); OptionalName.EnterText(optionalName); if (provider == "others") { URL_Otherfeed.EnterText(URL); } if (Action == "Save" && UName != "" && Paswd != "") { BtnSave.WebClick(); // bool a = Driver.FindElement(By.XPath("//div[contains(text(),'Success: Provider configuration saved'")).Displayed; //bool b = Driver.FindElement(By.XPath("//div[contains(text(),'Info: Added to previosly configured feeds'")).Displayed; // System.Threading.Thread.Sleep(5000); } if (Action == "Cancel") { BtnCancel.WebClick(); } // System.Threading.Thread.Sleep(5000); WebDriverWait wait = new WebDriverWait(BrowserFactory.Driver, TimeSpan.FromSeconds(15)); wait.Until(waithelper.ExpectedConditions.InvisibilityOfElementLocated(By.XPath(".//*[contains(@class,'toast-message')]"))); }
private void BtnBackup_Click(object sender, EventArgs e) { try { txtPath.Visible = false; if (strLocalMachineName.Trim().ToUpper() != J_Var.J_pServerName.Trim().ToUpper()) { cmn.J_UserMessage("Please take the BACKUP from server itself !!"); BtnCancel.Select(); return; } string strFolderPath = cmn.J_OpenFolderDialog(); if (strFolderPath == "") { return; } cmn.J_BusyMode(); dml.J_ClearDatabaseLog(J_Var.J_pDatabaseName); string strSQL = "EXEC SP_MSFOREACHTABLE " + "@COMMAND1 = \"DROP TABLE ?\"," + "@WHEREAND = \"AND ID IN (SELECT ID FROM SYSOBJECTS WHERE XTYPE = 'U' AND (NAME LIKE 'TMP%' OR NAME LIKE 'TEMP%'))\""; dml.J_ExecSql(strSQL); strPath = strFolderPath + "/" + J_Var.J_pBranchCode + "-" + string.Format("{0:yyyyMMdd}", System.DateTime.Now.Date) + "-" + string.Format("{0:HHmmss}", System.DateTime.Now) + ".BAK"; strSQL = "BACKUP DATABASE [" + J_Var.J_pDatabaseName + "] " + " TO DISK = '" + strPath + "'"; dml.J_ExecSql(strSQL); txtPath.Visible = true; txtPath.Text = "Collect the backup from : " + strPath + ""; cmn.J_NormalMode(); } catch (Exception err_handler) { cmn.J_UserMessage(err_handler.Message); } }
void ReleaseDesignerOutlets() { if (TXTTenantName != null) { TXTTenantName.Dispose(); TXTTenantName = null; } if (BtnOk != null) { BtnOk.Dispose(); BtnOk = null; } if (BtnCancel != null) { BtnCancel.Dispose(); BtnCancel = null; } }