示例#1
0
 private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e)
 {
     //POPUP_TKHOAN_CTIET_CONG_NO
     Cursor = Cursors.Wait;
     try
     {
         AutoCompleteEntry auPGD       = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex);
         List <string>     lstDieuKien = new List <string>();
         lstDieuKien.Add(auPGD.KeywordStrings.FirstOrDefault());
         lstPopup = new List <DataRow>();
         PopupProcess popupProcess = new PopupProcess();
         popupProcess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET_CONG_NO.getValue(), lstDieuKien);
         SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
         ucPopup             popup = new ucPopup(false, simplePopupResponse);
         popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
         Window win = new Window();
         win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
         win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         win.Content = popup;
         win.ShowDialog();
         if (lstPopup.Count > 0)
         {
             txtSoTaiKhoan.Text = lstPopup.FirstOrDefault()["SO_TAI_KHOAN"].ToString();
         }
         GetDoiTuongTaiKhoan();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     Cursor = Cursors.Arrow;
 }
示例#2
0
        private void ChonKhachHang()
        {
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(ClientInformation.MaDonVi);
            lstDieuKien.Add("NULL");
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACH_HANG.getValue(), 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.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopup.Count > 0)
            {
                DataRow row = (DataRow)lstPopup.First();
                txtMaKH.Text     = row["MA_KHANG"].ToString();
                lblTenKH.Content = row["TEN_KHANG"].ToString();
            }
        }
        void  btnCum_Click(object sender, RoutedEventArgs e)
        {
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_CUM", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(false, simplePopupResponse, true);

            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)
            {
                idCum           = Convert.ToInt32(lstPopup[0]["ID"]);
                maCum           = lstPopup[0]["MA_CUM"].ToString();
                lstDanhSachKUOC = new List <DANH_SACH_KHE_UOC_LAP_LICH>();
                raddgrLapKeHoach.ItemsSource = null;
                raddgrLapKeHoach.ItemsSource = lstDanhSachKUOC;
                txtCum.Text = maCum;
                LoadComboBoxBDauTraVon();
            }
        }
        private void HienThiPopup(DatabaseConstant.DanhSachTruyVan tenPopUp, List <string> lstDieuKien)
        {
            Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess();
            try
            {
                //Bat popup
                var process = new PopupProcess();

                process.getPopupInformation(tenPopUp.getValue(), lstDieuKien);
                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Content = popup;
                win.Title   = simplePopupResponse.PopupTitle;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    DataRow     dr        = lstPopup[0];
                    DataRowView drCurrent = (DataRowView)raddgrHachToan.SelectedItem;
                    //if (LString.IsNullOrEmptyOrSpace(drCurrent["SO_TAI_KHOAN"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_PLOAI"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_DTUONG"].ToString()))
                    //{
                    //    // Them dong moi
                    //    DataRow drNew = _dtSource.NewRow();
                    //    drNew["STT"] = _dtSource.Rows.Count + 1;
                    //    if (formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_THU.layGiaTri()) || formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_CHI.layGiaTri()))
                    //        drNew["NHOM_DKHOAN"] = "1";
                    //    _dtSource.Rows.Add(drNew);
                    //}

                    switch (tenPopUp)
                    {
                    case DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET:
                        drCurrent["ID_PLOAI"]      = dr["ID_PLOAI"];
                        drCurrent["MA_PLOAI"]      = dr["MA_PLOAI"];
                        drCurrent["SO_TAI_KHOAN"]  = dr[2];
                        drCurrent["TEN_TAI_KHOAN"] = dr[3];
                        break;

                    case DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG:
                        drCurrent["MA_DTUONG"] = dr[2];
                        break;
                    }
                    raddgrHachToan.CommitEdit();
                    lstPopup.Clear();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                ketoanProcess = null;
            }
        }
示例#5
0
        private void btnMaPhanLoai_Click(object sender, RoutedEventArgs e)
        {
            Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess();
            try
            {
                //Bat popup
                var process = new PopupProcess();
                process.getPopupInformation("POPUP_KT_PLOAI");

                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title   = "Danh sách mã phân loại tài khoản";
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    DataRow dr = lstPopup[0];
                    txtMaPhanLoai.Tag      = dr[0].ToString();
                    txtMaPhanLoai.Text     = dr[2].ToString();
                    lblTenPhanLoai.Content = dr[3].ToString();
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                ketoanProcess = null;
            }
        }
        private void ChonKhachHang()
        {
            List <string>    lstDieuKien = new List <string>();
            KhachHangProcess khProcess   = new KhachHangProcess();

            MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First();
            //lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
            lstDieuKien.Add(MaChiNhanh);
            lstDieuKien.Add("NULL");
            lstDieuKien.Add("NULL");
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopup.Count > 0)
            {
                DataRow row = (DataRow)lstPopup.First();
                txtMaKH.Text     = row["MA_KHANG"].ToString();
                lblTenKH.Content = row["TEN_KHANG"].ToString();
                IdKhachHang      = row["ID"].ToString();
            }
        }
        void btnMaKH_Click(object sender, RoutedEventArgs e)
        {
            lstPopup.Clear();
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
            lstDieuKien.Add("NULL");
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_KHACHHANG", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(true, simplePopupResponse);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
            win.Content = popup;
            win.ShowDialog();
            if (lstPopup.Count > 0)
            {
                txtMaKH.Text         = lstPopup[0][2].ToString();
                idKHang              = Convert.ToInt32(lstPopup[0][1]);
                lblTTinKHang.Content = lstPopup[0][3].ToString();
            }
        }
 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);
     }
 }
        private void ShowPopupLoaiThamSo()
        {
            try
            {
                lstPopup = new List <DataRow>();
                var process = new PopupProcess();
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_HT_TSO_LOAI.getValue());

                SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
                win.Content = popup;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.ShowDialog();
                if (lstPopup != null)
                {
                    idLoai = Convert.ToInt32(lstPopup[0][1].ToString());
                    //txtMaLoaiThamSo.Text = lstPopup[0][2].ToString();
                    //lblLoaiThamSo.Content = lstPopup[0][3].ToString();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
        private void HienDanhMucKhachHang()
        {
            try
            {
                List <string>    lstDieuKien = new List <string>();
                KhachHangProcess khProcess   = new KhachHangProcess();
                machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First();
                //lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
                lstDieuKien.Add(machinhanh);
                lstDieuKien.Add("NULL");
                lstDieuKien.Add("NULL");
                lstPopup = new List <DataRow>();
                PopupProcess popupProcess = new PopupProcess();
                popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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)
                {
                    DataTable dt = new DataTable();
                    dt = lstPopup.CopyToDataTable();
                    if (!LObject.IsNullOrEmpty(dt) && dt.Rows.Count > 0)
                    {
                        if (dt.Columns.Contains("STT"))
                        {
                            dt.Columns.Remove("STT");
                        }

                        if (LObject.IsNullOrEmpty(dtKhachHang))
                        {
                            dtKhachHang = new DataTable();
                        }
                        else
                        {
                            dt.Merge(dtKhachHang);
                        }

                        var result = dt.AsEnumerable().Select(x => x).Distinct(System.Data.DataRowComparer.Default).ToList();
                        dtKhachHang = result.CopyToDataTable();

                        grKhachHang.ItemsSource = null;
                        grKhachHang.ItemsSource = dtKhachHang;
                    }
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
示例#11
0
        private void btnThem_Click(object sender, RoutedEventArgs e)
        {
            //Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                lstPopup = new List <DataRow>();
                var           process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                //lstDieuKien.Add("'" + txtMaDonVi.Text + "'");
                lstDieuKien.Add("'" + lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.First() + "'");
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_HT_NSD.getValue(), lstDieuKien);

                SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse, true);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
                win.Content = popup;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.ShowDialog();
                if (lstPopup != null)
                {
                    List <string> lstID = (from row in dt.AsEnumerable()
                                           select row.Field <string>("ID")).Distinct().ToList();
                    if (dt.Rows.Count == 0)
                    {
                        dt = new DataTable();
                        dt.Columns.Add(LLanguage.SearchResourceByKey("U.DungChung.STT"), typeof(string));
                        dt.Columns.Add("ID", typeof(string));
                        dt.Columns.Add(LLanguage.SearchResourceByKey("U.QuanTriHeThong.NhomNSD.ucNSDCT01.Ma"), typeof(string));
                        dt.Columns.Add(LLanguage.SearchResourceByKey("U.QuanTriHeThong.NhomNSD.ucNSDCT01.Ten"), typeof(string));
                    }
                    foreach (DataRow row in lstPopup)
                    {
                        if (lstID.Contains(row[1]) != true)
                        {
                            DataRow r = dt.NewRow();
                            r[0] = dt.Rows.Count + 1;
                            r[1] = row[1];
                            r[2] = row[2];
                            r[3] = row[3];
                            dt.Rows.Add(r);
                        }
                    }
                    grDanhSach.ItemsSource = null;
                    grDanhSach.ItemsSource = dt;
                    loadWidthColumnDoiTuong();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            //Mouse.OverrideCursor = Cursors.Arrow;
        }
        void tlbDetailAdd_Click(object sender, RoutedEventArgs e)
        {
            if (txtMaKH.Text.IsNullOrEmptyOrSpace())
            {
                CommonFunction.ThongBaoTrong(lblTDKhachHang.Content.ToString());
                return;
            }

            lstPopup.Clear();
            List <string> lstDieuKien = new List <string>();

            if (LObject.IsNullOrEmpty(lstTSDB))
            {
                lstTSDB = new List <DataRow>();
            }
            string lstIDTSDB = "";

            foreach (DataRow dr in lstTSDB)
            {
                lstIDTSDB += "," + dr["ID"].ToString();
            }
            if (lstIDTSDB.Length > 0)
            {
                lstIDTSDB = "(" + lstIDTSDB.Substring(1) + ")";
            }
            else
            {
                lstIDTSDB = "(0)";
            }
            lstDieuKien.Add(ClientInformation.MaDonViQuanLy);
            lstDieuKien.Add(txtMaKH.Text);
            lstDieuKien.Add(lstIDTSDB);
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_TSDB_HDTC_TDTD", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(false, simplePopupResponse, false);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
            win.Content = popup;
            win.ShowDialog();
            if (lstPopup.Count > 0)
            {
                foreach (DataRow dr in lstPopup)
                {
                    lstTSDB.Add(dr);
                }
                raddgrDSachTSDB.ItemsSource = null;
                raddgrDSachTSDB.ItemsSource = lstTSDB;
                SetGtriTong(lstTSDB);
            }
        }
 private void tlbDetailAdd_Click(object sender, RoutedEventArgs e)
 {
     Cursor = Cursors.Wait;
     try
     {
         string sidKheUoc = "";
         if (lstPopup.IsNullOrEmpty())
         {
             foreach (DataRow dr in lstPopup)
             {
                 sidKheUoc += "," + dr["ID"].ToString();
             }
         }
         if (sidKheUoc.Length > 0)
         {
             sidKheUoc = sidKheUoc.Substring(1);
         }
         else
         {
             sidKheUoc = "0";
         }
         AutoCompleteEntry auCum       = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex);
         AutoCompleteEntry auPGD       = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex);
         List <string>     lstDieuKien = new List <string>();
         lstDieuKien.Add(sidKheUoc);
         lstDieuKien.Add(auPGD.KeywordStrings.FirstOrDefault());
         lstDieuKien.Add(auCum.KeywordStrings.FirstOrDefault());
         lstPopup = new List <DataRow>();
         PopupProcess popupProcess = new PopupProcess();
         popupProcess.getPopupInformation("POPUP_DS_KHEUOC_BH", lstDieuKien);
         SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
         ucPopup             popup = new ucPopup(true, simplePopupResponse, true);
         popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
         Window win = new Window();
         win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
         win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         win.Content = popup;
         win.ShowDialog();
         if (lstPopup.Count > 0)
         {
             foreach (DataRow drv in lstPopup)
             {
                 dtKheUoc.Rows.Add(drv);
             }
         }
         raddgrTUngCT.ItemsSource = null;
         raddgrTUngCT.ItemsSource = dtKheUoc;
     }
     catch (Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
     Cursor = Cursors.Arrow;
 }
示例#14
0
        private void tlbDetailAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (cmbLoaiDoiTuong.SelectedIndex == -1)
                {
                    return;
                }
                DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = null;
                AutoCompleteEntry       au          = lstSourceDoiTuongLoai.ElementAt(cmbLoaiDoiTuong.SelectedIndex);
                //Bat popup
                PopupProcess  process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonVi);
                lstDieuKien.Add(au.KeywordStrings.FirstOrDefault());

                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG.getValue(), lstDieuKien);
                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, true);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title = LLanguage.SearchResourceByKey("U.KeToan.DoiTuong.ucDoiTuongSoDuCT.DanhSachDoiTuong");
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    foreach (DataRow dr in lstPopup)
                    {
                        if (!lstDTuongCT.Select(f => f.MA_DTUONG).Contains(dr[2].ToString()))
                        {
                            objDTuongCT               = new DOI_TUONG_SDU_TKHOAN_CT();
                            objDTuongCT.MA_DTUONG     = dr[2].ToString();
                            objDTuongCT.TEN_TAI_KHOAN = dr[3].ToString();
                            objDTuongCT.MA_LSDU       = MA_LSDU;
                            objDTuongCT.NGAY_DL       = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.NGAY_GDICH    = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.NGAY_HLUC     = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.SODU          = 0;
                            objDTuongCT.ID_DTUONG     = Convert.ToInt32(dr[1].ToString());
                            lstDTuongCT.Add(objDTuongCT);
                        }
                    }
                    raddgrTUngCT.ItemsSource = lstDTuongCT;
                    raddgrTUngCT.Rebind();
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
示例#15
0
        /// <summary>
        /// Hiện popup khách hàng
        /// </summary>
        private void HienPopUpKhachHang()
        {
            PopupProcess  Popupprocess = new PopupProcess();
            List <string> lstDK        = new List <string>();
            string        maDV         = "";

            if (cmbChiNhanh.SelectedIndex >= 0)
            {
                maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            string maPGD = "";

            if (cmbChiNhanh.SelectedIndex >= 0)
            {
                maPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            string maCum = "";

            if (cmbCum.SelectedIndex >= 0)
            {
                maCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            lstDK.Add(maDV);
            lstDK.Add(maPGD);
            lstDK.Add(maCum);
            Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_BAOCAO.getValue(), lstDK);
            SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(true, simplePopupResponse, false);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.Title   = "Danh sách nhóm khách hàng";
            win.Content = popup;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopup != null && lstPopup.Count > 0)
            {
                txtMaKhachHang.Text  = lstPopup[0][2].ToString();
                txtTenKhachHang.Text = lstPopup[0][3].ToString();
            }
            cmbKheUoc.Items.Clear();
            if (!txtMaKhachHang.Text.IsNullOrEmptyOrSpace())
            {
                lstSourceKheUoc = new List <AutoCompleteEntry>();
                AutoComboBox auto = new AutoComboBox();
                // Khởi tạo điều kiện gọi danh mục
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(txtMaKhachHang.Text);
                // khởi tạo combobox
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourceKheUoc, ref cmbKheUoc, DatabaseConstant.DanhSachTruyVan.COMBOBOX_KUOC_KHANG.getValue(), lstDieuKien);
            }
        }
示例#16
0
        private void rbtnDonVi_Click(object sender, RoutedEventArgs e)
        {
            var process = new PopupProcess();
            process.getPopupInformation("POPUP_DS_");

            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

            ucPopup popup = new ucPopup(true, simplePopupResponse, true);
            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();
            win.Content = popup;
            win.ShowDialog();
        }
示例#17
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                lstPopup = null;
                var           process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_HOSO_NVIEN.getValue(), 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)
                {
                    foreach (DataRow dr in lstPopup)
                    {
                        if (KiemTraTonTaiGrid(dr["ID"].ToString()))
                        {
                            DataRow drHSo = dt.NewRow();

                            drHSo["ID_HSO"]        = Convert.ToInt32(dr["ID"]);
                            drHSo["MA_HSO"]        = dr["MA_HSO"].ToString();
                            drHSo["TEN_HSO"]       = dr["TEN_HSO"].ToString();
                            drHSo["CHUC_VU"]       = 0;
                            drHSo["NGAY_THAM_GIA"] = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd").ToString("dd/MM/yyyy");
                            drHSo["NQL"]           = 0;

                            dt.Rows.Add(drHSo);
                        }
                    }
                }

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["STT"] = i + 1;
                }

                grid.DataContext = dt.DefaultView;
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                CommonFunction.ThongBaoLoi(ex);
            }
        }
示例#18
0
        private void btnAddTSDB_Click(object sender, RoutedEventArgs e)
        {
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(idKheUoc.ToString());
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_TAISAN_XULY", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(true, simplePopupResponse, true);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.Content = popup;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopup.Count > 0)
            {
                foreach (DataRow dr in lstPopup)
                {
                    XuLyNoQuaHan.TSDBXuLy objTSDB = new XuLyNoQuaHan.TSDBXuLy();
                    for (int i = 0; i < dr.Table.Columns.Count; i++)
                    {
                        string       sName    = dr.Table.Columns[i].ColumnName;
                        PropertyInfo property = objTSDB.GetType().GetProperty(sName);
                        if (property != null)
                        {
                            if (property.PropertyType == typeof(decimal))
                            {
                                property.SetValue(objTSDB, Convert.ToDecimal(dr[i]), null);
                            }
                            else if (property.PropertyType == typeof(int))
                            {
                                property.SetValue(objTSDB, Convert.ToInt32(dr[i]), null);
                            }
                            else
                            {
                                property.SetValue(objTSDB, dr[i].ToString(), null);
                            }
                        }
                    }
                    lstTSDB.Add(objTSDB);
                }
                grdTaiSanDamBao.ItemsSource = lstTSDB;
            }
        }
 private void HienDanhMucKhachHang()
 {
     try
     {
         List <string>    lstDieuKien = new List <string>();
         KhachHangProcess khProcess   = new KhachHangProcess();
         string           lstIDKH     = "";
         if (!txtMaKhachHang.Text.IsNullOrEmptyOrSpace())
         {
             lstIDKH = "(" + _idKhachHang.ToString() + ")";
         }
         else
         {
             lstIDKH = "(0)";
         }
         lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
         lstDieuKien.Add("NULL");
         lstDieuKien.Add("NULL");
         lstPopup = new List <DataRow>();
         PopupProcess popupProcess = new PopupProcess();
         popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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];
             _idKhachHang = Convert.ToInt32(dr["ID"]);
             dsKhachHang  = khProcess.getThongTinCoBanKHTheoID(_idKhachHang);
             if (dsKhachHang != null && dsKhachHang.Tables[0].Rows.Count > 0)
             {
                 txtMaKhachHang.Text  = dsKhachHang.Tables[0].Rows[0]["MA_KHANG"].ToString();
                 txtTenKhachHang.Text = dsKhachHang.Tables[0].Rows[0]["TEN_KHANG"].ToString();
                 txtDiaChi.Text       = dsKhachHang.Tables[0].Rows[0]["DIA_CHI"].ToString();
                 LayDSDonVayVon(_idKhachHang);
             }
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
        void LoadPopUpSanPham()
        {
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(ClientInformation.MaDonVi);
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_SANPHAM_TD", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(false, simplePopupResponse, true);

            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)
            {
                foreach (DataRow dr in lstPopup)
                {
                    if (lstDanhSachSanpham.Where(f => f.MA_SAN_PHAM.Contains(dr["MA_SAN_PHAM"].ToString())).Count() < 1)
                    {
                        SAN_PHAM_DBAN_CTIET objSanPhamCTiet = new SAN_PHAM_DBAN_CTIET();
                        objSanPhamCTiet.NGAY_ADUNG   = ClientInformation.NgayLamViecHienTai;
                        objSanPhamCTiet.ID_DBAN      = idDiaBan;
                        objSanPhamCTiet.ID_SAN_PHAM  = Convert.ToInt32(dr["ID"]);
                        objSanPhamCTiet.LOAI_DBAN    = "DM_CUM";
                        objSanPhamCTiet.MA_DBAN      = MaDiaBan;
                        objSanPhamCTiet.MA_DVI_QLY   = objCum.MA_DVI_QLY;
                        objSanPhamCTiet.MA_DVI_TAO   = objCum.MA_DVI_TAO;
                        objSanPhamCTiet.MA_SAN_PHAM  = dr["MA_SAN_PHAM"].ToString();
                        objSanPhamCTiet.TEN_SAN_PHAM = dr["TEN_SAN_PHAM"].ToString();
                        objSanPhamCTiet.NGAY_NHAP    = ClientInformation.NgayLamViecHienTai;
                        objSanPhamCTiet.NGUOI_NHAP   = ClientInformation.TenDangNhap;
                        objSanPhamCTiet.TTHAI_BGHI   = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri();
                        objSanPhamCTiet.TTHAI_NVU    = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();
                        lstDanhSachSanpham.Add(objSanPhamCTiet);
                    }
                    radDanhSachLichPhat.ItemsSource = lstDanhSachSanpham;
                    radDanhSachLichPhat.Rebind();
                }
            }
        }
