Example #1
0
 private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (base.OrderCode == CmdParam.OrderCode.设置多功能区域报警)
     {
         DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell;
         if ((currentCell.ColumnIndex == this.dgvArea.Columns["BeginTime"].Index) || ((currentCell.ColumnIndex == this.dgvArea.Columns["EndTime"].Index) && this.isSetTime(currentCell.RowIndex)))
         {
             SetDateTime time = new SetDateTime(currentCell.Value.ToString(), false); ///ToString
             if (time.ShowDialog() == DialogResult.OK)
             {
                 currentCell.Value = time.Time;
             }
         }
         if (currentCell.ColumnIndex == this.dgvArea.Columns["AlarmCondition"].Index)
         {
             SetAlarmCondition condition = new SetAlarmCondition(this.m_sCustName) {
                 AlarmCondition = currentCell.Value.ToString()
             };
             if (condition.ShowDialog() == DialogResult.OK)
             {
                 currentCell.Value = condition.AlarmCondition;
             }
         }
         if (currentCell.ColumnIndex == this.dgvArea.Columns["区域属性"].Index)
         {
             System.Drawing.Point location = this.dgvArea.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location;
             this._区域属性.ShowDropDown(new System.Drawing.Point(location.X + 3, (location.Y + this._区域属性.Height) + 150));
         }
     }
 }
Example #2
0
 private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (base.OrderCode == CmdParam.OrderCode.设置多功能区域报警)
     {
         DataGridViewCell currentCell = ((DataGridView) sender).CurrentCell;
         if ((currentCell.ColumnIndex == this.dgvArea.Columns["BeginTime"].Index) || (currentCell.ColumnIndex == this.dgvArea.Columns["EndTime"].Index))
         {
             SetDateTime time = new SetDateTime(currentCell.Value.ToString());  ///ToString
             if (time.ShowDialog() == DialogResult.OK)
             {
                 currentCell.Value = time.Time;
             }
         }
         if (currentCell.ColumnIndex == this.dgvArea.Columns["AlarmCondition"].Index)
         {
             SetAlarmCondition condition = new SetAlarmCondition(this.m_sCustName) {
                 AlarmCondition = currentCell.Value.ToString()
             };
             if (condition.ShowDialog() == DialogResult.OK)
             {
                 currentCell.Value = condition.AlarmCondition;
             }
         }
     }
 }