예제 #1
0
        /// <summary>
        /// Xóa dữ liệu
        /// </summary>
        private void onDelete(List <int> listId)
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = danhmucProcess.XoaNhom(listId.ToArray(), 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(this.Module,
                                                        this.Function,
                                                        this.Table,
                                                        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;
        }
예제 #2
0
        public void OnDelete()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
            DanhMucProcess processDanhMuc = new DanhMucProcess();

            try
            {
                bool ret = false;
                obj.ID = id;
                DM_TEMP_CUM objTempCum = new DM_TEMP_CUM();
                ret = processDanhMuc.Cum02(action, ref obj, ref objTempCum, ref listClientResponseDetail);
                AfterDelete(ret, listClientResponseDetail);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor     = Cursors.Arrow;
                listClientResponseDetail = null;
                processDanhMuc           = null;
            }
        }
예제 #3
0
        /// <summary>
        /// Sự kiện load dữ liệu lên form
        /// </summary>
        private void SetFormData()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                if (Id != 0)
                {
                    DataSet ds = danhmucProcess.getTanSuatCT(Id);
                }
                else
                {
                    ResetForm();
                }
                if (formCase.Equals("XEM"))
                {
                    CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.XEM, tthaiNvu, null, DatabaseConstant.Function.DC_DM_TINH_THANH);
                }
                if (formCase.Equals("MANAGE"))
                {
                    CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.SUA, tthaiNvu, null, DatabaseConstant.Function.DC_DM_TINH_THANH);
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DanhMuc.ucTanSuatCT.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
예제 #4
0
        private void LoadTreeview()
        {
            try
            {
                DanhMucProcess danhMucProcess = new DanhMucProcess();
                DataTable      dtTreeDonVi    = new DataTable();
                dtTreeDonVi = danhMucProcess.GetTreeDonVi(ClientInformation.TenDangNhap, ClientInformation.MaDonViQuanLy).Tables[0];

                //Cấu trúc của Tag: GiaTri#Level
                item.Items.Clear();
                foreach (DataRow dr in dtTreeDonVi.Rows)
                {
                    if (Convert.ToInt32(dr["LEVEL"]) == 1)
                    {
                        item.Tag        = dr["NODE"].ToString() + "#" + dr["LEVEL"].ToString();
                        item.Header     = dr["NODE_NAME"].ToString();
                        item.IsExpanded = true;
                        break;
                    }
                }

                BuildTree(item, dtTreeDonVi);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
예제 #5
0
 private void btnUpdate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var process = new DanhMucProcess();
         if (treViewUpdate)
         {
             if (obj.ID > 0)
             {
                 obj.MA_DMUC_LOAI  = txtMa.Text;
                 obj.TEN_DMUC_LOAI = txtTen.Text;
                 obj.NGUON_TAO_DL  = lstSourceNguon.ElementAt(cmbNguon.SelectedIndex).KeywordStrings.First();
                 process.SuaDungChungLoai(obj);
                 treViewUpdate = false;
             }
         }
         else
         {
             obj = new DM_DMUC_LOAI();
             obj.MA_DMUC_LOAI  = txtMa.Text;
             obj.TEN_DMUC_LOAI = txtTen.Text;
             obj.NGUON_TAO_DL  = lstSourceNguon.ElementAt(cmbNguon.SelectedIndex).KeywordStrings.First();
             process.ThemDungChungLoai(obj);
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #6
0
        private void LoadTreeview()
        {
            try
            {
                DanhMucProcess DanhMucProcess = new DanhMucProcess();
                DataTable      dt             = null;

                LDatatable.MakeParameterTable(ref dt);
                LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy);
                DataSet ds = DanhMucProcess.getTreeNhom_02(dt);
                if (ds != null)
                {
                    //lstHeader = DanhSachResponse.ListHeader.ToList();

                    dtMaster = ds.Tables[0];

                    DataRow drRoot = dtMaster.Rows[0];

                    RadTreeViewItem rootItem = new RadTreeViewItem();
                    rootItem.Header = drRoot["NODE_NAME"].ToString();
                    rootItem.Tag    = drRoot["NODE"].ToString();
                    rootItem.Uid    = drRoot["NODE_TYPE"].ToString();
                    //rootItem.IsExpanded = true;
                    tvwTree.Items.Add(rootItem);
                    BuildTree(rootItem);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
 private void HienDanhMucNhom()
 {
     try
     {
         DanhMucProcess dmProcess   = new DanhMucProcess();
         List <string>  lstDieuKien = new List <string>();
         lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
         lstPopup = new List <DataRow>();
         PopupProcess popupProcess = new PopupProcess();
         popupProcess.getPopupInformation("POPUP_DM_CUM", lstDieuKien);
         SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
         ucPopup             popup = new ucPopup(true, simplePopupResponse, false);
         popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
         Window win = new Window();
         win.Content = popup;
         win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
         win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         win.ShowDialog();
         if (lstPopup.Count > 0)
         {
             DataRow dr = lstPopup[0];
             txtMaNhom.Text  = dr["MA_NHOM"].ToString();
             txtTenNhom.Text = dr["TEN_NHOM"].ToString();
             LayDanhSachKheUoc(Convert.ToInt32(dr["ID"]));
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #8
0
        /// <summary>
        /// Load dữ liệu lên tree
        /// </summary>
        private void LoadTree()
        {
            DanhMucProcess danhMucProcess = new DanhMucProcess();
            DataTable      dt             = null;

            LDatatable.MakeParameterTable(ref dt);
            LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap);
            LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy);
            DataSet ds = danhMucProcess.getTreeNhom_01(dt);

            if (ds != null)
            {
                //lstHeader = DanhSachResponse.ListHeader.ToList();

                dtMaster = ds.Tables[0];

                DataRow drRoot = dtMaster.Rows[0];

                RadTreeViewItem rootItem = new RadTreeViewItem();
                rootItem.Header = drRoot["NODE_NAME"].ToString();
                rootItem.Tag    = drRoot["NODE"].ToString();
                rootItem.Uid    = drRoot["NODE_TYPE"].ToString();
                //rootItem.IsExpanded = true;
                tvwTree.Items.Add(rootItem);
                BuildTree(rootItem);
            }
        }
예제 #9
0
        private void LoadDuLieu()
        {
            try
            {
                DanhMucProcess danhmucProcess = new DanhMucProcess();
                DataSet        ds             = danhmucProcess.getDanhSachDonVi();
                if (ds != null && ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];

                    grdDangKyDonViDS.DataSource = ds;
                    grdDangKyDonViDS.DataBind();

                    DataRow drRoot = dt.Rows[0];
                    tvwTree.Nodes.Clear();
                    TreeNode rootItem = new TreeNode();

                    rootItem.Text  = drRoot["ten_gdich"].ToString();
                    rootItem.Value = drRoot["ma_dvi"].ToString();
                    tvwTree.Nodes.Add(rootItem);
                    BuildTree(rootItem);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
예제 #10
0
 private void btnUpdate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var process = new DanhMucProcess();
         if (treViewUpdate)
         {
             if (obj.ID > 0)
             {
                 obj.ID_PHAN_HE_CHA = Convert.ToInt32(lstSourcePhanHe.ElementAt(cmbPhanHe.SelectedIndex).KeywordStrings.ElementAt(1));
                 obj.MA_PHAN_HE     = txtMa.Text;
                 obj.TEN_PHAN_HE    = txtTen.Text;
                 obj.TTHAI_BGHI     = lstSourceTrangThai.ElementAt(cmbTrangThai.SelectedIndex).KeywordStrings.First();
                 process.SuaPhanHe(obj);
                 treViewUpdate = false;
             }
         }
         else
         {
             obj.ID_PHAN_HE_CHA = Convert.ToInt32(lstSourcePhanHe.ElementAt(cmbPhanHe.SelectedIndex).KeywordStrings.ElementAt(1));
             obj.ID_PHAN_HE_CHA = Convert.ToInt32(lstPopup[0][1]);
             obj.MA_PHAN_HE     = txtMa.Text;
             obj.TEN_PHAN_HE    = txtTen.Text;
             obj.TTHAI_BGHI     = lstSourceTrangThai.ElementAt(cmbTrangThai.SelectedIndex).KeywordStrings.First();
             process.SuaPhanHe(obj);
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #11
0
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            AutoCompleteEntry ace = (AutoCompleteEntry)cmbPhongGD.SelectedItem;

            if (ace != null)
            {
                string id             = ace.KeywordStrings[2];
                string ma             = ace.KeywordStrings[0];
                string ten            = ace.DisplayName;
                string hachtoan       = ace.KeywordStrings[1];
                string maDonViCha     = ace.KeywordStrings[3];
                string maTinhThanhPho = ace.KeywordStrings[4];
                string soLuongBGhi    = "";

                ClientInformation.TenDonViGiaoDich    = ten;
                ClientInformation.MaDonViGiaoDich     = ma;
                ClientInformation.IdDonViGiaoDich     = Int32.Parse(id);
                ClientInformation.PhuongPhapHachToan  = hachtoan;
                ClientInformation.TinhTPDonViGiaoDich = maTinhThanhPho;

                // Nếu đơn vị vận hành khác đơn vị quản lý
                // 1. Lấy thông tin chi nhánh của phòng giao dịch được chọn
                // 2. Lấy thông tin ngày làm việc phòng giao dịch được chọn
                if (maDonViCha != null && !maDonViCha.Equals(ClientInformation.MaDonVi))
                {
                    DanhMucProcess process = new DanhMucProcess();
                    ApplicationConstant.ResponseStatus ret = new ApplicationConstant.ResponseStatus();
                    Presentation.Process.DanhMucServiceRef.DM_DON_VI     dmDonVi     = new Presentation.Process.DanhMucServiceRef.DM_DON_VI();
                    Presentation.Process.DanhMucServiceRef.HT_NGAY_LVIEC ngayLamViec = new Presentation.Process.DanhMucServiceRef.HT_NGAY_LVIEC();
                    string responseMessage = "";

                    ret = process.GetDonViChaByMaDonVi(ma, ref dmDonVi, ref ngayLamViec, ref responseMessage);
                    if (ret == ApplicationConstant.ResponseStatus.THANH_CONG)
                    {
                        ClientInformation.IdDonVi  = dmDonVi.ID;
                        ClientInformation.MaDonVi  = dmDonVi.MA_DVI;
                        ClientInformation.TenDonVi = dmDonVi.TEN_GDICH;

                        ClientInformation.NgayLamViecTruoc   = ngayLamViec.NGAY_TRUOC;
                        ClientInformation.NgayLamViecHienTai = ngayLamViec.NGAY_LVIEC;
                        ClientInformation.NgayLamViecSau     = ngayLamViec.NGAY_TTHEO;
                    }
                    process = null;
                }
                soLuongBGhi = new UtilitiesProcess().LayGiaTriThamSo(BusinessConstant.LoaiThamSo.TW, BusinessConstant.MaThamSo.TW_SOLUONG_BANGHI, ClientInformation.MaDonVi);
                if (soLuongBGhi.IsNullOrEmptyOrSpace())
                {
                    soLuongBGhi = "10";
                }
                ClientInformation.SoLuongBanGhi = soLuongBGhi.StringToInt32();
            }

            MainWindow mainWindow = new MainWindow();

            mainWindow.Show();
            this.Cursor = Cursors.Arrow;
            Close();
        }
예제 #12
0
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Luu(string trangThai)
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                DM_DMUC_GTRI obj = new DM_DMUC_GTRI();
                if (ID > 0)
                {
                    obj.ID = ID;
                }
                obj.ID_DMUC_LOAI = Convert.ToInt32(lstSourceLoai.ElementAt(cmbLoaiDanhMuc.SelectedIndex).KeywordStrings.ElementAt(1));
                obj.MA_DMUC      = txtMa.Text;
                obj.MA_DMUC_LOAI = lstSourceLoai.ElementAt(cmbLoaiDanhMuc.SelectedIndex).KeywordStrings.First();
                obj.MA_DVI_QLY   = ClientInformation.MaDonVi;
                obj.MA_DVI_TAO   = ClientInformation.MaDonVi;
                obj.NGAY_CNHAT   = string.IsNullOrEmpty(raddtNgayCNhat.Value.ToString().Trim()) ? ((DateTime)raddtNgayCNhat.Value).ToString("yyyyMMdd") : (DateTime.Today).ToString("yyyyMMdd");
                obj.NGAY_NHAP    = string.IsNullOrEmpty(raddtNgayNhap.Value.ToString().Trim()) ? ((DateTime)raddtNgayNhap.Value).ToString("yyyyMMdd") : (DateTime.Today).ToString("yyyyMMdd");
                obj.NGUOI_CNHAT  = ClientInformation.TenDangNhap;
                if (ID == 0)
                {
                    obj.NGUOI_NHAP = ClientInformation.TenDangNhap;
                }
                obj.TEN_DMUC   = txtTen.Text;
                obj.TTHAI_BGHI = lstSourceTrangThai.ElementAt(cmbTrangThaiSDung.SelectedIndex).KeywordStrings.First();
                obj.TTHAI_NVU  = trangThai;
                if (ID == 0)
                {
                    danhmucProcess.ThemDungChung(obj);
                }
                else
                {
                    danhmucProcess.SuaDungChung(obj);
                }
                HoanThanh();
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                if (ex.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                }
                else if (ex.InnerException.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                }
                else
                {
                    new frmThongBaoLoi("M.DanhMuc.ucDonViDS.LoiXoaDuLieu", ex).ShowDialog();
                }
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
예제 #13
0
        /// <summary>
        /// Lưu dữ liệu (hay trình duyệt)
        /// </summary>
        private void onSave()
        {
            string trangThai = CommonFunction.LayTrangThaiBanGhi(DatabaseConstant.Action.LUU, BusinessConstant.layTrangThaiNghiepVu(tthaiNvu));

            if (Validation())
            {
                DanhMucProcess danhMucProcess = new DanhMucProcess();
                try
                {
                    // Dữ liệu truyền vào và dữ liệu trả về
                    DC_TSUAT obj = new DC_TSUAT();
                    DC_TSUAT ret = null;

                    // Nếu là lưu tạm hoặc thêm mới lần đầu
                    if (Id == 0)
                    {
                        // Lấy dữ liệu từ form
                        GetFormData(ref obj);
                        obj.TTHAI_NVU = trangThai;

                        // Set các thông tin khác
                        obj.TTHAI_BGHI = BusinessConstant.TrangThaiSuDung.SU_DUNG.layGiaTri();
                        obj.NGUOI_NHAP = ClientInformation.TenDangNhap;
                        obj.NGAY_NHAP  = LDateTime.GetCurrentDate(ApplicationConstant.defaultDateTimeFormat);
                        ret            = danhMucProcess.ThemTanSuat(obj);

                        afterAddNew(ret);
                    }
                    // Nếu là lưu tạm khi sửa
                    // Hoặc lưu tạm khi sửa sau duyệt
                    // Hoặc sửa
                    else
                    {
                        // Lấy thông tin cũ
                        obj = danhMucProcess.getTanSuatById(Id);

                        // Lấy dữ liệu từ form
                        GetFormData(ref obj);
                        obj.TTHAI_NVU = trangThai;

                        ret = danhMucProcess.SuaTanSuat(obj);
                        afterModify(ret);
                    }
                }
                catch (System.Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    CommonFunction.ThongBaoLoi(ex);
                    LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                }
                finally
                {
                    danhMucProcess = null;
                }
            }
        }
예제 #14
0
        private void LoadGrid()
        {
            Cursor = Cursors.Wait;
            try
            {
                #region Điều kiện tìm kiếm
                RadTreeViewItem item      = tvwKhuVuc.SelectedItem as RadTreeViewItem;
                string          loaiDonVi = item.Uid.ToString();
                string          maDonVi   = item.Tag.ToString();
                #endregion

                DanhMucProcess danhMucProcess = new DanhMucProcess();

                DataTable dt = null;

                LDatatable.MakeParameterTable(ref dt);
                LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy);
                LDatatable.AddParameter(ref dt, "@MA", "String", maDonVi);
                LDatatable.AddParameter(ref dt, "@LOAI", "String", loaiDonVi);
                DataSet ds = danhMucProcess.getDanhSachKhuVuc01(dt);
                if (ds != null && ds.Tables.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        ds.Tables[0].Rows[i]["TTHAI_NVU"] = BusinessConstant.layNgonNguNghiepVu(ds.Tables[0].Rows[i]["TTHAI_NVU"].ToString());
                    }

                    grKhuVucDS.DataContext = ds.Tables[0].DefaultView;

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        lblTongSo.Content = ds.Tables[0].Rows.Count;
                    }
                    else
                    {
                        lblTongSo.Content = "0";
                    }
                }
                else
                {
                    grKhuVucDS.Items.Clear();
                    lblTongSo.Content = 0;
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
예제 #15
0
        private void SetFormData()
        {
            DanhMucProcess processDanhMuc = new DanhMucProcess();

            List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();

            obj = new DM_KHU_VUC();
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                bool ret = false;
                obj.ID = id;
                ret    = processDanhMuc.KhuVuc02(DatabaseConstant.Action.LOAD, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    sTrangThaiNVu        = obj.TTHAI_NVU;
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(sTrangThaiNVu);

                    #region Thông tin chung
                    cmbChiNhanh.SelectedIndex      = lstSourceChiNhanh.IndexOf(lstSourceChiNhanh.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_DVI_QLY)));
                    cmbPhongGiaoDich.SelectedIndex = lstSourcePhongGiaoDich.IndexOf(lstSourcePhongGiaoDich.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_DVI)));
                    txtMaKhuVuc.Text      = obj.MA_KVUC;
                    txtTenKhuVuc.Text     = obj.TEN_KVUC;
                    txtTenTat.Text        = obj.TEN_TAT;
                    cmbCBQL.SelectedIndex = lstSourceCBQL.IndexOf(lstSourceCBQL.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_CBO_QLY)));
                    #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");
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion
                }
                else
                {
                    LMessage.ShowMessage("M_ResponseMessage_HanhDong_LayDuLieuKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                LMessage.ShowMessage("M_ResponseMessage_HanhDong_LayDuLieuKhongThanhCong", LMessage.MessageBoxType.Warning);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
예제 #16
0
 private void OnDelete(List <int> lstid)
 {
     try
     {
         List <ClientResponseDetail> lstResponseDetail = new List <ClientResponseDetail>();
         bool bKetQua = new DanhMucProcess().XoaKhuVuc(lstid.ToArray(), ref lstResponseDetail);
         AfterDelete(lstResponseDetail);
     }
     catch (System.Exception ex)
     {
     }
 }
예제 #17
0
 private void OnDelete(List <int> lstid)
 {
     try
     {
         List <ClientResponseDetail> lstResponseDetail = new List <ClientResponseDetail>();
         bool bKetQua = new DanhMucProcess().XoaKhuVuc(lstid.ToArray(), ref lstResponseDetail);
         AfterDelete(bKetQua, lstResponseDetail);
     }
     catch (System.Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #18
0
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            {
                if (LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
                {
                    DanhMucProcess danhmucProcess = new DanhMucProcess();
                    Mouse.OverrideCursor = Cursors.Wait;
                    try
                    {
                        List <int> lstID = new List <int>();
                        List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                        foreach (DataRow row in grDanhSach.SelectedItems)
                        {
                            if ((int)row[2] > 0)
                            {
                                lstID.Add((int)row[2]);
                            }
                        }

                        if (danhmucProcess.XoaPhanHeGD(lstID.ToArray(), ref listResponseDetail))
                        {
                            LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaThanhCong", LMessage.MessageBoxType.Information);
                        }
                        else
                        {
                            LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                        }
                        LoadDuLieu();
                    }
                    catch (System.Exception ex)
                    {
                        this.Cursor = Cursors.Arrow;
                        if (ex.GetType() == typeof(CustomException))
                        {
                            new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                        }
                        else if (ex.InnerException.GetType() == typeof(CustomException))
                        {
                            new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                        }
                        else
                        {
                            new frmThongBaoLoi("M.DanhMuc.ucDonViDS.LoiXoaDuLieu", ex).ShowDialog();
                        }
                        LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                    }
                    Mouse.OverrideCursor = Cursors.Arrow;
                }
            }
        }
예제 #19
0
 private void OnCancel(List <int> lstID)
 {
     try
     {
         List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
         bool bKetQua = new DanhMucProcess().ThoaiDuyetKhuVuc(lstID.ToArray(), ref listClientResponseDetail);
         BeforCancel(bKetQua, listClientResponseDetail);
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #20
0
        /// <summary>
        /// Luu du lieu
        /// </summary>
        /// <param name="banghi"></param>
        /// <param name="nghiepvu"></param>
        void Luu(BusinessConstant.TrangThaiBanGhi banghi, BusinessConstant.TrangThaiNghiepVu nghiepvu)
        {
            if (Vadidate())
            {
                DanhMucProcess danhmucProcess = new DanhMucProcess();
                try
                {
                    Presentation.Process.DanhMucServiceRef.DM_TINH_TP objTTP = new Presentation.Process.DanhMucServiceRef.DM_TINH_TP();
                    LayDuLieu(ref objTTP, banghi, nghiepvu);
                    int iResutl = 0;

                    //if (LstChiTiet == null)
                    //    iResutl = danhmucProcess.ThemTinhTP(objTTP);
                    //else
                    //{
                    //    objTTP.ID = int.Parse(LstChiTiet[1].ToString());
                    //    iResutl = danhmucProcess.updateTinhTP(objTTP);
                    //}

                    if (iResutl > 0)
                    {
                        LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LuuDuLieuThanhCong", LMessage.MessageBoxType.Information);
                        if (OnSavingComleted != null)
                        {
                            OnSavingComleted(null, EventArgs.Empty);
                        }
                        if (cbMultiAdd.IsChecked == true)
                        {
                            ClearForm();
                        }
                        else
                        {
                            PresentationWPF.CustomControl.CommonFunction.CloseUserControl(this);
                        }
                    }
                    else
                    {
                        LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LoiLuuDuLieu", LMessage.MessageBoxType.Error);
                    }
                }
                catch (Exception ex)
                {
                    LMessage.ShowMessage("M.DanhMuc.ucQuocGiaCT.LoiLuuDuLieu", LMessage.MessageBoxType.Error);
                    LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                }
            }
        }
예제 #21
0
        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();
            }
        }
예제 #22
0
        private void LoadDuLieu()
        {
            try
            {
                DanhMucProcess danhmucProcess = new DanhMucProcess();
                DataSet        ds             = danhmucProcess.getDanhSachDonVi();
                if (ds != null && ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];

                    //grdNhomNSD.DataSource = ds;
                    //grdNhomNSD.DataBind();
                    BuildGridDoiTuong();

                    DataRow drRoot = dt.Rows[0];
                    tvwTree.Nodes.Clear();
                    TreeNode rootItem = new TreeNode();
                    TreeNode subItem  = new TreeNode();

                    rootItem.Text  = "User and user group";
                    rootItem.Value = "";
                    tvwTree.Nodes.Add(rootItem);

                    List <string> lstDieuKien = new List <string>();
                    string        maTruyVan   = DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue();
                    lstDieuKien = new List <string>();
                    lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_DTUONG_KTHAC_TNGUYEN));

                    DropDownList cmb = new DropDownList();
                    KhoiTaoGiaTriComboBox(ref lstNhomNo, ref cmb, maTruyVan, lstDieuKien);
                    foreach (AutoCompleteEntry item in lstNhomNo)
                    {
                        TreeNode chidNode = new TreeNode();
                        chidNode.Text  = item.DisplayName;
                        chidNode.Value = item.KeywordStrings.First();
                        rootItem.ChildNodes.Add(chidNode);
                    }
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
예제 #23
0
 private void tvwTree_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         var          process = new DanhMucProcess();
         DM_DMUC_LOAI loai    = new DM_DMUC_LOAI();
         loai.MA_DMUC_LOAI = ((RadTreeViewItem)tvwTree.SelectedItem).Tag.ToString();
         obj         = process.layDungChungLoai(loai);
         txtMa.Text  = obj.MA_DMUC_LOAI;
         txtTen.Text = obj.TEN_DMUC_LOAI;
         setMaNguonDL(obj.NGUON_TAO_DL);
         treViewUpdate = true;
         txtMa.Focus();
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #24
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (obj.ID > 0)
                {
                    var   process = new DanhMucProcess();
                    int[] id      = new int[1];
                    List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                    id[0] = obj.ID;
                    process.XoaDungChungLoai(id.ToArray(), ref listResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
예제 #25
0
        private void ThoaiDuyet()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                List <int> lstID = new List <int>();
                List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                lstID.Add((int)LstChiTiet[0][1]);

                if (danhmucProcess.ThoaiDuyetDungChung(lstID.ToArray(), ref listResponseDetail))
                {
                    CustomControl.CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.THOAI_DUYET, LstChiTiet[0][1].ToString());
                    LMessage.ShowMessage("M.DungChung.ThoaiDuyetThanhCong", LMessage.MessageBoxType.Information);
                    HoanThanh();
                }
                else
                {
                    LMessage.ShowMessage("M.DungChung.ThoaiDuyetKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                if (ex.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                }
                else if (ex.InnerException.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                }
                else
                {
                    new frmThongBaoLoi("M.DungChung.LoiThoaiDuyet", ex).ShowDialog();
                }
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
예제 #26
0
 private void tvwTree_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         var        process = new DanhMucProcess();
         DM_PHAN_HE phanhe  = new DM_PHAN_HE();
         phanhe.MA_PHAN_HE = ((RadTreeViewItem)tvwTree.SelectedItem).Tag.ToString();
         obj = process.layPhanHe(phanhe);
         cmbPhanHe.SelectedIndex = lstSourcePhanHe.IndexOf(lstSourcePhanHe.FirstOrDefault(i => i.KeywordStrings.ElementAt(1).Equals(obj.ID)));
         txtMa.Text  = obj.MA_PHAN_HE;
         txtTen.Text = obj.TEN_PHAN_HE;
         setTrangThai(obj.TTHAI_BGHI);
         treViewUpdate = true;
         txtMa.Focus();
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
예제 #27
0
        /// <summary>
        /// Xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            int[] arrayID = new int[0];
            List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                Array.Resize(ref arrayID, arrayID.Length + 1);
                arrayID[arrayID.Length - 1] = idPhanHeGD;

                if (danhmucProcess.XoaPhanHeGD(arrayID.ToArray(), ref listResponseDetail))
                {
                    LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaThanhCong", LMessage.MessageBoxType.Information);
                }
                else
                {
                    LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                if (ex.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                }
                else if (ex.InnerException.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                }
                else
                {
                    new frmThongBaoLoi("M.DanhMuc.ucDonViDS.LoiXoaDuLieu", ex).ShowDialog();
                }
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
예제 #28
0
 public void OnDelete()
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         bool ret = false;
         List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
         DanhMucProcess processDanhMuc = new DanhMucProcess();
         ret = processDanhMuc.XoaDoiTuong(new int[] { obj.ID }, ref listClientResponseDetail);
         AfterDelete(ret, listClientResponseDetail);
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
         throw ex;
     }
     finally
     {
         Mouse.OverrideCursor = Cursors.Arrow;
     }
 }
예제 #29
0
        private DM_KHU_VUC GetDataForm(BusinessConstant.TrangThaiNghiepVu nghiepvu, BusinessConstant.TrangThaiSuDung sudung)
        {
            DM_KHU_VUC obj   = new DM_KHU_VUC();
            DataSet    dsDVi = new DanhMucProcess().getDonViTheoMa(lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings[0]);

            obj.ID          = idKhuVuc;
            obj.ID_DVI      = Convert.ToInt32(dsDVi.Tables[0].Rows[0]["ID"]);
            obj.MA_DVI      = lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.FirstOrDefault();
            obj.MA_DVI_QLY  = ClientInformation.MaDonVi;
            obj.MA_DVI_TAO  = lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.FirstOrDefault();
            obj.MA_KVUC     = txtMaKhuVuc.Text;
            obj.TEN_KVUC    = txtTenKhuVuc.Text;
            obj.TEN_TAT     = txtTenTat.Text;
            obj.TTHAI_NVU   = nghiepvu.layGiaTri();
            obj.TTHAI_BGHI  = sudung.layGiaTri();
            obj.NGAY_CNHAT  = idKhuVuc > 0 ? ClientInformation.NgayLamViecHienTai : "";
            obj.NGUOI_CNHAT = idKhuVuc > 0 ? ClientInformation.TenDangNhap : "";
            obj.NGAY_NHAP   = idKhuVuc == 0 ? ClientInformation.NgayLamViecHienTai : LDateTime.DateToString(txtNgayLap.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat);
            obj.NGUOI_NHAP  = idKhuVuc == 0 ? ClientInformation.TenDangNhap : txtNguoiLap.Text;
            return(obj);
        }
예제 #30
0
 private void OnSave(DM_KHU_VUC obj)
 {
     try
     {
         List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
         if (idKhuVuc == 0)
         {
             obj = new DanhMucProcess().ThemKhuVuc(obj, ref listClientResponseDetail);
         }
         else
         {
             obj = new DanhMucProcess().SuaKhuVuc(obj, ref listClientResponseDetail);
         }
         BeforSave(obj, listClientResponseDetail);
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }