/// <summary> /// On pricelist button click in datagridview ,it displays a popup window of pricelistpopup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvPricingList_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { if (dgvPricingList.CurrentCell == dgvPricingList.CurrentRow.Cells["dgvbtnpricelist"]) { if (cmbPricingLevel.SelectedIndex != -1) { frmPriceListPopupObj = Application.OpenForms["frmPriceListPopup"] as frmPriceListPopup; if (frmPriceListPopupObj == null) { frmPriceListPopupObj = new frmPriceListPopup(); frmPriceListPopupObj.MdiParent = formMDI.MDIObj; frmPriceListPopupObj.Show(); } else { frmPriceListPopupObj.Activate(); } if (dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString() == string.Empty) //&& dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString()==null) { dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value = "0"; } frmPriceListPopupObj.CallFromPriceListForPricingLevel(Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()), Convert.ToDecimal(dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtproductId"].Value.ToString()), Convert.ToDecimal(dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString()), this); dgvPricingList.ClearSelection(); txtProductName.Focus(); this.Enabled = false; } else { Messages.InformationMessage("Enter Pricing Level"); cmbPricingLevel.Focus(); } } } } catch (Exception ex) { formMDI.infoError.ErrorString = "PCL9" + ex.Message; } }
/// <summary> /// For enterkey and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbPricingLevel_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled == true) { cmbCurrency.Focus(); cmbCurrency.SelectionLength = 0; cmbCurrency.SelectionStart = 0; } else { cmbSalesMan.Focus(); } } if (e.KeyCode == Keys.Back) { if (cmbDeliveryMode.Text != "NA") { cmbOrderNo.Focus(); } else { cmbDeliveryMode.Focus(); } } //Pricing Level Pop Up when Ctrl+F if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbPricingLevel.SelectedIndex != -1) { frmPriceListPopup frmPriceListPopUpObj = new frmPriceListPopup(); frmPriceListPopUpObj.MdiParent = formMDI.MDIObj; frmPriceListPopUpObj.CallFromDeliveryNoteForPricingfLevelPopUp(this, Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()), "PricingLevel"); } else { Messages.InformationMessage("Select any pricing level"); } /*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnPricingLevel_Click(sender, e); } } //CTRL+F for new Ledger creation if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { btnPricingLevel_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("DN79:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On pricelist button click in datagridview ,it displays a popup window of pricelistpopup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvPricingList_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { if (dgvPricingList.CurrentCell == dgvPricingList.CurrentRow.Cells["dgvbtnpricelist"]) { if (cmbPricingLevel.SelectedIndex != -1) { frmPriceListPopupObj = Application.OpenForms["frmPriceListPopup"] as frmPriceListPopup; if (frmPriceListPopupObj == null) { frmPriceListPopupObj = new frmPriceListPopup(); frmPriceListPopupObj.MdiParent = formMDI.MDIObj; frmPriceListPopupObj.Show(); } else { frmPriceListPopupObj.Activate(); } if (dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString() == string.Empty) //&& dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString()==null) { dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value = "0"; } frmPriceListPopupObj.CallFromPriceListForPricingLevel(Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()), Convert.ToDecimal(dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtproductId"].Value.ToString()), Convert.ToDecimal(dgvPricingList.Rows[e.RowIndex].Cells["dgvtxtpricelistId"].Value.ToString()), this); dgvPricingList.ClearSelection(); txtProductName.Focus(); this.Enabled = false; } else { Messages.InformationMessage("Enter Pricing Level"); cmbPricingLevel.Focus(); } } } } catch (Exception ex) { MessageBox.Show("PCL12" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call frmPriceListPopup form to select and view Pricelist /// </summary> /// <param name="frmPriceListPopup"></param> /// <param name="decId"></param> public void CallPriceListPopUp(frmPriceListPopup frmPriceListPopup, decimal decId) { try { base.Show(); this.frmPriceListPopUpObj = frmPriceListPopup; PrlicingLevelComboFill(cmbPricingLevel); cmbPricingLevel.SelectedValue = decId; cmbPricingLevel.Focus(); frmPriceListPopup.Close(); frmPriceListPopup = null; } catch (Exception ex) { MessageBox.Show("SR17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enterkey and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbPricingLevel_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbSalesAccount.Enabled) { cmbSalesAccount.Focus(); } else if (cmbCurrency.Enabled) { cmbCurrency.Focus(); } else { dgvSalesReturn.Focus(); } } if (e.KeyCode == Keys.Back) { if (cmbInvoiceNo.Enabled) { cmbInvoiceNo.Focus(); } else if (cmbVoucherType.Enabled) { cmbVoucherType.Focus(); } else if (cmbSalesMan.Enabled) { cmbSalesMan.Focus(); } else if (cmbCashOrParty.Enabled) { cmbCashOrParty.Focus(); } else if (!txtDate.ReadOnly) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } else if (!txtReturnNo.ReadOnly) { txtReturnNo.Focus(); } } //Cntrl+F pop up if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { SendKeys.Send("{F10}"); if (cmbPricingLevel.Focused) { cmbPricingLevel.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbPricingLevel.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbPricingLevel.SelectedIndex != -1) { frmPriceListPopup frmPriceListPopUpObj = new frmPriceListPopup(); frmPriceListPopUpObj.MdiParent = formMDI.MDIObj; frmPriceListPopUpObj.CallFromSalesReturnForPricingLevel(this, Convert.ToDecimal(cmbPricingLevel.SelectedValue.ToString()), "PricingLevel"); } else { Messages.InformationMessage("Select any pricing level"); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnPricingLevel_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("SR111:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }