/// <summary> /// Sửa /// </summary> /// <param name="id"></param> private void OnModify(int id) { try { ucDmHocViCT userControl = new ucDmHocViCT(); // Yêu cầu lock bản ghi cần sửa UtilitiesProcess process = new UtilitiesProcess(); List <int> listLockId = new List <int>(); listLockId.Add(id); bool ret = process.LockData(DatabaseConstant.Module.NSTL, DatabaseConstant.Function.NS_DM_HOC_VI_CT, DatabaseConstant.Table.NS_DM_HOC_VI, DatabaseConstant.Action.SUA, listLockId); if (ret) { userControl.OnSavingCompleted += new EventHandler(userControl_OnSavingCompleted); userControl.Action = DatabaseConstant.Action.SUA; userControl.ID = id; Window window = new Window(); window.Title = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.NS_DM_HOC_VI_CT); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Content = userControl; window.ShowDialog(); } else { LMessage.ShowMessage("M.ResponseMessage.Common.LockDataInvalid", LMessage.MessageBoxType.Information); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
/// <summary> /// Sửa dữ liệu /// </summary> private void onModify(int id, string loaiDoiTuong) { ucRegistrationCT ct = new ucRegistrationCT(); ct.ID = id; ct.LOAIDOITUONG = loaiDoiTuong; LoadDuLieuCT dlgLoadDuLieuCT = new LoadDuLieuCT(ct.beforeModifyFromList); dlgLoadDuLieuCT(); Window window = new Window(); window.Title = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.SYS_JOB_SUBSCRIBE); window.Content = ct; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Height = 200; window.Width = 500; window.ResizeMode = ResizeMode.NoResize; window.ShowDialog(); BuildGridDoiTuong(); loadWidthColumnDoiTuong(); }
/// <summary> /// Xử lý sự kiện sửa /// </summary> private void Sua() { DataRowView dr = (DataRowView)grKhachHangDS.SelectedItem; if (dr == null) { LMessage.ShowMessage("M.DungChung.ChuaChonBanGhi", LMessage.MessageBoxType.Warning); return; } else { Window window = new Window(); KIEM_SOAT obj = new KIEM_SOAT(); obj.action = DatabaseConstant.Action.SUA; obj.ID = Convert.ToInt32(dr["ID"]); ucHanMucTong uc = new ucHanMucTong(obj); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.HM_TONG); window.Content = uc; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.ShowDialog(); } }
private void Xem() { if (!tlbView.IsEnabled) { return; } Cursor = System.Windows.Input.Cursors.Wait; if (grdTinNhanDenDS.SelectedItems.Count == 1) { MODEM modem = grdTinNhanDenDS.SelectedItem as MODEM; ucThietBiCT objThietBiCt = new ucThietBiCT(modem); string tittle = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.SMS_QUAN_LY_KET_NOI); Window window = new Window(); window.Title = tittle; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Content = objThietBiCt; window.ShowDialog(); } else if (grdTinNhanDenDS.SelectedItems.Count > 1) { LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning); } Cursor = System.Windows.Input.Cursors.Arrow; }