Beispiel #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmChiPhi f = new frmChiPhi();

            if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                f.Dispose();
                gridControl1.DataSource = ChiPhiController.GetAllList();
            }
        }
Beispiel #2
0
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            int intRow      = gridView1.FocusedRowHandle;
            int intChiPhiID = -1;

            if (intRow > 0)
            {
                intChiPhiID = Convert.ToInt32(gridView1.GetRowCellValue(intRow, "ChiPhiID").ToString());
            }
            if (intChiPhiID >= 0)
            {
                frmChiPhi f = new frmChiPhi();
                f.editItem = ChiPhiController.GetITem(intChiPhiID);
                f.frmMode  = "edit";
                f.ShowDialog();
                if ((gridView1.GetRowCellValue(intRow, "ChiPhiID")) != null)
                {
                    gridControl1.DataSource    = ChiPhiController.GetAllList();
                    gridView1.FocusedRowHandle = intRow;
                }
            }
        }