public void AfterAddNew(bool ret, DM_LOAI_DTUONG obj, List <ClientResponseDetail> listClientResponseDetail) { try { if (ret) { LMessage.ShowMessage("M.DungChung.ThemThanhCong", LMessage.MessageBoxType.Information); if (chkThemNhieuLan.IsChecked == true) { BeforeAddNew(); } else { id = obj.ID; trangThaiNVu = obj.TTHAI_NVU; lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(trangThaiNVu); txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI); BeforeViewFromDetail(); } } else { CommonFunction.ThongBaoKetQua(listClientResponseDetail); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } }
public void OnSave() { try { if (!Validation()) { return; } obj = new DM_LOAI_DTUONG(); GetFormData(ref obj); if (action == DatabaseConstant.Action.THEM) { OnAddNew(obj); } else if (action == DatabaseConstant.Action.SUA) { OnModify(obj); } } catch (Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
private void ShowPopupMaThamChieu() { //ClientInformation.MaDonVi //ClientInformation.MaDonViGiaoDich //ClientInformation.TenDangNhap //ClientInformation.NgayLamViecHienTai //lay loai tham chieu List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); DanhMucProcess DanhMucProcess = new DanhMucProcess(); DM_LOAI_DTUONG dmDoiTuongLoai = new DM_LOAI_DTUONG(); int idDoiTuongLoai; if (cmbLoaiDoiTuong.SelectedIndex >= 0 && int.TryParse(lstSourceDoiTuongLoai.ElementAt(cmbLoaiDoiTuong.SelectedIndex).KeywordStrings.ElementAt(1).ToString().Trim(), out idDoiTuongLoai)) { dmDoiTuongLoai.ID = idDoiTuongLoai; DanhMucProcess.getDoiTuongLoaiById(dmDoiTuongLoai.ID, ref dmDoiTuongLoai, ref listClientResponseDetail); } List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(ClientInformation.TenDangNhap); lstDieuKien.Add(ClientInformation.NgayLamViecHienTai); var process = new PopupProcess(); process.getPopupInformation(dmDoiTuongLoai.NGUON_TAO_DL, lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { DataRow row = lstPopup[0]; txtMaThamChieu.Text = row[1].ToString(); txtTenDoiTuong.Text = row[2].ToString(); } }
private void ResetForm() { //Biến obj = null; id = 0; //Thông tin chung lblTrangThai.Content = ""; txtMota.Text = ""; txtNguonTaoDL.Text = ""; txtMaLoaiDTuong.Text = ""; txtTenLoaiDTuong.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 = ""; }
private void GetFormData(ref DM_LOAI_DTUONG obj) { try { obj.ID = id; obj.TEN_LOAI_DTUONG = txtTenLoaiDTuong.Text; obj.MA_LOAI_DTUONG = txtMaLoaiDTuong.Text; obj.MO_TA = txtMota.Text; obj.NGUON_TAO_DL = txtNguonTaoDL.Text; #region Thông tin kiểm soát if (action != DatabaseConstant.Action.THEM) { obj.TTHAI_BGHI = TTHAI_BGHI; obj.TTHAI_NVU = TTHAI_NVU; obj.MA_DVI_QLY = MA_DVI_QLY; obj.MA_DVI_TAO = MA_DVI_TAO; obj.NGAY_NHAP = NGAY_NHAP; obj.NGUOI_NHAP = NGUOI_NHAP; obj.NGAY_CNHAT = ClientInformation.NgayLamViecHienTai; obj.NGUOI_CNHAT = ClientInformation.TenDangNhap; } else { obj.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(); obj.TTHAI_NVU = trangThaiNVu; obj.MA_DVI_QLY = ClientInformation.MaDonVi; obj.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich; obj.NGAY_NHAP = Convert.ToDateTime(raddtNgayLap.Value).ToString("yyyyMMdd"); obj.NGUOI_NHAP = txtNguoiLap.Text; } #endregion } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } }
public void OnModify(DM_LOAI_DTUONG obj) { Mouse.OverrideCursor = Cursors.Wait; try { DanhMucProcess processDanhMuc = new DanhMucProcess(); List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); bool ret = false; ret = processDanhMuc.SuaDoiTuongLoai(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, DM_LOAI_DTUONG 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.DMDC, DatabaseConstant.Function.DC_DM_LOAI_DTUONG, DatabaseConstant.Table.DM_LOAI_DTUONG, DatabaseConstant.Action.SUA, listLockId); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } }
private void SetFormData() { Mouse.OverrideCursor = Cursors.Wait; try { DanhMucProcess processDanhMuc = new DanhMucProcess(); List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); bool ret = false; obj = new DM_LOAI_DTUONG(); obj.ID = id; ret = processDanhMuc.getDoiTuongLoaiById(id, ref obj, ref listClientResponseDetail); if (ret == true) { id = obj.ID; #region Thông tin chung lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU); txtMota.Text = obj.MO_TA; txtNguonTaoDL.Text = obj.NGUON_TAO_DL; txtMaLoaiDTuong.Text = obj.MA_LOAI_DTUONG; txtTenLoaiDTuong.Text = obj.TEN_LOAI_DTUONG; #endregion #region Thông tin kiểm soát txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI); raddtNgayLap.Value = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd"); txtNguoiLap.Text = obj.NGUOI_NHAP; if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true) { raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd"); } else { raddtNgayCapNhat.Value = null; } txtNguoiCapNhat.Text = obj.NGUOI_CNHAT; #endregion #region Lưu thông tin chung TTHAI_BGHI = obj.TTHAI_BGHI; TTHAI_NVU = obj.TTHAI_NVU; MA_DVI_QLY = obj.MA_DVI_QLY; MA_DVI_TAO = obj.MA_DVI_TAO; NGAY_NHAP = obj.NGAY_NHAP; NGUOI_NHAP = obj.NGUOI_NHAP; #endregion } else { CommonFunction.ThongBaoKetQua(listClientResponseDetail); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { Mouse.OverrideCursor = Cursors.Arrow; } }