private void ResetForm() { //Biến obj = null; id = 0; //Thông tin chung lblTrangThai.Content = ""; txtMa.Text = ""; txtTen.Text = ""; txtMoTa.Text = ""; //Thông tin kiểm soát txtTrangThaiBanGhi.Text = ""; raddtNgayLap.Value = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd"); txtNguoiLap.Text = ClientInformation.TenDangNhap; raddtNgayCapNhat.Value = null; txtNguoiCapNhat.Text = ""; }
public void OnModify(NS_DM_DVI_CTAC obj) { Mouse.OverrideCursor = Cursors.Wait; try { NhanSuProcess processNhanSu = new NhanSuProcess(); List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); bool ret = false; ret = processNhanSu.DonViCongTac(DatabaseConstant.Action.SUA, ref obj, ref listClientResponseDetail); AfterModify(ret, obj, listClientResponseDetail); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
public void AfterModify(bool ret, NS_DM_DVI_CTAC obj, List <ClientResponseDetail> listClientResponseDetail) { try { if (ret) { LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information); trangThaiNVu = obj.TTHAI_NVU; lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(trangThaiNVu); txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI); raddtNgayCapNhat.Value = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd"); txtNguoiCapNhat.Text = ClientInformation.TenDangNhap; BeforeViewFromDetail(); } else { CommonFunction.ThongBaoKetQua(listClientResponseDetail); } // Yêu cầu Unlock bản ghi cần sửa UtilitiesProcess process = new UtilitiesProcess(); List <int> listLockId = new List <int>(); listLockId.Add(id); bool retUnlockData = process.UnlockData(DatabaseConstant.Module.NSTL, DatabaseConstant.Function.NS_DM_DVI_CTAC_CT, DatabaseConstant.Table.NS_DM_DVI_CTAC, DatabaseConstant.Action.SUA, listLockId); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } }
/// <summary> /// Xóa /// </summary> /// <param name="listId"></param> private void OnDelete(List <int> listId) { NhanSuProcess processNhanSu = new NhanSuProcess(); Mouse.OverrideCursor = Cursors.Wait; try { List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); List <NS_DM_DVI_CTAC> lstDMDonViCongTac = new List <NS_DM_DVI_CTAC>(); NS_DM_DVI_CTAC obj = null; foreach (int id in listId) { obj = new NS_DM_DVI_CTAC(); obj.ID = id; lstDMDonViCongTac.Add(obj); } bool ret = processNhanSu.DanhSachDonViCongTac(DatabaseConstant.Action.XOA, ref lstDMDonViCongTac, ref listClientResponseDetail); AfterDelete(ret, listId, listClientResponseDetail); } catch (System.Exception ex) { // Yêu cầu unlock dữ liệu UtilitiesProcess process = new UtilitiesProcess(); bool retUnlockData = process.UnlockData(DatabaseConstant.Module.NSTL, DatabaseConstant.Function.NS_DM_DVI_CTAC_DS, DatabaseConstant.Table.NS_DM_DVI_CTAC, DatabaseConstant.Action.XOA, listId); this.Cursor = Cursors.Arrow; CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }