/// <summary>
        /// 获取选中行对应的实体类集合(允许多选),如果没有选中行则返回空
        /// </summary>
        /// <param name="bindingSource">绑定数据源</param>
        /// <returns>选中行对应的实体类集合</returns>
        public object[] GetSelectedObjects(BindingSourceEx bindingSource)
        {
            if (_DataViewType == DataViewType.GridView)
            {
                var rowHandles = _GridView.GetSelectedRows();

                List <object> objects = new List <object>();

                foreach (var rowHandle in rowHandles)
                {
                    objects.Add(bindingSource[this._GridView.GetDataSourceRowIndex(rowHandle)]);
                }

                return(objects.ToArray());
            }
            else if (_DataViewType == DataViewType.TreeListView)
            {
                List <object> objects = new List <object>();

                foreach (TreeListNode node in _TreeList.Selection)
                {
                    var data = _TreeList.GetDataRecordByNode(node);
                    if (!objects.Contains(data))
                    {
                        objects.Add(data);
                    }

                    var descendantNodes = GetDescendantNodes(node);
                    //有子节点
                    if (descendantNodes != null && descendantNodes.Count() > 0)
                    {
                        foreach (var descendantNode in descendantNodes)
                        {
                            var data2 = _TreeList.GetDataRecordByNode(descendantNode);
                            if (!objects.Contains(data2))
                            {
                                objects.Add(data2);
                            }
                        }
                    }
                }

                return(objects.ToArray());
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
 private void SelectItem()
 {
     if (grdView.RowCount > 0)
     {
         System.Data.DataRow Row = grdView.GetDataRow(grdView.GetSelectedRows()[0]);
         selectedDescription = (string)Row["DESCRIPTION"];
         selectedSubCodeId   = (string)Row["SUBCODEID"];
         triggerCode         = (string)Row["TRIGGERCODE"];
         triggerFunction     = (int)Row["TRIGGERFUNCTION"];
         priceType           = (int)Row["PRICETYPE"];
         amountPercent       = (decimal)Row["AMOUNTPERCENT"];
         this.DialogResult   = System.Windows.Forms.DialogResult.OK;
         Close();
     }
 }
        private void btnDown_Click(object sender, EventArgs e)
        {
            grdView.MoveNextPage();
            int topRowIndex = grdView.TopRowIndex;

            if ((grdView.IsLastRow) && (grdView.RowCount > 0))
            {
                System.Data.DataRow Row = grdView.GetDataRow(grdView.GetSelectedRows()[0]);
                string lastItemName     = Row["INVENTSERIALID"].ToString();
                itemTable.Merge(GetItemList(lastItemName, txtKeyboardInput.Text, getHowManyRows));
                grdView.TopRowIndex = topRowIndex;
            }

            txtKeyboardInput.Select();
        }
Пример #4
0
        private void BorrarFilasSeleccionadas(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            if (view == null || view.SelectedRowsCount == 0)
            {
                return;
            }

            DataRow[] rows = new DataRow[view.SelectedRowsCount];

            for (int i = 0; i < view.SelectedRowsCount; i++)
            {
                rows[i] = view.GetDataRow(view.GetSelectedRows()[i]);
            }

            view.BeginSort();

            try
            {
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }
            finally
            {
                view.EndSort();
            }
        }
Пример #5
0
        void overAllCon(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            int []         rows;
            List <DataRow> row = new List <DataRow> ( );

            rows = view.GetSelectedRows( );
            if (rows.Length <= 0)
            {
                return;
            }
            if (MessageBox.Show("确认已开?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            foreach (int i in rows)
            {
                row.Add(view.GetDataRow(i));
            }
            if (row.Count > 0)
            {
                foreach (DataRow r in row)
                {
                    _bll.UpdateOver(r);
                }
            }
        }
Пример #6
0
 /// <summary>
 /// 显示病历信息方法
 /// </summary>
 private void ShowEmrMessage()
 {
     try
     {
         foreach (RecordModel re in listAll)
         {
             if (re.Index == this.tabControl.SelectedTabPageIndex)
             {
                 MedicalRecordBrowse mf = re.MyControl;
                 DevExpress.XtraGrid.Views.Grid.GridView dbGridView = mf.dbGridView;
                 if (dbGridView.RowCount > 0)
                 {
                     int[] list = dbGridView.GetSelectedRows();
                     if (list.Length > 0)
                     {
                         string status = dbGridView.GetRowCellValue(list[0], "STATUS").ToString();
                         //调用病历查看窗口,进行病历的查询
                         if (status.Equals("2"))
                         {
                             string noofinpat = dbGridView.GetRowCellValue(list[0], "NOOFINPAT").ToString();
                             LoadEmrContent(noofinpat);
                         }
                     }
                 }
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void DelRow()
        {
            if (gridView == null || gridView.GridControl == null)
            {
                return;
            }

            int[] rowIndexes = gridView.GetSelectedRows(); // 선택된 Row 모두 가져옴
            if (rowIndexes == null)
            {
                return;
            }
            IList <T> delList = new List <T>();

            foreach (int index in rowIndexes)
            {
                T entity = (T)gridView.GetRow(index);
                if (entity == null)
                {
                    continue;
                }
                delList.Add(entity);
                gridView.DeleteRow(index);     // Delete selectrows from view
            }
            //gridView.DeleteSelectedRows();  // 한번에 선택된 Row 모두 삭제

            this.Delete(delList);
        }
Пример #8
0
 private void ShowMenu(ref DevExpress.XtraGrid.Views.Grid.GridView gridView, object sender, MouseEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hitinfo = gridView.CalcHitInfo(e.Location);
     if (e.Button == MouseButtons.Right)
     {
         toolStripMenuItemAdd.Enabled  = true;
         toolStripMenuItemDel.Enabled  = true;
         toolStripMenuItemMvDn.Enabled = true;
         toolStripMenuItemMvUp.Enabled = true;
         if (!hitinfo.InRow)
         {
             toolStripMenuItemMvUp.Enabled = false;
             toolStripMenuItemMvDn.Enabled = false;
             toolStripMenuItemDel.Enabled  = false;
         }
         else
         {
             int[] index = gridView.GetSelectedRows();
             if (index[0] == 0)
             {
                 toolStripMenuItemMvUp.Enabled = false;
             }
             if (index[0] == gridView.RowCount - 1)
             {
                 toolStripMenuItemMvDn.Enabled = false;
             }
         }
         MenuStripOpera.Show(MousePosition);
         Console.WriteLine(CurrentgridView.Name);
     }
 }
Пример #9
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeApplyList(DevExpress.XtraGrid.Views.Grid.GridView dbGridView)
        {
            try
            {
                m_listObject.Clear();
                int[] rows = dbGridView.GetSelectedRows();
                for (int i = 0; i < rows.Length; i++)
                {
                    CApplyObject m_applyObject = new CApplyObject();
                    m_applyObject.Clear();

                    m_applyObject.m_sNoOfInpat      = dbGridView.GetRowCellValue(rows[i], "NOOFINPAT").ToString();
                    m_applyObject.m_sName           = dbGridView.GetRowCellValue(rows[i], "NAME").ToString();
                    m_applyObject.m_sDepartmentName = dbGridView.GetRowCellValue(rows[i], "CYKS").ToString();

                    m_applyObject.m_iApplyTimes   = int.Parse(dbGridView.GetRowCellValue(rows[i], "APPLYTIMES").ToString());
                    m_applyObject.m_sApplyContent = dbGridView.GetRowCellValue(rows[i], "APPLYCONTENT").ToString();
                    m_applyObject.m_sApply        = dbGridView.GetRowCellValue(rows[i], "ID").ToString();
                    m_applyObject.m_sApplyDocId   = this.m_sUser;

                    m_applyObject.m_sApproveContent = dbGridView.GetRowCellValue(rows[i], "APPROVECONTENT").ToString();
                    m_applyObject.m_sApproveDate    = dbGridView.GetRowCellValue(rows[i], "APPROVEDATE").ToString();
                    m_applyObject.m_sApproveDocId   = dbGridView.GetRowCellValue(rows[i], "APPROVEDOCID").ToString();
                    m_applyObject.m_sPatid          = dbGridView.GetRowCellValue(rows[i], "PATID").ToString();
                    m_listObject.Add(m_applyObject);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #10
0
        private void Deltete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("选择的设备将被删除,是否继续?", "警告", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            IList <TaskDevice> sor = this.TaskDevices;

            int[] s;
            if (GridCtl.MainView is DevExpress.XtraGrid.Views.Grid.GridView)
            {
                DevExpress.XtraGrid.Views.Grid.GridView grid = GridCtl.MainView as DevExpress.XtraGrid.Views.Grid.GridView;
                s = grid.GetSelectedRows();
            }
            else
            {
                DevExpress.XtraGrid.Views.Tile.TileView tile = GridCtl.MainView as DevExpress.XtraGrid.Views.Tile.TileView;
                s = tile.GetSelectedRows();
            }

            for (int index = s.Length - 1; index >= 0; index--)
            {
                sor.RemoveAt(s[index]);
            }
            this.IniDeviceItem(sor);
            this.GridCtl.RefreshDataSource();
        }
Пример #11
0
        private void btnRemove_Click(object sender, System.EventArgs e)
        {
            //cellValue = gridDivs.MainView.GetRowCellValue(gridDivs.MainView.FocusedRowHandle, gridDivs.MainView.Columns["Date"]).ToString();
            if (listDataSourceVisible.Count == 0)
            {
                btnRemove.Enabled    = false;
                btnRemoveAll.Enabled = false;
                return;
            }
            int[] iSelRows = gridDividends.GetSelectedRows();
            if (iSelRows.GetLength(0) > 0)
            {
                foreach (int iItem in iSelRows)
                {
                    if ((iItem < listDataSourceVisible.Count) && (iItem >= 0))
                    {
                        listDataSourceVisible.RemoveAt(iItem);
                    }
                }
            }

            gridDivs.MainView.PopulateColumns();
            //gridDivs.MainView.
            //gridDivs.EmbeddedNavigator.
        }
Пример #12
0
        /// <summary>
        /// 显示病历信息方法
        /// </summary>
        private void ShowEmrMessage()
        {
            try
            {
                foreach (RecordWriteUpModel re in listAll)
                {
                    if (re.Index == this.tabControl.SelectedTabPageIndex)
                    {
                        MedicalRecordWriteUp mf = re.MyControl;
                        DevExpress.XtraGrid.Views.Grid.GridView dbGridView = mf.dbGridView;
                        if (dbGridView.RowCount > 0)
                        {
                            int[] list = dbGridView.GetSelectedRows();
                            if (list.Length > 0)
                            {
                                string status = dbGridView.GetRowCellValue(list[0], "STATUS").ToString();
                                //调用病历查看窗口,进行病历的查询
                                if (status.Equals("2"))
                                {
                                    string noofinpat = dbGridView.GetRowCellValue(list[0], "NOOFINPAT").ToString();
                                    //  LoadEmrContent(noofinpat);
                                    decimal syxh = decimal.Parse(noofinpat);
                                    if (syxh < 0)
                                    {
                                        return;
                                    }
                                    if (syxh < 0)
                                    {
                                        return;
                                    }

                                    if (HasBaby(noofinpat))
                                    {
                                        ChoosePatOrBaby choosepat = new ChoosePatOrBaby(SqlUtil.App, noofinpat);
                                        choosepat.StartPosition = FormStartPosition.CenterParent;
                                        if (choosepat.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                        {
                                            SqlUtil.App.ChoosePatient(decimal.Parse(choosepat.NOOfINPAT));
                                            SqlUtil.App.LoadPlugIn("DrectSoft.Core.MainEmrPad.dll", DS_BaseService.GetUCEmrInputPath());
                                        }
                                    }
                                    else
                                    {
                                        SqlUtil.App.ChoosePatient(syxh);
                                        SqlUtil.App.LoadPlugIn("DrectSoft.Core.MainEmrPad.dll", DS_BaseService.GetUCEmrInputPath());
                                    }
                                }
                            }
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #13
0
        //assign
        private void simpleButton2_Click(object sender, System.EventArgs e)
        {
            hasAssignedSucceed = true;

            if (gridView1.RowCount == 0)
            {
                MessageBox.Show("没有要分配的设备.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (!gridView1.GetDataRow(gridView1.GetSelectedRows()[0])["machine_state"].ToString().Equals("待分配") &&
                !gridView1.GetDataRow(gridView1.GetSelectedRows()[0])["machine_state"].ToString().Equals("待修改"))
            {
                MessageBox.Show("只有状态为待修改或待分配的记录才能进行分配,请选择正确的行记录.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            Login.COM_PORT_IS_BUSY = true;

            login.SuspendAllThread();
            login.assignAddress = new Thread(new ThreadStart(AssignAddress));
            login.assignAddress.IsBackground = true;
            login.assignAddress.Priority     = ThreadPriority.Normal;
            login.assignAddress.Start();
        }
Пример #14
0
        private void simpleButton2_Click(object sender, System.EventArgs e)
        {
            if (gridView2.RowCount == 0)
            {
                MessageBox.Show("请先选定一个要删除的学生号码.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int smsInfo_id = Convert.ToInt32(gridView2.GetDataRow(gridView2.GetSelectedRows()[0])["smsInfo_id"]);

            if (new SMSInfoSystem().DeleteSMSPhoneNum(smsInfo_id) > 0)
            {
                gridView2.DeleteRow(gridView2.GetSelectedRows()[0]);
                MessageBox.Show("删除成功.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #15
0
        /// <summary>
        /// 刷新界面
        /// </summary>
        /// <param name="gridView"></param>
        private void RefreshPage(ref DevExpress.XtraGrid.Views.Grid.GridView gridView)
        {
            int           handle = gridView.GetSelectedRows()[0];
            BindingSource bs     = new BindingSource();

            bs = (BindingSource)gridView.DataSource;
            gridView.GridControl.DataSource = bs;
            gridView.SelectRow(handle);
        }
Пример #16
0
        /// <summary>
        /// 获取所选行的数据对象列表
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="gdview"></param>
        /// <returns></returns>
        public static List <T> GetSelectedDataSource <T>(this DevExpress.XtraGrid.Views.Grid.GridView gdview)
        {
            var idxs = gdview.GetSelectedRows();

            if (null == idxs || idxs.Length < 1)
            {
                return(null);
            }
            return(idxs.ToList().Select(j => (T)gdview.GetRow(j)).ToList());
        }
 DataRow[] GetGridSelectedRows()
 {
     int[]     rowHandles = gridView1.GetSelectedRows();
     DataRow[] rows       = new DataRow[rowHandles.Length];
     for (int i = 0; i < rowHandles.Length; i++)
     {
         rows[i] = gridView1.GetDataRow(rowHandles[i]);
     }
     return(rows);
 }
Пример #18
0
        public long GetSelectedGridItemID(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            int[] rows = view.GetSelectedRows();
            if (view.GetRow(rows[0]) is DataRowView drv)
            {
                return((long)drv[0]);
            }

            return(0);
        }
Пример #19
0
 private static void dataGridView_KeyDown(object sender, KeyEventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView dataGridView = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     if (e.KeyCode == Keys.Enter)
     {
         if (dataGridView != null && dataGridView.SelectedRowsCount > 0)
         {
             if (dataGridView.Tag == null || !(dataGridView.Tag is EventHandler))
             {
                 return;
             }
             EventHandler eventHandle = dataGridView.Tag as EventHandler;
             if (eventHandle != null)
             {
                 //if (multiSelect)
                 //{
                 //    //List<int> selectedIndexes = new List<int>();
                 //    //foreach (DataGridViewCell cell in dataGridView.SelectedCells)
                 //    //{
                 //    //    selectedIndexes.Add(_showListItems[cell.RowIndex].Index);
                 //    //}
                 //    //selectedIndexes.Reverse();
                 //    //eventHandle(selectedIndexes.ToArray(), null);
                 //}
                 //else
                 {
                     eventHandle(dataGridView.GetDataRow(dataGridView.GetSelectedRows()[0]), null);
                 }
             }
             dataGridView.KeyPress -= dataGridView_KeyPress;
             dataGridView.KeyDown  -= dataGridView_KeyDown;
             if (dataGridView.GridControl.Parent != null && dataGridView.GridControl.Parent is DevExpress.XtraEditors.XtraForm)
             {
                 (dataGridView.GridControl.Parent as DevExpress.XtraEditors.XtraForm).Close();
             }
             //dataGridView.GridControl.Dispose();
             dataGridView.Dispose();
         }
     }
     else if (e.KeyCode == Keys.Escape)
     {
         dataGridView.KeyPress -= dataGridView_KeyPress;
         dataGridView.KeyDown  -= dataGridView_KeyDown;
         if (dataGridView.GridControl.Parent != null && dataGridView.GridControl.Parent is DevExpress.XtraEditors.XtraForm)
         {
             (dataGridView.GridControl.Parent as DevExpress.XtraEditors.XtraForm).Close();
         }
         dataGridView.GridControl.Dispose();
         dataGridView.Dispose();
         if (_callControl != null)
         {
             _callControl.Focus();
         }
     }
 }
Пример #20
0
        //single
        private void simpleButton1_Click(object sender, System.EventArgs e)
        {
            chosenPhoneNum = string.Empty;

            if (gridView2.RowCount != 0)
            {
                chosenPhoneNum = gridView2.GetDataRow(
                    gridView2.GetSelectedRows()[0])["mobilePhone_number"].ToString();
            }
            this.Close();
        }
Пример #21
0
        public static List <T> GetSelectedRows <T>(this DevExpress.XtraGrid.Views.Grid.GridView GridView)
        {
            List <T> list = new List <T>();

            foreach (int i in GridView.GetSelectedRows())
            {
                T item = (T)GridView.GetRow(i);
                list.Add(item);
            }
            return(list);
        }
Пример #22
0
        private void DeleteSelectedRows(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            //Start : added on 26/05/2014
            int     iNoSku     = Convert.ToInt32(lblTotNoOfSKU.Text);
            int     iNoOfSetOf = Convert.ToInt32(lblTotSetOf.Text);
            decimal dTotQty    = Convert.ToDecimal(lblTotQty.Text);

            //End : added on 26/05/2014

            if (view == null || view.SelectedRowsCount == 0)
            {
                return;
            }

            DataRow[] rows = new DataRow[view.SelectedRowsCount];
            for (int i = 0; i < view.SelectedRowsCount; i++)
            {
                rows[i] = view.GetDataRow(view.GetSelectedRows()[i]);
            }
            view.BeginSort();
            try
            {
                //Start : added on 26/05/2014
                foreach (DataRow dr in rows)
                {
                    iNoSku     = iNoSku - 1;
                    iNoOfSetOf = iNoOfSetOf - Convert.ToInt32(dr[1]);
                    dTotQty    = dTotQty - Convert.ToDecimal(dr[2]);
                }

                lblTotNoOfSKU.Text = Convert.ToString(iNoSku);
                lblTotSetOf.Text   = Convert.ToString(iNoOfSetOf);
                lblTotQty.Text     = Convert.ToString(dTotQty);

                foreach (DataRow rn in rows)
                {
                    foreach (DataRow row in dtSku.Rows)
                    {
                        if (Convert.ToString(row["SkuNumber"]) == Convert.ToString(rn[0]))
                        {
                            row.Delete();
                            break;
                        }
                    }
                }
                dtSku.AcceptChanges();
                //End : added on 26/05/2014
            }
            finally
            {
                view.EndSort();
            }
        }
Пример #23
0
 private void SelectItem()
 {
     if (grdView.RowCount > 0)
     {
         selectedDataRow   = grdView.GetDataRow(grdView.GetSelectedRows()[0]);
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         Close();
     }
     else
     {
         txtKeyboardInput.Select();
     }
 }
Пример #24
0
        private void LayDSNV_DuocChon(DevExpress.XtraGrid.Views.Grid.GridView grid_DSNV, List <cUserInfo> dsnv_duocChon)
        {
            int[]        selectedRowHandle = grid_DSNV.GetSelectedRows();
            BUS_NhanVien busNhanVien       = new BUS_NhanVien();

            foreach (int rowHandle in selectedRowHandle)
            {
                DataRow   dataRow = grid_DSNV.GetDataRow(rowHandle);
                cUserInfo nhanvien;
                busNhanVien.KhoiTaoNV(dataRow, m_AllNhomCa, out nhanvien);
                dsnv_duocChon.Add(nhanvien);
            }
        }
Пример #25
0
        private void simpleButton_DeleteSms_Click(object sender, System.EventArgs e)
        {
            if (gridView2.RowCount == 0)
            {
                MessageBox.Show("请先选择要删除的回复!", "出错了!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int replyID = Convert.ToInt32(gridView2.GetDataRow(gridView2.GetSelectedRows()[0])["replyContent_id"]);

            if (new SMSInfoSystem().DeleteSMSReply(replyID) > 0)
            {
                gridView2.DeleteRow(gridView2.GetSelectedRows()[0]);
                MessageBox.Show("删除成功!", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("删除失败!", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #26
0
 private void Updatedt29ETA(DataColumnChangeEventArgs e)//Piriou
 {
     if (e.Column.Table.TableName == "MT29")
     {
         DevExpress.XtraGrid.Views.Grid.GridView gvMain = gc.MainView as DevExpress.XtraGrid.Views.Grid.GridView;
         int[] id = gvMain.GetSelectedRows();
         foreach (int i in id)
         {
             DataRow dr = gvMain.GetDataRow(i);
             dr["ETA"] = e.Row["ETADate"];
             dr.EndEdit();
         }
     }
 }
Пример #27
0
 private void UpdateDT38(DataColumnChangeEventArgs e)//Chọn Xe giao hàng, Khải hoàn
 {
     if (e.Column.Table.TableName == "MT38")
     {
         DevExpress.XtraGrid.Views.Grid.GridView gvMain = gc.MainView as DevExpress.XtraGrid.Views.Grid.GridView;
         int[] id = gvMain.GetSelectedRows();
         foreach (int i in id)
         {
             DataRow dr = gvMain.GetDataRow(i);
             dr["MaXe"] = e.Row["MaXe"];
             dr.EndEdit();
         }
     }
 }
Пример #28
0
        private void simpleButton_DeleteTemp_Click(object sender, System.EventArgs e)
        {
            if (gridView1.RowCount == 0)
            {
                MessageBox.Show("请先选择要删除的模板.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int tempID = Convert.ToInt32(gridView1.GetDataRow(gridView1.GetSelectedRows()[0])["templet_id"]);

            if (new SMSInfoSystem().DeleteSMSTemp(tempID) > 0)
            {
                gridView1.DeleteRow(gridView1.GetSelectedRows()[0]);
                MessageBox.Show("模板删除成功.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("模板删除失败,请重试.", "系统信息!",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #29
0
 private void SelectItem()
 {
     lastActiveDateTime = DateTime.Now;
     if (grdView.RowCount > 0)
     {
         System.Data.DataRow Row = grdView.GetDataRow(grdView.GetSelectedRows()[0]);
         selectedOverrideCode = (string)Row["CODE"];
         this.DialogResult    = DialogResult.OK;
         Close();
     }
     else
     {
         txtKeyboardInput.Select();
     }
 }
Пример #30
0
        private void toolStripMenuItemMvUp_Click(object sender, EventArgs e)
        {
            int           i  = CurrentgridView.GetSelectedRows()[0];
            BindingSource bs = (BindingSource)CurrentgridView.DataSource;

            if (CurrentgridView.Name == "gridView3")
            {
                List <TStep> list = (List <TStep>)bs.DataSource;
                TStep        temp = list[i];
                list[i]     = list[i - 1];
                list[i - 1] = temp;
            }
            else if (CurrentgridView.Name == "gridView6")
            {
                List <TCMD> list = (List <TCMD>)bs.DataSource;
                TCMD        temp = list[i];
                list[i]     = list[i - 1];
                list[i - 1] = temp;
            }
            else if (CurrentgridView.Name == "Result_judge_subview")
            {
                List <subCondition> list = (List <subCondition>)bs.DataSource;
                subCondition        temp = list[i];
                list[i]     = list[i - 1];
                list[i - 1] = temp;
            }
            else
            {
                List <TCondition> list = (List <TCondition>)bs.DataSource;
                TCondition        temp = list[i];
                list[i]     = list[i - 1];
                list[i - 1] = temp;
            }
            setAllPage();
            SaveToFile();
        }