/// <summary> /// Mo form KhachAo de edit /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridKhachAo_DoubleClick(object sender, EventArgs e) { gridKhachAo.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection; if (gridKhachAo.SelectedItems.Count > 0) { GridEXRow row = ((GridEXSelectedItem)gridKhachAo.SelectedItems[0]).GetRow(); DanhBaKhachAo objKhachAo = (DanhBaKhachAo)((GridEXSelectedItem)gridKhachAo.SelectedItems[0]).GetRow().DataRow; frmKhachAo frm = new frmKhachAo(objKhachAo, false); if (frm.ShowDialog(this) == DialogResult.OK) { objKhachAo = frm.GetKhachAo(); frm.Dispose(); //Insert DataBase if (!objKhachAo.Update()) { new MessageBox.MessageBoxBA().Show("Lỗi thêm mới khách ảo"); return; } else { //Load lai grid LoadListKhachAo(); } } else { return; } } }
private void gridViewDanhMucKhachAo_DoubleClick(object sender, EventArgs e) { try { if (gridViewDanhMucKhachAo.SelectedRowsCount > 0) { DanhBaKhachAo objKhachAo = (DanhBaKhachAo)gridViewDanhMucKhachAo.GetFocusedRow(); frmKhachAo frm = new frmKhachAo(objKhachAo, false); frm.ShowDialog(this); if (frm.IsSuccess) { objKhachAo = frm.GetKhachAo(); frm.Dispose(); if (!objKhachAo.Update()) { new MessageBox.MessageBoxBA().Show("Lỗi khi sửa khách ảo!"); } else { LoadListKhachAo(); } } } } catch (Exception ex) { LogError.WriteLogError("gridViewDanhMucKhachAo_DoubleClick: ", ex); } }