コード例 #1
0
        /// <summary>
        /// 添加区域
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm_AreaDefine areaDefine = new Frm_AreaDefine("", 0);

            areaDefine.ShowDialog();
            if (areaDefine.DialogResult == DialogResult.OK)
            {
                LoadArea();
            }
        }
コード例 #2
0
        /// <summary>
        /// 编辑区域
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int selectedHandle;

            selectedHandle = this.gridView1.GetSelectedRows()[0];
            if (selectedHandle >= 0)
            {
                string         areaid     = this.gridView1.GetRowCellValue(selectedHandle, "Areaid").ToString();
                Frm_AreaDefine areaDefine = new Frm_AreaDefine(areaid, 1);
                areaDefine.ShowDialog();
                if (areaDefine.DialogResult == DialogResult.OK)
                {
                    LoadArea();
                }
            }
        }
コード例 #3
0
        private void gridView_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                GridHitInfo hInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
                if (e.Button == MouseButtons.Left && e.Clicks == 2)
                {
                    int     rowIndex = gridView1.FocusedRowHandle;
                    DataRow dr       = gridView1.GetDataRow(rowIndex);
                    string  areaID   = dr["AreaID"].ToString();

                    Frm_AreaDefine fa = new Frm_AreaDefine(areaID, 1);
                    fa.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }