/// <summary> /// Enter key and Backspace navigation and Form Quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployee_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbStatus.Focus(); } if (e.KeyCode == Keys.Back) { cmbDesigantion.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployee.SelectedIndex > 0) { frmEmployeePopupObj.CallFromEmployeeReport(this, Convert.ToDecimal(cmbEmployee.SelectedValue.ToString())); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "ER13 " + ex.Message; } }
/// <summary> /// Enter key and Backspace navigation and Form Quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployee_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbStatus.Focus(); } if (e.KeyCode == Keys.Back) { cmbDesigantion.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployee.SelectedIndex > 0) { frmEmployeePopupObj.CallFromEmployeeReport(this, Convert.ToDecimal(cmbEmployee.SelectedValue.ToString())); } } } catch (Exception ex) { MessageBox.Show("ER12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Form Quick access and Enter,Backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployeeCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtSalaryMonth.Focus(); } if (e.KeyCode == Keys.Back) { txtToDate.SelectionStart = 0; txtToDate.SelectionLength = 0; txtToDate.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployeeCode.SelectedIndex > 0) { frmEmployeePopupObj.CallFromAdvancePaymentReport(this, Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString())); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "APR:18 " + ex.Message; } }
/// <summary> /// Calls frmEmployeePopup form to select and view Employee and enter key navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployeeName_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { dtpMonth.Focus(); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmEmployeeObj = new frmEmployeePopup(); frmEmployeeObj.MdiParent = formMDI.MDIObj; if (cmbEmployeeName.SelectedIndex > 0) { frmEmployeeObj.CallFromBonusDeductionregister(this, Convert.ToDecimal(cmbEmployeeName.SelectedValue.ToString())); } else { Messages.InformationMessage("Select employeename"); cmbEmployeeName.Focus(); } } } catch (Exception ex) { MessageBox.Show("BDR12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmEmployeePopup to view and select Employee details /// </summary> /// <param name="frm"></param> /// <param name="decEmployeeId"></param> public void CallFromEmployeePopUp(frmEmployeePopup frm, decimal decEmployeeId) { try { base.Show(); frmEmployeePopupObj = frm; cmbEmployeeCode.SelectedValue = decEmployeeId; cmbEmployeeCode.Focus(); frmEmployeePopupObj.Close(); frmEmployeePopupObj = null; } catch (Exception ex) { formMDI.infoError.ErrorString = "APR:3 " + ex.Message; } }
/// <summary> /// Function to call frmEmployeePopup to view and select Employees /// </summary> /// <param name="frm"></param> /// <param name="decEmployeeId"></param> public void CallFromEmployeePopUp(frmEmployeePopup frm, decimal decEmployeeId) { try { base.Show(); frmEmployeePopupObj = frm; cmbEmployee.SelectedValue = decEmployeeId; cmbEmployee.Focus(); frmEmployeePopupObj.Close(); frmEmployeePopupObj = null; } catch (Exception ex) { MessageBox.Show("DAR:3" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmEmployeePopup form to view and select Employees /// </summary> /// <param name="frm"></param> /// <param name="decEmployeeId"></param> public void CallFromEmployeePopUp(frmEmployeePopup frm, decimal decEmployeeId) { try { base.Show(); frmEmployeePopupObj = frm; cmbEmployee.SelectedValue = decEmployeeId; cmbEmployee.Focus(); frmEmployeePopupObj.Close(); frmEmployeePopupObj = null; } catch (Exception ex) { MessageBox.Show("ER5" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmEmployeePopup form to select and view Employee /// </summary> /// <param name="frmEmployee"></param> /// <param name="decId"></param> public void CallFromEmployee(frmEmployeePopup frmEmployee, decimal decId) //POP UP { try { base.Show(); this.frmEmployeeObj = frmEmployee; EmployeeNameComboFill(); cmbEmployeeName.SelectedValue = decId; cmbEmployeeName.Focus(); frmEmployeeObj.Close(); frmEmployeeObj = null; } catch (Exception ex) { formMDI.infoError.ErrorString = "BDR5:" + ex.Message; } }
/// <summary> /// Function to call frmEmployeePopup form to select and view Employee /// </summary> /// <param name="frmEmployee"></param> /// <param name="decId"></param> public void CallFromEmployee(frmEmployeePopup frmEmployee, decimal decId) //POP UP { try { base.Show(); this.frmEmployeeObj = frmEmployee; EmployeeNameComboFill(); cmbEmployeeName.SelectedValue = decId; cmbEmployeeName.Focus(); frmEmployeeObj.Close(); frmEmployeeObj = null; } catch (Exception ex) { MessageBox.Show("BDR5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//POP UP /// <summary> /// Function to call frmEmployeePopup form to select and view Employee /// </summary> /// <param name="frmEmployee"></param> /// <param name="decId"></param> public void CallFromEmployee(frmEmployeePopup frmEmployee, decimal decId) { try { base.Show(); this.frmEmployeeObj = frmEmployee; EmployeeNameComboFill(); cmbEmployeeName.SelectedValue = decId; cmbEmployeeName.Focus(); frmEmployeeObj.Close(); frmEmployeeObj = null; } catch (Exception ex) { MessageBox.Show("BDR5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enter key navigation and Form Quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployeeCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtPhone.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployeeCode.SelectedIndex > 0) { frmEmployeePopupObj.CallFromEmployeeAddressBook(this, Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString())); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "EMP-AB11 " + ex.Message; } }
/// <summary> /// Function to call frmEmployeePopup form to select and view Employee /// </summary> /// <param name="frmEmployeePopup"></param> /// <param name="decId"></param> public void CallEmployeePopUp(frmEmployeePopup frmEmployeePopup, decimal decId) //PopUp { try { base.Show(); this.frmEmployeePopUpObj = frmEmployeePopup; salesManComboFill(); cmbSalesMan.SelectedValue = decId; cmbSalesMan.Focus(); frmEmployeePopUpObj.Close(); frmEmployeePopUpObj = null; } catch (Exception ex) { MessageBox.Show("SI: 58" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enterkey and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); if (cmbPricingLevel.Focused) { cmbPricingLevel.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbPricingLevel.DropDownStyle = ComboBoxStyle.DropDownList; } btnSalesMan_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { SendKeys.Send("{F10}"); if (cmbSalesMan.Focused) { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbSalesMan.SelectedIndex != -1) { frmEmployeePopup frmEmployeePopUpObj = new frmEmployeePopup(); frmEmployeePopUpObj.MdiParent = formMDI.MDIObj; frmEmployeePopUpObj.callFromSalesReturn(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString())); } else { Messages.InformationMessage("Select any pricing level"); } } if (e.KeyCode == Keys.Enter) { if (cmbVoucherType.Enabled) { cmbVoucherType.Focus(); } else if (cmbInvoiceNo.Enabled) { cmbInvoiceNo.Focus(); } else if (cmbPricingLevel.Enabled) { cmbPricingLevel.Focus(); } else if (cmbSalesAccount.Enabled) { cmbSalesAccount.Focus(); } else if (cmbCurrency.Enabled) { cmbCurrency.Focus(); } else { dgvSalesReturn.Focus(); } } if (e.KeyCode == Keys.Back) { if (cmbCashOrParty.Enabled) { cmbCashOrParty.Focus(); } else if (!txtDate.ReadOnly) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } else if (!txtReturnNo.ReadOnly) { txtReturnNo.Focus(); } } } catch (Exception ex) { MessageBox.Show("SR113:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enter key and backspace navigation and calls frmEmployeePopup to create new Employee /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployee_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtAmount.Focus(); } if (cmbEmployee.Text == string.Empty || cmbEmployee.SelectionStart == 0) { if (e.KeyCode == Keys.Back) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnAdvancePaymentEmployee_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployee.SelectedIndex > -1) { frmEmployeePopupObj.CallFromAdvancePayment(this, Convert.ToDecimal(cmbEmployee.SelectedValue.ToString())); } else { Messages.InformationMessage("Select employee"); cmbEmployee.Focus(); } } } catch (Exception ex) { MessageBox.Show("AP39:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Form Quick access and Enter,Backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployeeCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtSalaryMonth.Focus(); } if (e.KeyCode == Keys.Back) { txtToDate.SelectionStart = 0; txtToDate.SelectionLength = 0; txtToDate.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployeeCode.SelectedIndex > 0) { frmEmployeePopupObj.CallFromAdvancePaymentReport(this, Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString())); } } } catch (Exception ex) { MessageBox.Show("APR:17" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployee_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbStatus.Focus(); } if (e.KeyCode == Keys.Back) { cmbDesignation.Focus(); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployee.SelectedIndex > 0) { frmEmployeePopupObj.CallFromDailyAttendanceReport(this, Convert.ToDecimal(cmbEmployee.SelectedValue.ToString())); } } } catch (Exception ex) { MessageBox.Show("DAR:12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbSalesMan /// ctrl+f for employee popup /// Alt+c for employee creation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesman_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled) { cmbCurrency.Focus(); } else { dgvProduct.Focus(); } } if (e.KeyCode == Keys.Back) { if (cmbSalesman.Text == string.Empty || cmbSalesman.SelectionStart == 0) { cmbPricinglevel.Focus(); } } /*------------------------------------------------- pop up when Ctrl+F----------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbSalesman.SelectedIndex > -1) { frmEmployeePopupObj.CallFromSalesQuotation(this, Convert.ToDecimal(cmbSalesman.SelectedValue.ToString())); } else { Messages.InformationMessage("Select salesman"); cmbSalesman.Focus(); } } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnAddSalesman_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("SQ:71" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Sales Man ComboBox Enter and backSpace Key Navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled) { cmbCurrency.Focus(); } else { if (dgvProduct.Rows.Count > 0) { dgvProduct.Focus(); dgvProduct.CurrentCell = dgvProduct.Rows[0].Cells["dgvtxtSlNo"]; } else { txtTransportationCompany.Focus(); } } } if (e.KeyCode == Keys.Back) { cmbPricingLevel.Focus(); } if (e.Alt && e.KeyCode == Keys.C) { SendKeys.Send("{F10}"); btnSalesManPopup_Click(sender, e); } if (e.Control && e.KeyCode == Keys.F) { if (cmbCashorParty.SelectedIndex != -1) { frmEmployeePopup frmEmployeePopUp = new frmEmployeePopup(); frmEmployeePopUp.MdiParent = formMDI.MDIObj; frmEmployeePopUp.callFromRejectionIn(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString()), "SalesMan"); } else { Messages.InformationMessage("Select Salesman"); } } } catch (Exception ex) { MessageBox.Show("RI:63" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
// Employee pop up form /// <summary> /// Function to call frmEmployeePopup form to select and view Employee /// </summary> /// <param name="frmEmployeePopup"></param> /// <param name="decId"></param> public void CallEmployeePopup(frmEmployeePopup frmEmployeePopup, decimal decId) { try { this.Enabled = true; this.frmEmployeePopupObj = frmEmployeePopup; SalesmanComboFill(); cmbSalesman.SelectedValue = decId; cmbSalesman.Focus(); frmEmployeePopupObj.Close(); frmEmployeePopupObj = null; } catch (Exception ex) { MessageBox.Show("SV 16 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled == true) { cmbCurrency.Focus(); } else { dgvSalesInvoice.Focus(); } } if (e.KeyCode == Keys.Back) { txtCustomer.Focus(); txtCustomer.SelectionLength = 0; txtCustomer.SelectionStart = 0; } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewSalesman_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { frmEmployeePopup frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbSalesMan.SelectedIndex > -1) { frmEmployeePopupObj.callFromSalesInvoice(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString())); } else { Messages.InformationMessage("Select any Sales Man"); cmbSalesMan.Focus(); } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewSalesman_Click(sender, e); } } } catch (Exception ex) { MessageBox.Show("SI: 135" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enter key navigation and Quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbEmployeeCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbDesignation.Focus(); } if (e.Control && e.KeyCode == Keys.F) { frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbEmployeeCode.SelectedIndex > 0) { frmEmployeePopupObj.CallFromDailySlaryReport(this, Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString())); } } } catch (Exception ex) { MessageBox.Show("DSR19" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enterkey and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (dgvProduct.Rows.Count > 0) { dgvProduct.Focus(); dgvProduct.CurrentCell = dgvProduct.Rows[0].Cells["Col"]; } else { txtTraspotationCompany.Focus(); } } else if (e.KeyCode == Keys.Back) { if (cmbCurrency.Enabled) { cmbCurrency.Focus(); } else if (cmbPricingLevel.Enabled) { cmbPricingLevel.Focus(); } else if (cmbDeliveryMode.SelectedIndex == 0) { cmbDeliveryMode.Focus(); } else { cmbOrderNo.Focus(); } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { frmEmployeePopup frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbSalesMan.SelectedIndex > -1) { frmEmployeePopupObj.CallFromDeliveryNote(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString())); } else { Messages.InformationMessage("Select salesman"); cmbSalesMan.Focus(); } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnSalesMan_Click(sender, e); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { btnSalesMan_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("DN80:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key and backspace navigation and short cut to create a new Salesman /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbCashOrParty.Focus(); } else if (e.KeyCode == Keys.Back) { cmbPricingLevel.Focus(); } else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewSalesMan_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbSalesMan.Focused) { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbSalesMan.SelectedIndex > -1) { frmEmployeePopup frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; frmEmployeePopupObj.callFromPOS(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString())); } else { Messages.InformationMessage("Select any Sales Man"); cmbSalesMan.Focus(); } } } catch (Exception ex) { MessageBox.Show("POS: 109" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbSalesman /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesman_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (dgvServiceVoucher.RowCount > 0) { txtCustomer.Focus(); txtCustomer.SelectionLength = 0; txtCustomer.SelectionStart = 0; } } if (e.KeyCode == Keys.Back) { if (cmbSalesman.Text == string.Empty || cmbSalesman.SelectionStart == 0) { cmbCurrency.Focus(); cmbCurrency.SelectionStart = 0; cmbCurrency.SelectionLength = 0; } } /*-------------------------------------------------Ledger pop up when Ctrl+F----------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbSalesman.Focused) { cmbSalesman.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbSalesman.DropDownStyle = ComboBoxStyle.DropDownList; } frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbSalesman.SelectedIndex > -1) { frmEmployeePopupObj.CallFromServiceVoucher(this, Convert.ToDecimal(cmbSalesman.SelectedValue.ToString())); } else { Messages.InformationMessage("Select salesman"); cmbSalesman.Focus(); } } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)//Ledger creation { SendKeys.Send("{F10}"); btnAddSalesman_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("SV 69 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesMan_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbType.Enabled) { cmbType.Focus(); cmbType.SelectionLength = 0; cmbType.SelectionStart = 0; } } if (e.KeyCode == Keys.Back) { if (cmbSalesMan.Text == string.Empty || cmbSalesMan.SelectionStart == 0) { if (txtDueDate.Enabled == true) { txtDueDate.Focus(); txtDueDate.SelectionLength = 0; txtDueDate.SelectionStart = 0; } } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbSalesMan.Focused) { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbSalesMan.DropDownStyle = ComboBoxStyle.DropDownList; } frmEmployeePopupObj = new frmEmployeePopup(); frmEmployeePopupObj.MdiParent = formMDI.MDIObj; if (cmbSalesMan.SelectedIndex > -1) { frmEmployeePopupObj.CallFromSalesOrder(this, Convert.ToDecimal(cmbSalesMan.SelectedValue.ToString())); } else { Messages.InformationMessage("Select salesman"); cmbSalesMan.Focus(); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnSalesMan_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("SO92:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }