public static void InitChonKhachHang(PLCombobox PLKhachhang) { QueryBuilder query = null; query = new QueryBuilder("SELECT distinct TEN_KHACH_HANG, KH_ID FROM KHACH_HANG where 1=1"); DataSet ds = DABase.getDatabase().LoadDataSet(query); PLKhachhang._init(ds.Tables[0], "TEN_KHACH_HANG", "KH_ID"); }
public static void InitChonChuyenMuc(PLCombobox PLChuyenMuc,bool? IsAdd) { QueryBuilder query = null; query = new QueryBuilder("SELECT * FROM CHUYEN_MUC where 1=1 " + (IsAdd == true ? " AND VISIBLE_BIT='Y'" : "") + " and 1=1"); DataSet ds = HelpDB.getDatabase().LoadDataSet(query); PLChuyenMuc._init(ds.Tables[0], "NAME", "ID"); }
public static void ChonDoiTuong(PLCombobox Input) { DataSet ds; ds = DABase.getDatabase().LoadDataSet( "select id, caption from fw_obj where visible_bit='Y'"); Input._init(ds.Tables[0], "CAPTION", "ID"); }
public static void ChonPhieu(PLCombobox Input, long obj_id) { DataSet ds; ds = DABase.getDatabase().LoadDataSet("select fp.id, fp.caption from fw_phieu fp " + "inner join fw_obj_phieu fo on (fp.id=fo.phieu_id) " + "where obj_id='" + obj_id + "'"); Input._init(ds.Tables[0], "CAPTION", "ID"); }
public static void ChonLoaiCongViec(PLCombobox input) { string sql = "select NAME, ID from DM_LOAI_CONG_VIECN where VISIBLE_BIT = 'Y'"; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource = ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._init(); }
public static void InitChonChuyenMuc(PLCombobox PLChuyenMuc, long ID_Dien_Dan) { QueryBuilder query = null; query = new QueryBuilder("SELECT * FROM CHUYEN_MUC where 1=1"); query.addCondition("VISIBLE_BIT='Y'"); query.addID("ID_NHOM_DIEN_DAN", ID_Dien_Dan); DataSet ds = DienDanPermission.I._LoadDataSetWithResPermission(query, "ID"); PLChuyenMuc._init(ds.Tables[0], "NAME", "ID"); }
public void InitCtrl(PLCombobox Input, bool? IsAdd, bool ReadOnly) { DataSet ds = new DataSet(); DataTable dt = I(); ds.Tables.Add(dt); Input._init(ds.Tables[0], "NAME", "ID"); if (ReadOnly) Input._lookUpEdit.Properties.TextEditStyle = TextEditStyles.DisableTextEditor; }
public static void ChonLoaiDuAn(PLCombobox input) { string sql = "select * from DM_LOAI_DU_AN where VISIBLE_BIT='Y'"; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource=ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._setSelectedID(-1); input._init(); }
public static void ChonNhanVien(PLCombobox input) { string sql = "Select NV.* from DM_NHAN_VIEN NV inner join USER_CAT US on nv.id=us.employee_id"; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource = ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._setSelectedID(-1); input._init(); }
//PHUOCNC : Tại sao có 2 cái phân biệt thế này. public static void ChonNhanVienRPT(PLCombobox input) { string sql = "select * from DM_NHAN_VIEN"; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource = ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._setSelectedID(-1); input._init(); }
public void InitCtrl(PLCombobox Input, bool? IsAdd) { string sql; if (IsAdd == true) sql = "SELECT ID,NAME FROM DM_LOAI_VAN_DE WHERE VISIBLE_BIT='Y' ORDER BY NAME"; else sql = "SELECT ID,NAME FROM DM_LOAI_VAN_DE ORDER BY NAME"; DataSet dsNV = HelpDB.getDatabase().LoadDataSet(sql); Input._init(dsNV.Tables[0], "NAME", "ID"); }
public static void loadcongviec(PLCombobox input,long id) { string sql = "select * from cong_viec where loai_du_an="+id; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource = ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._setSelectedID(-1); input._init(); }
public static void _initVAT(PLCombobox Input) { DataSet ds = new DataSet(); DataTable dt = FWControlData.VAL_VAT(); ds.Tables.Add(dt); Input.DataSource = ds.Tables[0]; ; Input.DisplayField = "VAT"; Input.ValueField = "VAT"; Input._init(); }
public void InitCtrl(PLCombobox Input, bool? IsAdd) { QueryBuilder query = null; if (IsAdd == true) query = new QueryBuilder("SELECT * FROM DM_VAN_DE_GOP_Y where VISIBLE_BIT = 'Y' AND 1=1"); else query = new QueryBuilder("SELECT * FROM DM_VAN_DE_GOP_Y where 1=1"); query.setAscOrderBy("NAME"); DataSet ds = HelpDB.getDatabase().LoadDataSet(query); Input._init(ds.Tables[0], "NAME", "ID"); }
public static void ChonNhomTin(PLCombobox Input, bool? IsAdd) { DataSet dsNTT; //true:add, false:edit, null:xem QueryBuilder query=new QueryBuilder("select ID,NAME from DM_NHOM_TIN_TUC WHERE 1=1"); if (IsAdd == true) query.addCondition("VISIBLE_BIT='Y'"); query.setAscOrderBy("NAME"); dsNTT = TinTucPermission.I._LoadDataSetWithResGroupPermission(query, "ID"); Input._init(dsNTT.Tables[0], "NAME", "ID"); }
/// <summary> /// Lấy DataSource cho Tuyến. /// </summary> /// <param name="Input">The input.</param> /// <param name="IsAdd">The is add.</param> public static void ChonTuyen(PLCombobox Input, bool? IsAdd) { DataSet dt; if (IsAdd != null && IsAdd == true) { dt = DABase.getDatabase().LoadDataSet("select * from DM_TUYEN where VISIBLE_BIT='Y'", "DM_TUYEN"); } else { dt = DABase.getDatabase().LoadTable("DM_TUYEN"); } Input._init(dt.Tables[0], "NAME", "ID"); }
public static void InitCtrl(PLCombobox Input, bool? IsAdd) { string sql = string.Format(@"SELECT * From {0} where 1=1", TABLE_MAP); QueryBuilder query = new QueryBuilder(sql); if (IsAdd == true) query.addCondition("VISIBLE_BIT='Y'"); query.setAscOrderBy("lower(NAME)"); DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP); Input.DataSource = ds.Tables[0]; Input.DisplayField = "NAME"; Input.ValueField = "ID"; Input._init(); }
public static void InitCtrl(PLCombobox Input, bool? IsAdd) { string sql = string.Format(@"SELECT * From {0} where 1=1", TABLE_MAP); QueryBuilder query = new QueryBuilder(sql); if (IsAdd == true) { query.addID("CONG_TY", FrameworkParams.LoginCompanyID); query.addCondition("VISIBLE_BIT='Y'"); } query.setAscOrderBy("lower(NAME)"); DataSet ds = HelpDB.getDatabase().LoadDataSet(query,TABLE_MAP); Input.MainCtrl.Properties.SortColumnIndex = -1; Input.DataSource = AppUtil.SortLogicalTable(ds.Tables[0], "NAME"); Input.DisplayField = "NAME"; Input.ValueField = "ID"; Input._init(); }
public static void InitChonDienDan(PLCombobox PLDien_Dan, bool? IsAdd) { QueryBuilder query = null; string sql = ""; if (DienDanPermission.I.IsPermission) { string ndds = DienDanPermission.I._getPermissionResGroupStrIDs(PermissionOfResource.RES_PERMISSION_TYPE.READ); if (ndds == "") ndds = "-1"; string ncms = DienDanPermission.I._getPermissionResStrIDs(PermissionOfResource.RES_PERMISSION_TYPE.READ); if (ncms == "") ncms = "-1"; sql = @"select * from nhom_dien_dan ndd where (ndd.id in (" + ndds + @") or ndd.id in (select cm.id_nhom_dien_dan from chuyen_muc cm where cm.id in(" + ncms + "))) " + (IsAdd == true ? " AND VISIBLE_BIT='Y'" : "") + " and ID<>ID_ROOT and 1=1 "; } else { sql = "SELECT * FROM NHOM_DIEN_DAN where ID_CHA<>0 " + (IsAdd == true ? " AND VISIBLE_BIT='Y'" : "") + " and 1=1"; } DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); PLDien_Dan._init(ds.Tables[0], "NAME", "ID"); }
public void InitCtrl(PLCombobox Input, bool ReadOnly, bool? IsAdd) { DataSet dt; if (IsAdd != null && IsAdd == true) { dt = DABase.getDatabase().LoadDataSet("select * from DM_NHAN_VIEN where VISIBLE_BIT='Y' Order by lower(NAME)", "DM_NHAN_VIEN"); } else { dt = DABase.getDatabase().LoadTable("DM_NHAN_VIEN"); } Input.DataSource = dt.Tables[0]; Input.DisplayField = "NAME"; Input.ValueField = "ID"; Input._init(); }
public static void InitCtrl(PLCombobox combo) { combo._init(TABLE_MAP, "NAME", "ID"); }
public static void loadduan(PLCombobox input) { string sql = "select * from DU_AN"; DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); input.DataSource = ds.Tables[0]; input.DisplayField = "name"; input.ValueField = "ID"; input._setSelectedID(-1); input._init(); }
public static void ChonMucdo_cv(PLCombobox PLMucuutien) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); dt.Columns.Add("ID", Type.GetType("System.Int32")); dt.Columns.Add("NAME"); dt.Rows.Add(new object[] { 0, "Cao nhất" }); dt.Rows.Add(new object[] { 1, "Cao" }); dt.Rows.Add(new object[] { 2, "Trung bình" }); dt.Rows.Add(new object[] { 3, "Thấp" }); dt.Rows.Add(new object[] { 4, "Thấp nhất" }); ds.Tables.Add(dt); PLMucuutien._init(dt, "NAME", "ID"); }
public static void ChonTinhTrang_Cbx(PLCombobox Input, bool? IsAdd) { bool IsVisible = false; if (IsAdd == true) IsVisible = true; QueryBuilder query = null; if (IsVisible) query = new QueryBuilder("SELECT * FROM DM_TINH_TRANG where VISIBLE_BIT = 'Y' AND 1=1"); else query = new QueryBuilder("SELECT * FROM DM_TINH_TRANG where 1=1"); query.setAscOrderBy("lower(NAME)"); DataSet ds = HelpDB.getDatabase().LoadReadOnlyDataSet(query); Input._init(ds.Tables[0], "NAME", "ID"); }
public static void ChonNhanvien_Cbx(PLCombobox Input, bool? IsAdd) { bool IsVisible = false; if (IsAdd != null && IsAdd == true) IsVisible = true; QueryBuilder query = null; if (IsVisible) query = new QueryBuilder("select * from DM_NHAN_VIEN where VISIBLE_BIT = 'Y' AND 1=1"); else query = new QueryBuilder("SELECT * FROM DM_NHAN_VIEN where 1=1"); query.setAscOrderBy("lower(MA_NV)"); DataSet ds = HelpDB.getDatabase().LoadReadOnlyDataSet(query); Input._init(ds.Tables[0], "NAME", "ID"); }
public static void InitCtrlKenhPhat(PLCombobox input) { string sql = string.Format(@"select * from {0} dth where exists(select first 1 1 from {1} ct where ct.{2}=dth.id) order by name", DMDaiTruyenHinh.TABLE_MAP, TNS_PROGRAMS_GRID_SCR_CT.TABLE_NAME, TNS_PROGRAMS_GRID_SCR_CT.KENH_PHAT); DataSet ds = HelpDB.getDatabase().LoadDataSet(sql, DMDaiTruyenHinh.TABLE_MAP); input.DataSource = ds.Tables[0]; input.DisplayField = "NAME"; input.ValueField = "ID"; input._init(); }
public static void InitCtrlBudgetPlanState(PLCombobox input) { var dt = new DataTable(); dt.Columns.Add("ID", typeof(Int64)); dt.Columns.Add("NAME"); var ds = new DataSet(); ds.Tables.Add(dt); dt.Rows.Add(BudgetPlanStatus.GENERAL, "Tổng quát"); dt.Rows.Add(BudgetPlanStatus.DETAIL, "Chi tiết"); dt.Rows.Add(BudgetPlanStatus.COMPLETE, "Hoàn thành"); input.ValueField = "ID"; input.DisplayField = "NAME"; input.DataSource = dt; input.MainCtrl.Properties.SortColumnIndex = -1; input._init(); dt.Rows.RemoveAt(0); }
private void ChonNgoaiTe(PLCombobox Input, bool? IsAdd) { string str=""; if(IsAdd!=true) str= "select * from GET_TI_GIA_NGOAI_TE"; // goi store procedure else str = "select * from GET_TI_GIA_NGOAI_TE where visible_bit='Y'"; DataSet ds = DABase.getDatabase().LoadDataSet(str); Input.DataSource = ds.Tables[0]; Input.DisplayField = "NAME"; Input.ValueField = "ID"; Input._init(); }
/// <summary> /// Lấy danh sách tất cả các câu truy vấn đã lưu /// </summary> /// <param name="Input"></param> public static void InitCombobox(PLCombobox Input, FilterCase filter) { DataSet ds = new DataSet(); DatabaseFB db = DABase.getDatabase(); System.Data.Common.DbCommand cmd = db.GetSQLStringCommand("select * from FW_QUERY_STORE where USERID = @USERID and DATASETID = @DATASETID"); db.AddInParameter(cmd, "@USERID", DbType.Int64, filter.USERID); db.AddInParameter(cmd, "@DATASETID", DbType.String, filter.DATASETID); db.LoadDataSet(cmd, ds, "FW_QUERY_STORE"); if (ds.Tables.Count == 0 || (ds.Tables.Count == 1 && ds.Tables[0] == null)) PLException.AddException(new Exception("Thiếu bảng FW_QUERY_STORE")); //Tùy chọn nguồn dữ liệu Input.DataSource = ds.Tables[0]; //Giá trị hiển thị khi chọn Input.DisplayField = "TITLE"; //Giá trị nhận được khi lấy giá trị Input.ValueField = "ID"; Input._init(); }
public void InitKeNgangTang(PLCombobox combo, string control) { control = control.ToUpper(); string sql = string.Format(@"SELECT DISTINCT iif({0} is not null,{0},-2) ID, iif({0} is not null,{0}, '<Rỗng>') NAME FROM CHUONG_TRINH_POST_MASTER WHERE IS_DELETE ='N' OR IS_DELETE IS NULL", control); DataSet ds = HelpDB.getDatabase().LoadDataSet(sql); combo.DataSource = ds.Tables[0]; combo.DisplayField = "NAME"; combo.ValueField = "ID"; combo._init(); combo.MainCtrl.Properties.SortColumnIndex = -1; combo._setSelectedID(-1); }