コード例 #1
0
ファイル: GroupSubqualtyForm.cs プロジェクト: u4097/SQLScript
        private void dgvSubqualities_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case System.Windows.Forms.Keys.Insert:
                    this.btnAddRow_Click(sender, e);
                    return;

                case System.Windows.Forms.Keys.Delete:
                case System.Windows.Forms.Keys.Subtract:
                    this.btnDeleteSubquality_Click(sender, e);
                    return;

                case System.Windows.Forms.Keys.Enter:
                    if (!this.dgvSubqualities.CurrentCell.get_IsInEditMode())
                    {
                        this.dgvSubqualities.BeginEdit(true);
                    }
                    break;

                case System.Windows.Forms.Keys.Add:
                    if (!e.get_Control())
                    {
                        this.btnAddRow_Click(sender, e);
                        return;
                    }
                    this.btnCopySubquality_Click(sender, e);
                    return;

                case System.Windows.Forms.Keys.Separator:
                    break;

                default:
                    return;
            }
        }
コード例 #2
0
 private void ApartmentCounterIndicationInputUIView_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.get_Control() && (e.KeyCode == System.Windows.Forms.Keys.S))
     {
         this.btnSave.PerformClick();
     }
 }
コード例 #3
0
ファイル: CashierMainForm.cs プロジェクト: u4097/SQLScript
 private void tbControlPayment_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.get_Control())
     {
         this.m_SearchControl.AutoAddNextPaymentOrderPack = true;
     }
 }
コード例 #4
0
 private void dgvApartmentCounterIndicationsView_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (((e.KeyCode == System.Windows.Forms.Keys.Enter) && (this.dgvApartmentCounterIndicationsView.CurrentCell.get_ColumnIndex() == this.NewValDate.get_Index())) && ((this.dgvApartmentCounterIndicationsView.CurrentCell.get_RowIndex() + 1) <= this.dgvApartmentCounterIndicationsView.get_RowCount()))
     {
         System.Windows.Forms.DataGridViewCell currentCell = this.dgvApartmentCounterIndicationsView.CurrentCell;
         if (this.dgvApartmentCounterIndicationsView.CurrentCell.get_Selected())
         {
             this.dgvApartmentCounterIndicationsView.set_CurrentCell(this.dgvApartmentCounterIndicationsView.get_Item(this.dgcNewVal.get_Index(), currentCell.get_RowIndex()));
         }
         this.m_IsFirstUpdate = false;
     }
     if ((e.KeyCode == System.Windows.Forms.Keys.Delete) && (this.dgvApartmentCounterIndicationsView.CurrentCell.get_ColumnIndex() == this.dgcNewVal.get_Index()))
     {
         this.dgvApartmentCounterIndicationsView.CurrentCell.set_Value("");
         if ((this.dgvApartmentCounterIndicationsView.CurrentRow != null) && (this.dgvApartmentCounterIndicationsView.CurrentRow.get_DataBoundItem() is ApartmentCounterIndicationInputView))
         {
             ApartmentCounterIndicationInputView view = this.dgvApartmentCounterIndicationsView.CurrentRow.get_DataBoundItem() as ApartmentCounterIndicationInputView;
             view.IsValueChanged = false;
             view.NewVal = view.Val;
             if (view != ApartmentCounterIndicationInputView.Null)
             {
                 if ((view.Val == view.NewVal) && !view.IsValueChanged)
                 {
                     this.dgvApartmentCounterIndicationsView.CurrentRow.DefaultCellStyle.set_BackColor(System.Drawing.Color.White);
                 }
                 else if (!view.Validate())
                 {
                     this.dgvApartmentCounterIndicationsView.CurrentRow.DefaultCellStyle.set_BackColor(System.Drawing.Color.LightPink);
                 }
                 else
                 {
                     this.dgvApartmentCounterIndicationsView.CurrentRow.DefaultCellStyle.set_BackColor(System.Drawing.Color.PaleGreen);
                 }
             }
         }
     }
     if ((e.KeyCode == System.Windows.Forms.Keys.Enter) && ((this.dgvApartmentCounterIndicationsView.CurrentCell.get_RowIndex() + 1) == this.dgvApartmentCounterIndicationsView.get_RowCount()))
     {
         this.SaveIndications();
     }
     if ((e.get_Control() && (e.KeyCode == System.Windows.Forms.Keys.Multiply)) && (this.dgvApartmentCounterIndicationsView.CurrentCell != null))
     {
         System.Windows.Forms.DataGridViewCell cell2 = this.dgvApartmentCounterIndicationsView.CurrentCell;
         if ((cell2.get_ColumnIndex() == this.NewValDate.get_Index()) && (cell2.get_RowIndex() >= 0))
         {
             System.DateTime date = (System.DateTime) cell2.get_Value();
             this.SetGlobalIndicationDate(date);
             e.set_SuppressKeyPress(true);
         }
         this.dgvApartmentCounterIndicationsView.set_CurrentCell(cell2);
     }
 }