示例#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 button6_Click(object sender, RoutedEventArgs e)
        {
            var           process     = new PopupProcess();
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add("NULL");
            lstDieuKien.Add("NULL");
            process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG.getValue(), lstDieuKien);

            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

            ucPopup popup = new ucPopup(true, simplePopupResponse, true);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.Content = popup;
            win.ShowDialog();
        }
示例#23
0
        /*
         * private void button5_Click(object sender, RoutedEventArgs e)
         * {
         *  ucPopup popup = new ucPopup(0, 1, false);
         *  Window win = new Window();
         *  win.Content = popup;
         *  win.ShowDialog();
         * }
         */

        private void button5_Click(object sender, RoutedEventArgs e)
        {
            var process = new PopupProcess();
            //process.getPopupInformation("POPUP_DS_DONVI");
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add("'SDU','KDU'");
            lstDieuKien.Add("1");
            process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DM_DIABAN.getValue(), lstDieuKien);

            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

            ucPopup popup = new ucPopup(false, simplePopupResponse, true);
            Window  win   = new Window();

            win.Content = popup;
            win.ShowDialog();
            int ID = popup.ID;
            // ???
        }
示例#24
0
        /// <summary>
        /// Hiện popup khách hàng
        /// </summary>
        private void HienPopUpKhachHang()
        {
            PopupProcess  Popupprocess = new PopupProcess();
            List <string> lstDK        = new List <string>();
            string        maDV         = "";

            if (cmbChiNhanh.SelectedIndex >= 0)
            {
                maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            string maPGD = "";

            if (cmbChiNhanh.SelectedIndex >= 0)
            {
                maPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            string maCum = "";

            if (cmbCum.SelectedIndex >= 0)
            {
                maCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0);
            }
            lstDK.Add(maDV);
            lstDK.Add(maPGD);
            lstDK.Add(maCum);
            Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_BAOCAO.getValue(), lstDK);
            SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(true, simplePopupResponse, false);

            popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
            Window win = new Window();

            win.Title   = "Danh sách nhóm khách hàng";
            win.Content = popup;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopup != null && lstPopup.Count > 0)
            {
                txtMaKhachHang.Text = lstPopup[0][2].ToString();
            }
        }
