void frmStockValSetup_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F5)
     {
         frmReportDates frd = new frmReportDates(Period.Monthly);
         frd.ShowDialog();
         if (frd.SelectedFolder != "$NONE")
         {
             InputTextBox("DATE").Text = frd.SelectedFolder;
             SendKeys.Send("{ENTER}");
         }
     }
     else if (e.KeyCode == Keys.Enter)
     {
         if (InputTextBox("DATE").Text != "")
         {
             sOldEngine = new StockEngine(InputTextBox("DATE").Text);
             sOldEngine.StockValuationToPrinter();
         }
         else
         {
             sEngine.StockValuationToPrinter();
         }
         this.Close();
     }
     else if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }
Пример #2
0
 void lbKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter && ((ListBox)sender).SelectedIndex > -1)
     {
         string sDate = lbSalesDate.Items[((ListBox)sender).SelectedIndex].ToString();
         if (sDate != "N/A")
         {
             sDate = sDate.Replace("/", "");
             if (!bAlternateEngine)
             {
                 frmTillTransactions ftt = new frmTillTransactions(ref sEngine, Convert.ToInt32(sTillCodes[lbTills.SelectedIndex]), sDate);
                 ftt.ShowDialog();
             }
             else
             {
                 frmTillTransactions ftt = new frmTillTransactions(ref sOtherEngine, Convert.ToInt32(sTillCodes[lbTills.SelectedIndex]), sDate);
                 ftt.ShowDialog();
             }
         }
     }
     else if (e.KeyCode == Keys.Escape)
     {
         if (lbTills.Items.Count > 1)
         {
             lbTills.Focus();
             lbDays.SelectedIndex = -1;
         }
         else
         {
             this.Close();
         }
     }
     else if (e.KeyCode == Keys.F5)
     {
         // Change Date
         frmReportDates frd = new frmReportDates(Period.Weekly);
         frd.ShowDialog();
         if (frd.SelectedFolder != "$NONE")
         {
             sOtherEngine     = new StockEngine(frd.SelectedFolder);
             bAlternateEngine = true;
             DisplaySalesInfo();
             lbDays.Focus();
         }
     }
 }
Пример #3
0
 void DateKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F5)
     {
         frmReportDates frd = new frmReportDates(rtSelectedReport);
         frd.ShowDialog();
         if (frd.SelectedFolder != "$NONE")
         {
             InputTextBox("DATE").Text = frd.SelectedFolder;
             InputTextBox("STARTCAT").Focus();
         }
         else
         {
             InputTextBox("DATE").Text = "";
             InputTextBox("DATE").Focus();
         }
     }
     else if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }