コード例 #1
0
ファイル: ClientAddEditForm.cs プロジェクト: rusich/uir2
        private void wallsGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var ws      = (WallSize)wallsGrid.SelectedRows[0].DataBoundItem;
            var ws_edit = new WallSize {
                Height = ws.Height, Length = ws.Length, NumberOfWalls = ws.NumberOfWalls
            };

            switch (e.ColumnIndex)
            {
            //walls edit
            case 3:
                using (var frm = new WallAddEditForm(ws_edit))
                {
                    frm.Theme = this.Theme;
                    frm.Style = this.Style;
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        ws.Height        = ws_edit.Height;
                        ws.Length        = ws_edit.Length;
                        ws.NumberOfWalls = ws_edit.NumberOfWalls;
                        wallsGrid.Refresh();
                    }
                }
                break;

            //walls delete
            case 4:
                db.WallSizes.Remove(ws);
                wallSizeBindingSource.Remove(ws);
                wallsGrid.Refresh();
                break;

            default:
                break;
            }
        }
コード例 #2
0
ファイル: WallAddEditForm.cs プロジェクト: rusich/uir2
 public WallAddEditForm(WallSize obj)
 {
     InitializeComponent();
     WallSizeInfo = obj;
     wallSizeBindingSource.DataSource = WallSizeInfo;
 }