/// <summary>
        /// Column Doubleclick Event Handler Function.
        /// Enable User to edit/delete/configDatapoints of the selected Sample Group.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void IntervalConfigDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string Function_Name = "IntervalConfigDataGridView_CellDoubleClick";

            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }
                string localIntervalGrpID = m_view.GetDataGridValue(e.RowIndex, OPCSampleGrpConfigStart.OPCSAMPLEGRP_IDCOL_INDEX);

                //Load selected sample group in the edit group controls
                if (e.ColumnIndex == OPCSampleGrpConfigStart.OPCSAMPLEGRP_EDITCOLUMN_INDEX)
                {
                    LoadEditData(localIntervalGrpID);
                }

                // Deletes the selected sampel group and refresh the datagrid.
                else if (e.ColumnIndex == OPCSampleGrpConfigStart.OPCSAMPLEGRP_DELETECOLUMN_INDEX)
                {
                    string messageTxt = StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCSAMPLECONFIG_DELETEMSG, EnglishString.MSG_DELETE_CONFIRM);
                    if (MessageBoxDialog.Show(string.Format(messageTxt, m_view.GetDataGridValue(e.RowIndex, 1)),
                                              StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCSAMPLECONFIG_DELETEMSGTITLE, EnglishString.MSG_SYSTEM_TITLE), MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "Yes")
                    {
                        bool result = m_model.DeleteOPCSampleGrp(localIntervalGrpID);
                        if (!result)
                        {
                            MessageBoxDialog.Show(StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCSAMPLECONFIG_DELETEFAILED_MSG, EnglishString.MSG_DELETE_MSG));
                        }
                        else
                        {
                            m_DPGroupTrendList.Remove(GetOPCSampleGrp(localIntervalGrpID));
                            m_view.PopulateIntervalConfigDataGridView(2);
                        }
                    }
                }

                // Opens the DataPoint selector form
                else if (e.ColumnIndex == OPCSampleGrpConfigStart.OPCSAMPLEGRP_CONFIGCOLUMN_INDEX)
                {
                    IView view = ViewManager.GetInstance().GetView(OPCDataSelector.OPCDATASELECTORFRM);
                    ((OPCDataSelectorController)view.getController()).m_localIntervalGrpID       = localIntervalGrpID;
                    ((OPCDataSelectorController)view.getController()).m_localIntervalGrpLocation = m_view.GetDataGridValue(e.RowIndex, OPCSampleGrpConfigStart.OPCSAMPLEGRP_LOCATIONNAME_INDEX);
                    view.PutObject(OPCDataSelector.PARENTINTERVALNAME, m_view.GetDataGridValue(e.RowIndex, OPCSampleGrpConfigStart.OPCSAMPLEGRP_NAMECOL_INDEX));
                    view.ShowView(true);
                }
            }
            catch (Exception localException)
            {
                LogHelper.Error(CLASS_NAME, Function_Name, localException.ToString());
            }
        }
Example #2
0
 public void TestGetDataGridValue01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         int    nRow    = 0;
         int    nColumn = int.MinValue;
         string str     = oPCSampleGrpConfigStart.GetDataGridValue(nRow, nColumn);
     }
 }