private void btnAdd_Click(object sender, EventArgs e) { frmAddNhaCungCap f = new frmAddNhaCungCap(); f.ShowDialog(this); gridControl1.DataSource = NhaCungCapControlller.GetList(); }
private void lookUpEditNhaCungCap_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Caption.ToUpper().Equals("ADD")) { frmAddNhaCungCap f = new frmAddNhaCungCap(); f.ShowDialog(this); lookUpEditNhaCungCap.Properties.DataSource = NhaCungCapControlller.GetList(); if (f.strNewNhaCungCapID != string.Empty) { lookUpEditNhaCungCap.EditValue = f.strNewNhaCungCapID; } f.Dispose(); } }
private void gridView1_DoubleClick(object sender, EventArgs e) { int intRow = gridView1.FocusedRowHandle; if (intRow >= 0) { string strNhaCungCapID = gridView1.GetRowCellValue(intRow, "NhaCungCapID").ToString(); NhaCungCap item = NhaCungCapControlller.GetItem(strNhaCungCapID); if (item != null) { frmAddNhaCungCap f = new frmAddNhaCungCap(); f.frmMode = "edit"; f.EditItem = item; if (f.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { gridControl1.DataSource = NhaCungCapControlller.GetList(); gridView1.FocusedRowHandle = intRow; } } } }