private List <string> XuLy(string listitem, DatabaseConstant.Action action, string alert) { List <string> listResult = new List <string>(); List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>(); if (listitem != "") { List <KT_PLOAI> lstKtPloai = new List <KT_PLOAI>(); string[] str = listitem.Split(';'); if (str != null && str.Length > 0) { for (int k = 0; k < str.Length; k++) { KT_PLOAI obj = new KT_PLOAI(); obj.ID = Convert.ToInt32(str[k]); lstKtPloai.Add(obj); } } bool bResult = new KeToanProcess().XuLyPhanLoaiTaiKhoanDS(lstKtPloai.ToArray(), ref lstResponse, action); if (bResult) { foreach (ClientResponseDetail cl in lstResponse) { listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0])); } } else { listResult.Add(alert + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong")); } } return(listResult); }
void KhoiTaoControl() { try { string Dislay = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TatCa"); teldtSoDuNgay.Text = ""; List <string> lstDieuKien = new List <string>(); string maTruyVan = DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(); AutoComboBox auto = new AutoComboBox(); lstDieuKien.Add(AppConfig.LoginedUser.UserName); lstDieuKien.Add(AppConfig.LoginedUser.MaDonVi); lstDieuKien.Add(DatabaseConstant.ToChucDonVi.PGD.getValue()); auto.GenAutoComboBox(ref lstSourceDonVi, ref cmbDonVi, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DONVI_THEOPVI.getValue(), lstDieuKien, AppConfig.LoginedUser.MaDonViGiaoDich); if (AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_NVDV.layGiaTri()) || AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_QTDV.layGiaTri())) { cmbDonVi.Enabled = false; } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
void KhoiTaoControl() { try { string Dislay = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TatCa"); teldtNgayADungDen.Text = ""; teldtNgayADungTu.Text = ""; teldtNgayHetHanDen.Text = ""; teldtNgayHetHanTu.Text = ""; List <string> lstDieuKien = new List <string>(); string maTruyVan = DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(); // Gán giá trị điều kiện lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.PHUONG_THUC_TINH_LAI)); lstPhuongThucTinhLai.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstPhuongThucTinhLai, ref cmbPhuongThucTinhLai, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.MUC_DICH_VAY_VON)); lstMucDichSuDung.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstMucDichSuDung, ref cmbMucDich, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_SAN_PHAM_TDUNG)); lstLoaiSanPham.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstLoaiSanPham, ref cmbLoaiSanPham, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.TRANG_THAI_BAN_GHI)); lstHieuLuc.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstHieuLuc, ref cmbTinhTrang, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.NGUON_VON_VAY)); lstNguonVon.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstNguonVon, ref cmbLoaiVay, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_LAI_SUAT)); lstLoaiLaiSuat.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstLoaiLaiSuat, ref cmbLoaiLaiSuat, maTruyVan, lstDieuKien); AutoComboBox auto = new AutoComboBox(); lstDieuKien = new List <string>(); lstDieuKien.Add("'" + DatabaseConstant.ToChucDonVi.HSO.getValue() + "', '" + DatabaseConstant.ToChucDonVi.CNH.getValue() + "'"); auto.GenAutoComboBox(ref lstSourceDonVi, ref cmbDonVi, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DONVITHEOLOAI.getValue(), lstDieuKien, AppConfig.LoginedUser.MaDonVi); if (AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_NVDV.layGiaTri()) || AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_QTDV.layGiaTri())) { cmbDonVi.Enabled = false; } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private List <string> XuLy(string listitem, DatabaseConstant.Action action, string alert) { List <string> listResult = new List <string>(); List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>(); if (listitem != "") { List <KT_TKHOAN> lstKtTkhoan = new List <KT_TKHOAN>(); string[] str = listitem.Split(';'); if (str != null && str.Length > 0) { for (int k = 0; k < str.Length; k++) { KT_TKHOAN obj = new KT_TKHOAN(); obj.ID = Convert.ToInt32(str[k]); lstKtTkhoan.Add(obj); } } ApplicationConstant.ResponseStatus bResult = new KeToanProcess().TaiKhoanChiTietDS(action, lstKtTkhoan, ref lstResponse); if (bResult == ApplicationConstant.ResponseStatus.THANH_CONG) { foreach (ClientResponseDetail cl in lstResponse) { listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0])); } } else { listResult.Add(alert + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong")); } } return(listResult); }
private string GetParent(int pv_iMenuID) { string v_strContent = ""; DataTable v_dt = AppConfig.LoginedUser.CayMenu; DataView v_dv = v_dt.DefaultView; v_dv.RowFilter = "ID=" + pv_iMenuID.ToString(); if (v_dv.Count > 0) { v_strContent += "<span class=\"divider\">></span>"; if (DBNull.Value != v_dv[0]["URL_ICON"]) { v_strContent += "<span class=\"" + v_dv[0]["URL_ICON"].ToString() + "\"></span>"; } if (DBNull.Value != v_dv[0]["URL"]) { v_strContent += "<a href=\"" + v_dv[0]["URL"].ToString().Replace("~", "") + "\">" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[0]["TIEU_DE"].ToString()) + "</a>"; } else { v_strContent += "<span class=\"text bold white\" >" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[0]["TIEU_DE"].ToString()) + "</span>"; } //Build cha if (DBNull.Value != v_dv[0]["ID_CNANG_CHA"]) { int v_iMenucha = Convert.ToInt32(v_dv[0]["ID_CNANG_CHA"]); v_dv.RowFilter = ""; v_strContent = GetParent(v_iMenucha) + v_strContent; } } return(v_strContent); }
private void BuildTree() { tvwLoaiVay.Nodes.Clear(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.DanhMuc.PHUONG_THUC_VAY.getValue()); DropDownList dr = new DropDownList(); new AutoComboBox().GenAutoComboBox(ref lstPhuongThucVay, ref dr, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien); try { TreeNode item = new TreeNode(); item.Checked = true; item.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DMUC_LOAI.PHUONG_THUC_VAY"); item.Value = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DMUC_LOAI.PHUONG_THUC_VAY"); tvwLoaiVay.Nodes.Add(item); for (int i = 0; i < lstPhuongThucVay.Count; i++) { TreeNode ItemSub = new TreeNode(); ItemSub.Text = lstPhuongThucVay[i].DisplayName; ItemSub.Checked = true; ItemSub.Value = lstPhuongThucVay[i].KeywordStrings[0]; tvwLoaiVay.Nodes[0].ChildNodes.Add(ItemSub); } } catch { } tvwLoaiVay.ExpandAll(); tvwLoaiVay.ShowCheckBoxes = TreeNodeTypes.All; }
private void SetFormData() { string SO_GIAO_DICH = MA_GIAO_DICH.Value; try { HuyDongVonProcess processHDV = new HuyDongVonProcess(); DataSet ds = processHDV.GetThongTinGuiThemTheoDS(AppConfig.LoginedUser.MaDonViGiaoDich, SO_GIAO_DICH); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; lblTrangThai.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, BusinessConstant.layMaNgonNguNghiepVu(dr["TTHAI_NVU"].ToString())); raddtNgay.Text = LDateTime.StringToDate(dr["NGAY_DL"].ToString(), "yyyyMMdd").ToString("dd/MM/yyyy"); txtMaGiaoDich.Text = SO_GIAO_DICH; txtNguoiGiaoDich.Text = dr["TEN_KHANG"].ToString(); txtDiaChi.Text = dr["DIA_CHI"].ToString(); txtDienGiai.Text = dr["DIEN_GIAI"].ToString(); TRANG_THAI_BAN_GHI.Value = dr["TTHAI_BGHI"].ToString(); TRANG_THAI_NGHIEP_VU.Value = dr["TTHAI_NVU"].ToString(); #region Tab thông tin kiểm soát txtTrangThai.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, BusinessConstant.layMaNgonNguSuDung(dr["TTHAI_BGHI"].ToString())); teldtNgayNhap.Text = LDateTime.StringToDate(dr["NGAY_NHAP"].ToString(), "yyyyMMdd").ToString("dd/MM/yyyy"); txtNguoiLap.Text = dr["NGUOI_NHAP"].ToString(); if (LDateTime.IsDate(dr["NGAY_CNHAT"].ToString(), "yyyyMMdd") == true) { teldtNgayCNhat.Text = LDateTime.StringToDate(dr["NGAY_CNHAT"].ToString(), "yyyyMMdd").ToString("dd/MM/yyyy"); } else { teldtNgayCNhat.Text = ""; } txtNguoiCapNhat.Text = dr["NGUOI_CNHAT"].ToString(); #endregion } dsGuiThem = processHDV.GetThongTinGuiThemTheoDSCTiet(AppConfig.LoginedUser.MaDonViGiaoDich, SO_GIAO_DICH); if (dsGuiThem != null) { //DataViewManager dataViewManager = new DataViewManager(dsGuiThem); // DataView dataView = dataViewManager.CreateDataView(dsGuiThem.Tables[0]); grGuiThemDS.DataSource = dsGuiThem; grGuiThemDS.DataBind(); } TinhTong(); } catch (Exception ex) { } }
public void GenAutoSoure(ref List <AutoCompleteEntry> lstSource, string maTruyVan, List <string> lstDieuKien = null, string maChon = "Default", List <string> lstMaKhoangChon = null) { Func <AutoCompleteEntry, bool> predicate = null; Func <AutoCompleteEntry, bool> func2 = null; try { if (!string.IsNullOrEmpty(maTruyVan)) { TruyVanProcess process = new TruyVanProcess(); DataSet dataSetSource = new DataSet(); dataSetSource = process.getDanhSachInformation(maTruyVan, lstDieuKien).DataSetSource; foreach (DataRow row in dataSetSource.Tables[0].Rows) { if (row.Table.Columns.Count > 3) { List <string> list = new List <string> { row[1].ToString(), row[0].ToString() }; for (int i = 3; i < dataSetSource.Tables[0].Columns.Count; i++) { list.Add(row[i].ToString()); } lstSource.Add(new AutoCompleteEntry(LanguageEngine.Instance().GetContent(0, row[2].ToString()), list.ToArray())); } else { string content = LanguageEngine.Instance().GetContent(0, row[2].ToString()); if (content == "") { content = LanguageEngine.Instance().GetContent(0, row[1].ToString()); } lstSource.Add(new AutoCompleteEntry(content, new string[] { row[1].ToString(), row[0].ToString() })); } } } if (lstMaKhoangChon != null) { if (predicate == null) { predicate = e => lstMaKhoangChon.Contains(e.KeywordStrings.First <string>()); } lstSource = lstSource.Where <AutoCompleteEntry>(predicate).ToList <AutoCompleteEntry>(); } } catch (Exception exception) { LLogging.WriteLog("", LLogging.LogType.ERR, exception); } }
private List <string> Tuchoi(string listitem) { List <string> listResult = new List <string>(); if (listitem != "") { List <int> lstID = new List <int>(); string[] str = listitem.Split(';'); if (str != null && str.Length > 0) { for (int k = 0; k < str.Length; k++) { lstID.Add(Convert.ToInt32(str[k])); } } List <ClientResponseDetail> ResponseDetail = new List <ClientResponseDetail>(); UtilitiesProcess process = new UtilitiesProcess(); if (process.LockData(DatabaseConstant.Module.TDVM, DatabaseConstant.Function.TDVM_SAN_PHAM_TDVM, DatabaseConstant.Table.TD_SAN_PHAM, DatabaseConstant.Action.TU_CHOI_DUYET, lstID)) { bool bResult = new TinDungProcess().TuChoiSanPhamTinDung(lstID, ref ResponseDetail); if (bResult) { foreach (ClientResponseDetail cl in ResponseDetail) { listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0])); } // Yeu cau Unlook du lieu process.UnlockData(DatabaseConstant.Module.TDVM, DatabaseConstant.Function.TDVM_SAN_PHAM_TDVM, DatabaseConstant.Table.TD_SAN_PHAM, DatabaseConstant.Action.TU_CHOI_DUYET, lstID); LoadDuLieu(); } else { listResult.Add("M.DungChung.DuyetKhongThanhCong#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong")); } } else { listResult.Add("M.ResponseMessage.Common.LockDataInvalid#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.ResponseMessage.Common.LockDataInvalid")); } } return(listResult); }
protected void Page_Load(object sender, EventArgs e) { grbThongtinsotiengui.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.GiaoDichGuiThem.ucGuiThemTienGuiCT.ThongTinSoTGui"); grbThongtinKhachang.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.GiaoDichGuiThem.ucGuiThemTienGuiCT.ThongTinKH"); tbiKiemSoat.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.Tab.ThongTinKiemSoat_2"); pnThongtinGiaodich.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.GiaoDichGuiThem.ucGuiThemTienGuiCT.ThongTinGD"); cmbGD_HinhThuc.Attributes.Add("onchange", "changehtgd()"); inpTrangThai.Value = CommonFuntion.LayTrangThaiBanGhi(DatabaseConstant.Action.LUU, BusinessConstant.layTrangThaiNghiepVu(sTrangThaiNVu)); if (!IsPostBack) { inpAction.Value = "THEM"; LoadCombobox(); ResetForm(); } }
protected void Page_Load(object sender, EventArgs e) { tvSearch.Attributes.Add("onclick", "OnTreeClick(event)"); btnTimkiem.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.Button.TimKiem"); LoadParams(); if (!IsPostBack) { if (HttpContext.Current.Request.QueryString["f"].ToString() != "" && HttpContext.Current.Request.QueryString["f"].ToString() != "") { fn = HttpContext.Current.Request.QueryString["f"].ToString(); isMultiSelect = bool.Parse(HttpContext.Current.Request.QueryString["m"].ToString()); LoadTreeview(); LoadGrid(0); } } }
void KhoiTaoControl() { try { string Dislay = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TatCa"); List <string> lstDieuKien = new List <string>(); string maTruyVan = DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(); // Gán giá trị điều kiện lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_KHACH_HANG)); lstPhuongThucTinhLai.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstPhuongThucTinhLai, ref cmbLoaiKHang, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_HINH_TO_CHUC)); lstMucDichSuDung.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstMucDichSuDung, ref cmbLoaiHinhTC, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.NGHE_NGHIEP)); lstLoaiSanPham.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstLoaiSanPham, ref cmbNgheNghiep, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.NGANH_KINH_TE)); lstHieuLuc.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstHieuLuc, ref cmbNganhKinhTe, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.DAN_TOC)); lstNguonVon.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstNguonVon, ref cmbDanToc, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.GIOI_TINH)); lstLoaiLaiSuat.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstLoaiLaiSuat, ref cmbGioiTinh, maTruyVan, lstDieuKien); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
void KhoiTaoControl() { try { string Dislay = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TatCa"); txtNgayNhanNoTu.Text = ""; txtNgayNhanNoDen.Text = ""; txtNgayDaoHanTu.Text = ""; txtNgayDaoHanDen.Text = ""; List <string> lstDieuKien = new List <string>(); string maTruyVan = DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(); // Gán giá trị điều kiện lstDieuKien = new List <string>(); lstDieuKien.Add("''" + AppConfig.LoginedUser.MaDonVi + "''"); lstDieuKien.Add("%"); lstDieuKien.Add("0"); lstDieuKien.Add("0"); //lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.LOAI_SAN_PHAM_TDUNG)); lstSanPham.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstSanPham, ref cmbSanPham, "COMBOBOX_SAN_PHAM_TD", lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.NHOM_NO)); lstNhomNo.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstNhomNo, ref cmbNhomNo, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.DVI_TINH_KY_HAN)); lstThoiHanVayTu.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstThoiHanVayTu, ref cmbThoiHanVayTu, maTruyVan, lstDieuKien); lstDieuKien = new List <string>(); lstDieuKien.Add(DatabaseConstant.getValue(DatabaseConstant.DanhMuc.DVI_TINH_KY_HAN)); lstThoiHanVayDen.Add(new AutoCompleteEntry(Dislay, "%", "%")); KhoiTaoGiaTriComboBox(ref lstThoiHanVayDen, ref cmbThoiHanVayDen, maTruyVan, lstDieuKien); //if (AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_NVDV.layGiaTri()) || AppConfig.LoginedUser.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_QTDV.layGiaTri())) // cmbDonVi.Enabled = false; } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void KhoiTaoControl() { string Dislay = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TatCa"); try { BuilCombobox(); teldtNgayGDTu.Text = DateTime.ParseExact(AppConfig.LoginedUser.NgayLamViecHienTai, "yyyyMMdd", null).ToString("dd/MM/yyyy"); teldtNgayGDDen.Text = DateTime.ParseExact(AppConfig.LoginedUser.NgayLamViecHienTai, "yyyyMMdd", null).ToString("dd/MM/yyyy"); tetxSoGiaoDich.Text = ""; tetxSoPhieu.Text = ""; } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private string LoadSubMenu(int pv_iParentID, int pv_iIndent) { StringBuilder v_sbSub = new StringBuilder(); DataView v_dv = AppConfig.LoginedUser.CayMenu.DefaultView; v_dv.RowFilter = ""; v_dv.RowFilter = "ID_CNANG_CHA=" + pv_iParentID.ToString(); if (v_dv.Count > 0) { for (int i = 0; i < v_dv.Count; i++) { v_sbSub.AppendLine("<div class=\"menulinelv" + pv_iIndent.ToString() + "\" >"); if ((v_dv[i]["URL_ICON"] != DBNull.Value) && (v_dv[i]["URL_ICON"].ToString().Trim().Length > 0)) { v_sbSub.AppendLine("<span class=\"" + v_dv[i]["URL_ICON"].ToString() + "\" ></span>"); } if ((v_dv[i]["URL"] != DBNull.Value) && (v_dv[i]["URL"].ToString().Trim().Length > 0)) { if (v_dv[i]["URL_TYPE"].ToString() == "Popup") { v_sbSub.AppendLine("<a class=\"menulink\" href=\"#\" onclick=\"javascript:showpopup('" + v_dv[i]["URL"].ToString().Replace("~", "") + "', window.outerWidth - 120, window.outerHeight - 100)\" >" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[i]["TIEU_DE"].ToString()) + "</a>"); } else { v_sbSub.AppendLine("<a class=\"menulink\" href=\"" + v_dv[i]["URL"].ToString().Replace("~", "") + "\" >" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[i]["TIEU_DE"].ToString()) + "</a>"); } } else { v_sbSub.AppendLine("<span class=\"text bold\" >" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[i]["TIEU_DE"].ToString()) + "</span>"); } v_sbSub.AppendLine("</div>"); v_sbSub.Append(LoadSubMenu(Convert.ToInt32(v_dv[i]["ID"]), pv_iIndent + 1)); v_dv.RowFilter = "ID_CNANG_CHA=" + pv_iParentID.ToString(); } } v_dv.RowFilter = ""; return(v_sbSub.ToString()); }
protected void Page_Load(object sender, EventArgs e) { pnThongtinGiaodich.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.GiaoDichGuiThem.ucGuiThemTienGuiTheoDS.ThongTinGiaoDich"); pnDanhsachGuithem.GroupingText = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.GiaoDichGuiThem.ucGuiThemTienGuiTheoDS.DanhSachGuiThem"); if (!IsPostBack) { LoadCombobox(); KhoiTaoGridGuiThem(); if (HttpContext.Current.Request.QueryString["ID"] != null && HttpContext.Current.Request.QueryString["t"] != null && HttpContext.Current.Request.QueryString["MAGD"] != null) { ID_GIAO_DICH.Value = HttpContext.Current.Request.QueryString["ID"].ToString(); inpIDSO.Value = HttpContext.Current.Request.QueryString["ID"].ToString(); LOAI_HANH_DONG.Value = HttpContext.Current.Request.QueryString["t"].ToString(); MA_GIAO_DICH.Value = HttpContext.Current.Request.QueryString["MAGD"].ToString(); } else { inpAction.Value = "THEM"; ResetForm(); } SetFormData(); } }
public void InitData() { string v_strScript = ""; StringBuilder v_st = new StringBuilder(); string v_strGridHeader = "", v_strGridBody = "", v_strGridFooter = ""; int v_iReturnCol = 0; if (MaTruyVan.Length > 0) { List <string> v_lstDieuKien = new List <string>(); if (DieuKien.Length > 0) { string[] v_arr = DieuKien.Split("|".ToCharArray()); for (int i = 0; i < v_arr.GetLength(0); i++) { v_lstDieuKien.Add(v_arr[i]); } } DataTable v_dt = TruyVanController.GetPopupData(MaTruyVan, v_lstDieuKien); if (null != v_dt) { //Build header v_strGridHeader = "<table id=\"grdPopup\" class=\"display\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n"; v_strGridHeader += " <thead>\r\n"; v_strGridHeader += " <tr>\r\n"; for (int i = 0; i < v_dt.Columns.Count; i++) { v_strGridHeader += " <th>" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dt.Columns[i].Caption) + "</th>\r\n"; if (v_dt.Columns[i].ExtendedProperties["width"].ToString() == "0") { v_st.AppendLine(" table.column(" + i.ToString() + ").visible(false);"); } if (v_dt.Columns[i].ColumnName.ToUpper().Trim() == ReturnKey.ToUpper().Trim()) { v_iReturnCol = i; } } v_strGridHeader += " </tr>\r\n"; v_strGridHeader += " </thead>\r\n"; v_strGridFooter = "</table>"; //Build body v_strGridBody = "<tbody>\r\n"; for (int i = 0; i < v_dt.Rows.Count; i++) { v_strGridBody += " <tr>\r\n"; for (int j = 0; j < v_dt.Columns.Count; j++) { if (v_dt.Columns[j].DataType == typeof(DateTime)) { v_strGridBody += " <td>" + ((DateTime)v_dt.Rows[i][j]).ToString("dd/MM/yyyy") + "</td>\r\n"; } else if ((v_dt.Columns[j].DataType == typeof(Int32)) || (v_dt.Columns[j].DataType == typeof(Int64)) || (v_dt.Columns[j].DataType == typeof(Decimal)) || (v_dt.Columns[j].DataType == typeof(float))) { v_strGridBody += " <td>" + (Convert.ToDecimal(v_dt.Rows[i][j])).ToString("###,###,##0.##") + "</td>\r\n"; } else { if (!v_dt.Columns[j].ColumnName.Contains("KEY")) { v_strGridBody += " <td>" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dt.Rows[i][j].ToString()) + "</td>\r\n"; } else { v_strGridBody += " <td>" + v_dt.Rows[i][j].ToString() + "</td>\r\n"; } } } v_strGridBody += " </tr>\r\n"; } v_strGridBody += "/<tbody>\r\n"; //Build script v_strScript = "<script type = \"text/javascript\">\r\n" + "$(function() {\r\n" + " var table = $(\"#grdPopup\").DataTable({\r\n" + " \"bInfo\": false,\r\n" + " \"pageLength\": 10,\r\n" + " \"dom\": '<\"top\"i>rt<\"bottom\"flp><\"clear\">'\r\n" + " });\r\n" + v_st.ToString() + "\r\n" + " $('#grdPopup tbody').on('dblclick', 'tr', function() {\r\n" + " if ($(this).hasClass('selected')) {\r\n" + " $(this).removeClass('selected');\r\n" + " }\r\n" + " else {\r\n" + " table.$('tr.selected').removeClass('selected');\r\n" + " $(this).addClass('selected');\r\n" + " opener.setSearchResult(targetField,table.row(this).data()[" + v_iReturnCol.ToString() + "]);\r\n" + " window.close();\r\n" + " }\r\n" + " });\r\n" + "});\r\n" + " </script>\r\n"; mv_strConent = v_strScript + v_strGridHeader + v_strGridBody + v_strGridFooter; } } }
private List <string> TuChoi(string pv_strListItem) { List <string> listResult = new List <string>(); if (pv_strListItem != "") { List <GDICH_KSOAT> lstGdich = new List <GDICH_KSOAT>(); List <int> lstID = GetListIdLock(pv_strListItem); string[] str = pv_strListItem.Split(';'); if (str != null && str.Length > 0) { for (int k = 0; k < str.Length; k++) { DataView v_dv = ListGiaoDich.DefaultView; v_dv.RowFilter = ""; v_dv.RowFilter = "ID=" + str[k]; if (v_dv.Count > 0) { GDICH_KSOAT obj = new GDICH_KSOAT(); obj.DIEN_GIAI = v_dv[0]["DIEN_GIAI"].ToString(); obj.ID_GDICH = Convert.ToInt32(v_dv[0]["ID"]); obj.LY_DO = v_dv[0]["LY_DO"].ToString(); obj.MA_DVI = v_dv[0]["MA_DVI"].ToString(); obj.MA_GDICH = v_dv[0]["SO_GDICH"].ToString(); obj.MA_LOAI_GDICH = DatabaseConstant.layLoaiGiaoDich(v_dv[0]["MA_LOAI_GDICH"].ToString()); obj.MA_PHAN_HE = DatabaseConstant.getModule(v_dv[0]["MA_PHAN_HE"].ToString()); obj.NGAY_GDICH = v_dv[0]["NGAY_GIAO_DICH"].ToString(); obj.NGAY_CNHAT = AppConfig.LoginedUser.NgayLamViecHienTai; obj.NGUOI_CNHAT = AppConfig.LoginedUser.UserName; obj.NGUOI_NHAP = v_dv[0]["NGUOI_NHAP"].ToString(); obj.NGAY_NHAP = v_dv[0]["NGAY_NHAP"].ToString(); obj.MA_CNANG = v_dv[0]["MA_CNANG"].ToString(); lstGdich.Add(obj); } } List <ClientResponseDetail> lstResponseDetail = new List <ClientResponseDetail>(); ApplicationConstant.ResponseStatus status = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG; Presentation.Process.KeToanProcess process = new Presentation.Process.KeToanProcess(); // Yêu cầu lock bản ghi cần xử lý UtilitiesProcess Lockprocess = new UtilitiesProcess(); bool ret = Lockprocess.LockData(DatabaseConstant.Module.GDKT, DatabaseConstant.Function.KT_GIAO_DICH, DatabaseConstant.Table.KT_GIAO_DICH, DatabaseConstant.Action.TU_CHOI_DUYET, lstID); bool retUnlockData = Lockprocess.UnlockData(DatabaseConstant.Module.GDKT, DatabaseConstant.Function.KT_GIAO_DICH, DatabaseConstant.Table.KT_GIAO_DICH, DatabaseConstant.Action.TU_CHOI_DUYET, lstID); if (ret) { status = process.KiemSoatGiaoDich(lstGdich, DatabaseConstant.Action.TU_CHOI_DUYET, ref lstResponseDetail); if (status == ApplicationConstant.ResponseStatus.THANH_CONG) { foreach (ClientResponseDetail cl in lstResponseDetail) { listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0])); } } else { listResult.Add("M.DungChung.DuyetKhongThanhCong#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong")); } } else { listResult.Add("M.ResponseMessage.Common.LockDataInvalid#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.ResponseMessage.Common.LockDataInvalid")); } } } return(listResult); }
/// <summary> /// Load dữ liệu lên Treeview /// </summary> private void LoadTreeview() { try { HuyDongVonProcess huyDongVonProcess = new HuyDongVonProcess(); string sIdDonVi = ""; string sMaDonVi = ""; string sIdDonViQLy = ""; string sMaDonViQLy = ""; if (lstSourceDonVi != null) { sIdDonVi = lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.ElementAt(1); sMaDonVi = lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.ElementAt(0); DM_DON_VI objDonVi = new DanhMucProcess().getDonViById(Convert.ToInt32(sIdDonVi)); if (objDonVi.LOAI_DVI.Equals(DatabaseConstant.ToChucDonVi.HSO.getValue()) || objDonVi.LOAI_DVI.Equals(DatabaseConstant.ToChucDonVi.CNH.getValue())) { sIdDonViQLy = objDonVi.ID.ToString(); sMaDonViQLy = objDonVi.MA_DVI; } else { sIdDonViQLy = objDonVi.ID_DVI_CHA.ToString(); sMaDonViQLy = objDonVi.MA_DVI_CHA; } } dtTreeSanPham = huyDongVonProcess.GetTreeSanPham(sMaDonViQLy).Tables[0]; dtTreeDonVi = huyDongVonProcess.GetTreeDonViNhom(AppConfig.LoginedUser.MaDonViQuanLy, AppConfig.LoginedUser.UserName, sMaDonViQLy).Tables[0]; dtTreeCBQL = huyDongVonProcess.GetTreeCBQL(sMaDonViQLy).Tables[0]; // BuildTree(dtTreeSanPham, tvwLoaiVay, false); DataTable mtree = new DataTable(); mtree.Columns.Add("LEVEL", Type.GetType("System.String")); mtree.Columns.Add("NODE_PARENT", Type.GetType("System.String")); mtree.Columns.Add("NODE", Type.GetType("System.String")); mtree.Columns.Add("NODE_NAME", Type.GetType("System.String")); mtree.Columns.Add("STYPE", Type.GetType("System.String")); DataRow row = mtree.NewRow(); for (int j = 0; j < dtTreeSanPham.Rows.Count; j++) { row = mtree.NewRow(); row["LEVEL"] = dtTreeSanPham.Rows[j][0].ToString(); row["NODE_PARENT"] = dtTreeSanPham.Rows[j][1].ToString(); row["NODE"] = dtTreeSanPham.Rows[j][2].ToString(); row["NODE_NAME"] = dtTreeSanPham.Rows[j][3].ToString(); row["STYPE"] = "SAN_PHAM"; mtree.Rows.Add(row); } tvwLoaiVay.Nodes.Clear(); TreeNode rootItem = new TreeNode(); rootItem.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.MoSo.ucMoSoDS.NhomSanPham"); rootItem.Value = "0#SAN_PHAM"; tvwLoaiVay.Nodes.Add(rootItem); BuildTree(rootItem, mtree, "SAN_PHAM"); mtree.Clear(); for (int j = 0; j < dtTreeDonVi.Rows.Count; j++) { row = mtree.NewRow(); row["LEVEL"] = dtTreeDonVi.Rows[j][0].ToString(); row["NODE_PARENT"] = dtTreeDonVi.Rows[j][1].ToString(); row["NODE"] = dtTreeDonVi.Rows[j][2].ToString(); row["NODE_NAME"] = dtTreeDonVi.Rows[j][3].ToString(); row["STYPE"] = "DON_VI"; mtree.Rows.Add(row); } TreeNode rootItem_dv = new TreeNode(); rootItem_dv.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.MoSo.ucMoSoDS.KhachHang"); rootItem_dv.Value = "0#DON_VI"; tvwLoaiVay.Nodes.Add(rootItem_dv); BuildTree(rootItem, mtree, "DON_VI"); tvwLoaiVay.ShowCheckBoxes = TreeNodeTypes.All; } catch (Exception ex) { //LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
private void LoadGDGrid() { string v_strMaDonVi = ""; string v_strMaPhanHe = "", v_strLoaiPhanHe = "", v_strTrangThai = ""; string v_strTuNgay = teldtNgayGDTu.Text.Trim(); string v_strDenNgay = teldtNgayGDDen.Text.Trim(); string v_strSoGD = tetxSoGiaoDich.Text.Trim(); string v_strSoPhieu = tetxSoPhieu.Text.Trim(); foreach (ListItem v_objItem in cmbDonVi.Items) { if (v_objItem.Value.Contains(cmbDonVi.SelectedValue)) { v_strMaDonVi += "''" + v_objItem.Value + "'',"; } } if (v_strMaDonVi.EndsWith(",")) { v_strMaDonVi = v_strMaDonVi.Substring(0, v_strMaDonVi.Length - 1); } v_strMaDonVi = "(" + v_strMaDonVi + ")"; string v_strTreeVal = ""; if (null != tvwLoaiGD.SelectedNode) { v_strTreeVal = tvwLoaiGD.SelectedNode.Value; v_strMaPhanHe = v_strTreeVal.Split('|')[0]; v_strLoaiPhanHe = v_strTreeVal.Split('|')[1]; } if (cbChoduyet.Checked) { v_strTrangThai = v_strTrangThai + "''" + cbChoduyet.Value + "'',"; } if (cbDaduyet.Checked) { v_strTrangThai = v_strTrangThai + "''" + cbDaduyet.Value + "'',"; } if (cbThoaiduyet.Checked) { v_strTrangThai = v_strTrangThai + "''" + cbThoaiduyet.Value + "'',"; } if (cbDaduyet.Checked) { v_strTrangThai = v_strTrangThai + "''" + cbDaduyet.Value + "'',"; } if (v_strTrangThai != "") { v_strTrangThai = "(" + v_strTrangThai.Substring(0, v_strTrangThai.Length - 1) + ")"; } if (!Utils.IsDate(v_strTuNgay, "dd/MM/yyyy")) { v_strTuNgay = AppConfig.LoginedUser.NgayLamViecHienTai; } else { v_strTuNgay = DateTime.ParseExact(v_strTuNgay, "dd/MM/yyyy", null).ToString("yyyyMMdd"); } if (!Utils.IsDate(v_strDenNgay, "dd/MM/yyyy")) { v_strDenNgay = AppConfig.LoginedUser.NgayLamViecHienTai; } else { v_strDenNgay = DateTime.ParseExact(v_strDenNgay, "dd/MM/yyyy", null).ToString("yyyyMMdd"); } DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MaDonVi", "STRING", v_strMaDonVi); LDatatable.AddParameter(ref dt, "@MaPhanHe", "STRING", v_strMaPhanHe); LDatatable.AddParameter(ref dt, "@LoaiPhanHe", "STRING", v_strLoaiPhanHe); LDatatable.AddParameter(ref dt, "@TrangThai", "STRING", v_strTrangThai); LDatatable.AddParameter(ref dt, "@TuNgay", "STRING", v_strTuNgay); LDatatable.AddParameter(ref dt, "@DenNgay", "STRING", v_strDenNgay); LDatatable.AddParameter(ref dt, "@SoGD", "STRING", v_strSoGD); LDatatable.AddParameter(ref dt, "@SoPhieu", "STRING", v_strSoPhieu); LDatatable.AddParameter(ref dt, "@StartRow", "INT", "1"); LDatatable.AddParameter(ref dt, "@EndRow", "INT", "1000000000"); LDatatable.AddParameter(ref dt, "@UserName", "STRING", AppConfig.LoginedUser.UserName); LDatatable.AddParameter(ref dt, "@MaDViQLy", "STRING", AppConfig.LoginedUser.MaDonViQuanLy); DataSet ds = new KeToanProcess().getDanhSachGiaoDich(dt); if ((null != ds) && (ds.Tables.Count > 0)) { ds.Tables[0].Columns.Add("URL", typeof(string)); ds.Tables[0].Columns.Add("TRANG_THAI_DT", typeof(string)); DataTable v_dt = AppConfig.LoginedUser.CayMenu; DataView v_dv = v_dt.DefaultView; foreach (DataRow dr in ds.Tables[0].Rows) { string v_strMa_CNANG = ""; switch (dr["MA_LOAI_GDICH"].ToString()) { case "GT01": { v_strMa_CNANG = "WEB_522_GUI_THEM_TIEN"; break; } case "GT02": { v_strMa_CNANG = "WEB_522_GUI_THEM_TIEN_TUNG_SO"; break; } } string v_strID = dr["ID"].ToString(); string v_strURL = ""; if (dr["SO_GDICH"].ToString() == "GD201610000112") { v_dv.RowFilter = ""; } v_dv.RowFilter = ""; v_dv.RowFilter = "MA_CNANG='" + v_strMa_CNANG + "'"; if (v_dv.Count > 0) { if (DBNull.Value != v_dv[0]["URL"]) { v_strURL = v_dv[0]["URL"].ToString(); if (v_strURL.Contains("&")) { v_strURL = v_strURL.Substring(0, v_strURL.IndexOf("&")); } } } v_dv.RowFilter = ""; dr["URL"] = v_strURL.Replace("~", ""); string v_strTT = ""; switch (dr["TRANG_THAI"].ToString()) { case "DDU": { v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.DaDuyet"); break; } case "CDU": { v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.ChoDuyet"); break; } case "TCD": { v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.TuChoi"); break; } case "THD": { v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.ThoaiDuyet"); break; } } dr["TRANG_THAI_DT"] = v_strTT; } ListGiaoDich = ds.Tables[0]; grdKiemSoatDS.DataSource = ds.Tables[0]; grdKiemSoatDS.DataBind(); } }
/// <summary> /// Load dữ liệu lên Treeview /// </summary> private void LoadTreeview() { try { HuyDongVonProcess huyDongVonProcess = new HuyDongVonProcess(); string sIdDonVi = AppConfig.LoginedUser.IdDonVi.ToString(); if (sIdDonVi == "0") { sIdDonVi = "4"; // FIX TAM DE CO DU LIEU } string sMaDonVi = AppConfig.LoginedUser.MaDonVi; DataSet dsTreeSanPham; dtTreeDonVi = huyDongVonProcess.GetTreeDonVi(sIdDonVi).Tables[0]; #region Tree Sản phẩm if (fn == "HDV_RUT_BOT_GOC" || fn == "HDV_RUT_GOC_THEO_DANH_SACH") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamRutGoc(sMaDonVi); } else if (fn == "HDV_GUI_THEM_TIEN_THEO_SO" || fn == "HDV_GUI_THEM_TIEN_THEO_DANH_SACH") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamGuiThem(sMaDonVi); } else if (fn == "HDV_TRA_LAI" || fn == "HDV_TRA_LAI_THEO_DANH_SACH") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamTraLai(sMaDonVi); } else if (fn == "HDV_DU_CHI") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamDuChi(sMaDonVi); } else if (fn == "HDV_PHAN_BO") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamPhanBo(sMaDonVi); } else if (fn == "HDV_DIEU_CHINH_LS") { dsTreeSanPham = huyDongVonProcess.GetTreeSanPhamThayDoiLS(sMaDonVi); } else { dsTreeSanPham = huyDongVonProcess.GetTreeSanPham(sMaDonVi); } if (dsTreeSanPham != null && dsTreeSanPham.Tables[0].Rows.Count > 0) { dtTreeSanPham = dsTreeSanPham.Tables[0]; } #endregion tvSearch.Nodes.Clear(); //Cấu trúc của Tag: GiaTri#Level#LoaiTree ( VD: MaSP001#2#SAN_PHAM) TreeNode itemSanPham = new TreeNode(); itemSanPham.Value = "0#0#SAN_PHAM"; itemSanPham.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.Popup.ucPopupSoTGui.SanPham"); itemSanPham.Expanded = true; tvSearch.Nodes.Add(itemSanPham); BuildTree(itemSanPham, dtTreeSanPham, "SAN_PHAM"); TreeNode itemDonVi = new TreeNode(); //Cấu trúc của Tag: GiaTri#Level#LoaiTree ( VD: MaSP001#2#SAN_PHAM) itemDonVi.Value = "0#0#DON_VI"; itemDonVi.Text = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.HuyDongVon.MoSo.ucMoSoDS.KhachHang"); itemDonVi.Expanded = true; //BuildTree(itemDonVi, dtTreeDonVi, "DON_VI"); tvSearch.Nodes.Add(itemDonVi); BuildSubTreeKhuVuc(itemDonVi, null, 0); tvSearch.ShowCheckBoxes = TreeNodeTypes.All; } catch (Exception ex) { } }
private void InitMenu() { StringBuilder v_sbMenu = new StringBuilder(); if (null != AppConfig.LoginedUser.CayMenu) { int v_iRootMenu = 0; DataView v_dv = AppConfig.LoginedUser.CayMenu.DefaultView; v_dv.RowFilter = "URL LIKE '%TabID=" + AppConfig.TabID + "%'"; if (v_dv.Count > 0) { v_iRootMenu = Convert.ToInt32(v_dv[0]["ID"]); v_dv.RowFilter = ""; v_iRootMenu = FindRootMenu(v_iRootMenu); } v_dv.RowFilter = ""; v_dv.RowFilter = "ID_CNANG_CHA IS NULL"; for (int i = 0; i < v_dv.Count; i++) { v_dv.RowFilter = "ID_CNANG_CHA IS NULL"; v_sbMenu.AppendLine("<div class=\"CBoxHeader\" >"); v_sbMenu.AppendLine(" <div class=\"mt5 ml15\" >"); if ((v_dv[i]["URL_ICON"] != DBNull.Value) && (v_dv[i]["URL_ICON"].ToString().Trim().Length > 0)) { v_sbMenu.AppendLine(" <span class=\"" + v_dv[i]["URL_ICON"].ToString() + "\" ></span>"); } if ((v_dv[i]["URL"] != DBNull.Value) && (v_dv[i]["URL"].ToString().Trim().Length > 0)) { v_sbMenu.AppendLine(" <a class=\"menulink\" href=\"" + v_dv[i]["URL"].ToString().Replace("~", "") + "\" >" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[i]["TIEU_DE"].ToString()) + "</a>"); } else { v_sbMenu.AppendLine(" <span class=\"white bold\">" + LanguageEngine.Instance().GetContent(LanguageType.TypeUI, v_dv[i]["TIEU_DE"].ToString()) + "</span>"); } if (v_iRootMenu == Convert.ToInt32(v_dv[i]["ID"])) { v_sbMenu.AppendLine(" <span class=\"icon-arrowup fr\" onclick=\"javascript:togglecontrol(this,'dv" + v_dv[i]["ID"].ToString() + "Content')\" ></span>"); } else { v_sbMenu.AppendLine(" <span class=\"icon-arrowdown fr\" onclick=\"javascript:togglecontrol(this,'dv" + v_dv[i]["ID"].ToString() + "Content')\" ></span>"); } v_sbMenu.AppendLine(" </div>"); v_sbMenu.AppendLine("</div>"); if (v_iRootMenu == Convert.ToInt32(v_dv[i]["ID"])) { v_sbMenu.AppendLine("<div id='dv" + v_dv[i]["ID"].ToString() + "Content' class=\"CBoxContent\" >"); } else { v_sbMenu.AppendLine("<div id='dv" + v_dv[i]["ID"].ToString() + "Content' class=\"CBoxContent\" style=\"display:none\" >"); } v_sbMenu.Append(LoadSubMenu(Convert.ToInt32(v_dv[i]["ID"]), 1)); v_sbMenu.AppendLine("</div>"); v_dv.RowFilter = "ID_CNANG_CHA IS NULL"; } v_dv.RowFilter = ""; } lstMenu.Text = v_sbMenu.ToString(); }
/// <summary> /// Tạo AutocomboBox /// </summary> /// <param name="lstSource">Source cho Combobox</param> /// <param name="comboBox">Tên control Combobox được gen</param> /// <param name="maTruyVan">Mã truy vấn để lấy source cho combobox</param> /// <param name="lstDieuKien">Giá trị các điều kiện tương ứng với truy vấn</param> /// <param name="maChon">Mã Item sẽ được chọn nếu có</param> /// <param name="lstMaKhoangChon">Danh sách các Item sẽ được gen vào Combobox nếu có.</param> public void GenAutoComboBox(ref List <AutoCompleteEntry> lstSource, ref DropDownList comboBox, string maTruyVan, List <string> lstDieuKien = null, string maChon = "Default", List <string> lstMaKhoangChon = null) { Func <AutoCompleteEntry, bool> predicate = null; Func <AutoCompleteEntry, bool> func2 = null; try { if (!string.IsNullOrEmpty(maTruyVan)) { TruyVanProcess process = new TruyVanProcess(); DataSet dataSetSource = new DataSet(); dataSetSource = process.getDanhSachInformation(maTruyVan, lstDieuKien).DataSetSource; foreach (DataRow row in dataSetSource.Tables[0].Rows) { if (row.Table.Columns.Count > 3) { List <string> list = new List <string> { row[1].ToString(), row[0].ToString() }; for (int i = 3; i < dataSetSource.Tables[0].Columns.Count; i++) { list.Add(row[i].ToString()); } lstSource.Add(new AutoCompleteEntry(LanguageEngine.Instance().GetContent(0, row[2].ToString()), list.ToArray())); } else { string content = LanguageEngine.Instance().GetContent(0, row[2].ToString()); if (content == "") { content = LanguageEngine.Instance().GetContent(0, row[1].ToString()); } lstSource.Add(new AutoCompleteEntry(content, new string[] { row[1].ToString(), row[0].ToString() })); } } } if (lstMaKhoangChon != null) { if (predicate == null) { predicate = e => lstMaKhoangChon.Contains(e.KeywordStrings.First <string>()); } lstSource = lstSource.Where <AutoCompleteEntry>(predicate).ToList <AutoCompleteEntry>(); } foreach (AutoCompleteEntry entry in lstSource) { string displayName = entry.DisplayName; string str3 = entry.KeywordStrings[0]; if (displayName == "") { try { displayName = entry.KeywordStrings[2]; } catch { displayName = entry.KeywordStrings[1]; } if (displayName == "") { displayName = entry.KeywordStrings[0]; } str3 = entry.KeywordStrings[0]; } ListItem item = new ListItem(displayName, str3); comboBox.Items.Add(item); } if (!string.IsNullOrEmpty(maChon)) { if (maChon.Equals("Default")) { comboBox.SelectedIndex = 0; } else { if (func2 == null) { func2 = e => e.KeywordStrings.First <string>().Equals(maChon); } comboBox.SelectedIndex = lstSource.IndexOf(lstSource.FirstOrDefault <AutoCompleteEntry>(func2)); } } } catch (Exception exception) { LLogging.WriteLog("", LLogging.LogType.ERR, exception); } }