示例#25
0
        private void ShowPopupDonVi()
        {
            try
            {
                lstPopup = new List <DataRow>();
                var process = new PopupProcess();
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DM_DONVI.getValue());

                SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
                win.Content = popup;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.ShowDialog();
                if (lstPopup != null)
                {
                    //if (txtMaDonVi.Text != lstPopup[0][2].ToString())
                    //{
                    //    // Reset source thông tin đối tượng
                    //    dt = new DataTable();
                    //    dt.Columns.Add("STT", typeof(string));
                    //    dt.Columns.Add("ID", typeof(string));
                    //    dt.Columns.Add("Mã", typeof(string));
                    //    dt.Columns.Add("Tên", typeof(string));
                    //    grDanhSach.ItemsSource = dt;
                    //    txtMaDonVi.Text = lstPopup[0][2].ToString();
                    //    lblDonViQL.Content = lstPopup[0][3].ToString();
                    //}
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
        private void btnKhachHang_Click(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                var           process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First());
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_PGD.getValue(), 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;
                Mouse.OverrideCursor      = Cursors.Arrow;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Title = "Danh sách khách hàng";
                win.ShowDialog();
                if (lstPopup != null)
                {
                    DataRow          row       = lstPopup[0];
                    KhachHangProcess processKH = new KhachHangProcess();
                    DataRow          dr        = processKH.getThongTinCoBanKHTheoID(Convert.ToInt32(row[1])).Tables[0].Rows[0];

                    AfterGetKhachHang(dr);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
示例#27
0
 void btnPhiTraTruoc_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         lstPopup.Clear();
         List <string> lstDieuKien = new List <string>();
         lstDieuKien.Add(ClientInformation.MaDonVi);
         lstDieuKien.Add(ClientInformation.NgayLamViecHienTai);
         lstDieuKien.Add("'HD01','HD02','HD03'");
         PopupProcess popupProcess = new PopupProcess();
         popupProcess.getPopupInformation("POPUP_DS_BIEU_PHI_LOAI_GDICH", lstDieuKien);
         SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
         ucPopup             popup = new ucPopup(false, simplePopupResponse);
         popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
         Window win = new Window();
         win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         win.Title   = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
         win.Content = popup;
         win.ShowDialog();
         if (lstPopup.Count > 0)
         {
             DataRow dr = lstPopup.FirstOrDefault();
             obj.BIEU_PHI = new BIEU_PHI_DTO();
             obj.BIEU_PHI.HTHUC_BTHANG = dr["HTHUC_BTHANG"].ToString();
             obj.BIEU_PHI.ID_BPHI      = Convert.ToInt32(dr["ID"]);
             obj.BIEU_PHI.LOAI_BPHI    = dr["LOAI_BPHI"].ToString();
             obj.BIEU_PHI.LOAI_TIEN    = dr["MA_LOAI_TIEN"].ToString();
             obj.BIEU_PHI.MA_BPHI      = dr["MA_BPHI"].ToString();
             obj.BIEU_PHI.NGAY_ADUNG   = dr["NGAY_ADUNG"].ToString();
             if (dr["NGAY_HHAN"] != DBNull.Value)
             {
                 obj.BIEU_PHI.NGAY_HHAN = dr["NGAY_HHAN"].ToString();
             }
             obj.BIEU_PHI.TCHAT_BPHI = dr["TCHAT_BPHI"].ToString();
             obj.BIEU_PHI.TEN_BPHI   = dr["TEN_BPHI"].ToString();
             obj.BIEU_PHI.TY_LE_VAT  = Convert.ToDecimal(dr["TY_LE_VAT"]);
             DataSet   ds = new PhiProcess().GetPhiByID(obj.BIEU_PHI.ID_BPHI);
             DataTable dt = ds.Tables[1];
             lstBieuPhi = new List <BIEU_PHI_CTIET_DTO>();
             foreach (DataRow dtr in dt.Rows)
             {
                 BIEU_PHI_CTIET_DTO objBieuPhiCT = new BIEU_PHI_CTIET_DTO();
                 objBieuPhiCT.ID_BPHI   = obj.BIEU_PHI.ID_BPHI;
                 objBieuPhiCT.LOAI_BPHI = dtr["LOAI_BPHI"].ToString();
                 objBieuPhiCT.MA_BPHI   = dtr["MA_BPHI"].ToString();
                 if (dtr["SO_TIEN"] != DBNull.Value)
                 {
                     objBieuPhiCT.SO_TIEN_TINH_PHI = Convert.ToDecimal(dtr["SO_TIEN"]);
                 }
                 if (dtr["SO_TIEN_PHI"] != DBNull.Value)
                 {
                     objBieuPhiCT.SO_TIEN_PHI = Convert.ToDecimal(dtr["SO_TIEN_PHI"]);
                 }
                 if (dtr["STIEN_PHI_TDA"] != DBNull.Value)
                 {
                     objBieuPhiCT.SO_TIEN_TDA = Convert.ToDecimal(dtr["STIEN_PHI_TDA"]);
                 }
                 if (dtr["STIEN_PHI_TTHIEU"] != DBNull.Value)
                 {
                     objBieuPhiCT.SO_TIEN_TTHIEU = Convert.ToDecimal(dtr["STIEN_PHI_TTHIEU"]);
                 }
                 if (dtr["TY_LE_PHI"] != DBNull.Value)
                 {
                     objBieuPhiCT.TY_LE_PHI = Convert.ToDecimal(dtr["TY_LE_PHI"]);
                 }
                 if (dtr["TY_LE_VAT"] != DBNull.Value)
                 {
                     objBieuPhiCT.TY_LE_VAT = Convert.ToDecimal(dtr["TY_LE_VAT"]);
                 }
                 lstBieuPhi.Add(objBieuPhiCT);
             }
             obj.BIEU_PHI.DSACH_BPHI_CT = lstBieuPhi.ToArray();
             TinhPhiTraTruoc();
             TinhToanTienThuaNopTKBB();
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
        void LoadPopUpDiaBan()
        {
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
            lstPopup = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_CUM", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopup             popup = new ucPopup(false, simplePopupResponse, true);

            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)
            {
                AutoCompleteEntry auSanPham = null;
                if (cmbSanPham.SelectedIndex < 0)
                {
                    auSanPham = lstSourceSanPham.ElementAt(cmbSanPham.SelectedIndex);
                }
                AutoCompleteEntry auLoaiSanPham = null;
                auLoaiSanPham = lstSourceLoaiSanPham.ElementAt(cmbLoaiSanPham.SelectedIndex);
                foreach (DataRow dr in lstPopup)
                {
                    if (lstDanhSachSanpham.Where(f => f.MA_DBAN.Contains(dr["MA_CUM"].ToString())).Count() < 1)
                    {
                        SAN_PHAM_DBAN_CTIET objSanPhamCTiet = new SAN_PHAM_DBAN_CTIET();
                        objSanPhamCTiet.NGAY_ADUNG = ClientInformation.NgayLamViecHienTai;
                        objSanPhamCTiet.ID_DBAN    = Convert.ToInt32(dr["ID"]);
                        if (obj.CHIEU_DU_LIEU == "SAN_PHAM")
                        {
                            objSanPhamCTiet.ID_SAN_PHAM = Convert.ToInt32(auSanPham.KeywordStrings[1]);
                        }
                        else
                        {
                            objSanPhamCTiet.ID_SAN_PHAM = 0;
                        }
                        objSanPhamCTiet.LOAI_DBAN  = "DM_CUM";
                        objSanPhamCTiet.MA_DBAN    = dr["MA_CUM"].ToString();
                        objSanPhamCTiet.TEN_DBAN   = dr["TEN_CUM"].ToString();
                        objSanPhamCTiet.MA_DVI_QLY = ClientInformation.MaDonVi;
                        objSanPhamCTiet.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich;
                        if (obj.CHIEU_DU_LIEU == "SAN_PHAM")
                        {
                            objSanPhamCTiet.MA_SAN_PHAM = auSanPham.KeywordStrings.FirstOrDefault();
                        }
                        else
                        {
                            objSanPhamCTiet.MA_SAN_PHAM = auLoaiSanPham.KeywordStrings.FirstOrDefault();
                            obj.LOAI_SAN_PHAM           = auLoaiSanPham.KeywordStrings.FirstOrDefault();
                        }
                        objSanPhamCTiet.NGAY_NHAP  = ClientInformation.NgayLamViecHienTai;
                        objSanPhamCTiet.NGUOI_NHAP = ClientInformation.TenDangNhap;
                        objSanPhamCTiet.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri();
                        objSanPhamCTiet.TTHAI_NVU  = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();
                        lstDanhSachSanpham.Add(objSanPhamCTiet);
                    }
                }
                radDanhSachLichPhat.ItemsSource = lstDanhSachSanpham;
                radDanhSachLichPhat.Rebind();
            }
        }
示例#29
0
        private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Bat popup
                if (cmbNguonVon.SelectedIndex < 0)
                {
                    return;
                }
                PopupProcess      process     = new PopupProcess();
                List <string>     lstDieuKien = new List <string>();
                AutoCompleteEntry au          = lstSourceNguonVon.ElementAt(cmbNguonVon.SelectedIndex);
                lstDieuKien.Add("%");
                lstDieuKien.Add("%");
                lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonViGiaoDich);
                lstDieuKien.Add(au.KeywordStrings.FirstOrDefault());
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET.getValue(), lstDieuKien);
                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title = simplePopupResponse.PopupTitle;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    txtSoTaiKhoan.Text     = lstPopup[0][2].ToString();
                    lblTenTaiKhoan.Content = lstPopup[0][3].ToString();
                    numSoDu.Value          = Convert.ToDouble(lstPopup[0]["SODU"]);
                    ID_TKHOAN = Convert.ToInt32(lstPopup[0][1]);
                    MA_LSDU   = lstPopup[0]["MA_LSDU"].ToString();
                    if (!lstPopup[0]["LOAI_DTUONG"].ToString().IsNullOrEmptyOrSpace())
                    {
                        cmbLoaiDoiTuong.SelectedIndex = lstSourceDoiTuongLoai.IndexOf(lstSourceDoiTuongLoai.FirstOrDefault(f => f.KeywordStrings.FirstOrDefault().Equals(lstPopup[0]["LOAI_DTUONG"].ToString())));
                        cmbLoaiDoiTuong.IsEnabled     = false;
                    }
                    else
                    {
                        cmbLoaiDoiTuong.SelectedIndex = -1;
                        cmbLoaiDoiTuong.IsEnabled     = true;
                    }
                    if (lstPopup[0]["MA_NHOM_PLOAI"].ToString().Equals("LT"))
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = false;
                    }
                    else
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = true;
                    }
                    if (lstPopup[0]["NGAY_GDICH"] != DBNull.Value)
                    {
                        telNgayChotDL.Value = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                        ngayChotDL          = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                    }
                    DataTable dt = null;
                    LDatatable.MakeParameterTable(ref dt);
                    LDatatable.AddParameter(ref dt, "@IdTaiKhoan", "INT", ID_TKHOAN.ToString());
                    DataSet ds = new KeToanProcess().getDanhSachTaiKhoanChiTiet(dt, "DOI_TUONG");
                    lstDTuongCT = new List <DOI_TUONG_SDU_TKHOAN_CT>();
                    if (!ds.IsNullOrEmpty() && !ds.Tables[0].IsNullOrEmpty())
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = new DOI_TUONG_SDU_TKHOAN_CT();
                            objDTuongCT.MA_DTUONG     = dr["MA_DTUONG"].ToString();
                            objDTuongCT.TEN_TAI_KHOAN = dr["TEN_DTUONG"].ToString();
                            objDTuongCT.MA_LSDU       = dr["MA_LSDU"].ToString();
                            objDTuongCT.NGAY_DL       = dr["NGAY_DL"].ToString();
                            objDTuongCT.NGAY_GDICH    = dr["NGAY_GDICH"].ToString();
                            objDTuongCT.NGAY_HLUC     = dr["NGAY_HLUC"].ToString();
                            objDTuongCT.SODU          = Convert.ToDecimal(dr["SO_DU"].ToString());
                            objDTuongCT.ID_DTUONG     = Convert.ToInt32(dr["ID"].ToString());
                            lstDTuongCT.Add(objDTuongCT);
                        }
                    }
                    raddgrTUngCT.ItemsSource = lstDTuongCT;
                    raddgrTUngCT.Rebind();
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
示例#30
0
        private void ShowPopupKhachHang()
        {
            if (Convert.ToInt32(lstSourcePhongGiaoDich.ElementAt(cmbPhongGiaoDich.SelectedIndex).KeywordStrings.ElementAt(1)) > 0)
            {
                if (chkCumTruongLaKHTV.IsChecked == true)
                {
                    if (!txtMaCum.Text.IsNullOrEmptyOrSpace())
                    {
                        List <string> lstDieuKien = new List <string>();
                        lstDieuKien.Add(lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0));
                        lstDieuKien.Add(txtMaCum.Text);
                        var process = new PopupProcess();
                        process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG.getValue(), lstDieuKien);

                        SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                        ucPopup popup = new ucPopup(true, simplePopupResponse, true);
                        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];
                            idCumTruong          = Convert.ToInt32(row[1].ToString());
                            txtCumTruong.Text    = row[2].ToString();
                            txtTenCumTruong.Text = row[3].ToString();
                        }
                    }
                    else
                    {
                        LMessage.ShowMessage("Chưa có thông tin khách hàng thành viên", LMessage.MessageBoxType.Warning);
                    }
                }
                else
                {
                    List <string> lstDieuKien = new List <string>();
                    lstDieuKien.Add(lstSourcePhongGiaoDich.ElementAt(cmbPhongGiaoDich.SelectedIndex).KeywordStrings.ElementAt(0));
                    lstDieuKien.Add(BusinessConstant.LOAI_HO_SO.CONG_TAC_VIEN.layGiaTri());
                    lstDieuKien.Add("(0)");
                    var process = new PopupProcess();
                    process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_HOSO_NHAN_SU_CTV.getValue(), lstDieuKien);

                    SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                    ucPopup popup = new ucPopup(false, simplePopupResponse, true);
                    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];
                        idCumTruong          = Convert.ToInt32(row[1].ToString());
                        txtCumTruong.Text    = row[2].ToString();
                        txtTenCumTruong.Text = row[3].ToString();
                    }
                }
            }
            else
            {
                LMessage.ShowMessage("Chưa chọn phòng giao dịch", LMessage.MessageBoxType.Warning);
            }
        }