本文整理汇总了C#中QueryBuilder.addCondition方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.addCondition方法的具体用法?C# QueryBuilder.addCondition怎么用?C# QueryBuilder.addCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.addCondition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PLBuildQueryFilter
public override QueryBuilder PLBuildQueryFilter()
{
QueryBuilder filter = new QueryBuilder(BIEN_MUC.FILTER_STRING);
filter.addSoPhieu(BIEN_MUC.MA_BANG, MaBang.Text);
filter.addLike("LOWER(" + BIEN_MUC.NOI_DUNG + ")", NoiDung.Text.ToLower());
AppCtrl.addID(filter, BIEN_MUC.SO_DKCB_HD, SoDKHDCB);
AppCtrl.addID(filter, BIEN_MUC.TIET_MUC, TietMuc);
AppCtrl.addID(filter, BIEN_MUC.LOAI_LUU_TRU, LoaiBang);
AppCtrl.addID(filter, BIEN_MUC.DON_VI_CUNG_CAP, DonViCungCap);
AppCtrl.addID(filter, BIEN_MUC.DON_VI_SO_HUU, DonViSoHuu);
filter.addIn(BIEN_MUC.POST_MASTER, AppCtrl.GetCheckedValues(TinhTrang, true));
filter.addIn(BIEN_MUC.IS_THANH_LY, AppCtrl.GetCheckedValues(ThanhLy, true));
AppCtrl.addFilterFromTo(filter, BIEN_MUC.NGAY_NHAP, ngayNhap);
AppCtrl.addFilterFromTo(filter, BIEN_MUC.NAM_SAN_XUAT, NamSXTu.Value, NamSXDen.Value);
long[] IDs = QuocGia._getSelectedIDs();
if (IDs.Length > 0 && IDs.Length < QuocGia.Properties.GetItems().Count)
{
string cond = "(";
foreach (long id in IDs)
{
cond += BIEN_MUC.NUOC_SAN_XUAT + " like '%," + id + ",%' or ";
}
cond = cond.TrimEnd(' ', 'r', 'o');
cond = cond += ")";
filter.addCondition(cond);
}
filter.addCondition("1=1");
filter.setDescOrderBy(BIEN_MUC.NGAY_CAP_NHAT);
return filter;
}
示例2: LoadSchema
public static DataTable LoadSchema()
{
QueryBuilder query = new QueryBuilder(
"select * from fw_tham_so_ung_dung where 1=1");
query.addCondition("1=-1");
return DABase.getDatabase().LoadReadOnlyDataSet(query).Tables[0];
}
示例3: InitChonChuyenMuc
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");
}
示例4: ChonNhomTin
public static void ChonNhomTin(PLImgCombobox 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");
}
示例5: PLBuildQueryFilter
public override QueryBuilder PLBuildQueryFilter()
{
QueryBuilder filter = null;
string sql = UpdateRow();
filter = new QueryBuilder(sql);
filter.addCondition("1=1");
if (this.ASCSortClause != "")
filter.setAscOrderBy(ASCSortClause);
if (this.DESCSortClause != "")
filter.setDescOrderBy(DESCSortClause);
return filter;
}
示例6: InitCot
public static RepositoryItemLookUpEdit InitCot(GridColumn column, string fieldName, 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);
return HelpGridColumn.CotCombobox(column, ds, "ID", "NAME", fieldName);
}
示例7: GetDataSet
public static DataSet GetDataSet(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);
return ds;
}
示例8: GetUsingLoaiGhiChu
public static DataTable GetUsingLoaiGhiChu()
{
string sql = string.Format(@"SELECT NAME,ID
From {0}
where exists(select first 1 1 from chuong_trinh_ghi_chu where loai_ghi_chu=id) and 1=1", TABLE_MAP);
var query = new QueryBuilder(sql);
query.addCondition("VISIBLE_BIT='Y'");
query.setAscOrderBy("ID");
DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0];
return null;
}
示例9: getStatusChot
public bool getStatusChot(string BangLuong)
{
QueryBuilder query = new QueryBuilder("select is_chot from bang_luong where 1=1");
query.addCondition("thang_nam='" + BangLuong + "'");
DatabaseFB fb = HelpDB.getDatabase();
DataSet ds = new DataSet();
fb.LoadDataSet(ds,query, "BANG_LUONG");
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["IS_CHOT"].ToString() == "Y")
return true;
}
return false;
}
示例10: InitCtrl
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();
}
示例11: GetUsingDTH
public static DataTable GetUsingDTH(bool? isAdd)
{
string sql = string.Format(@"SELECT NAME,id
From {0}
where (exists(select first 1 1 from chuong_trinh_npdt where dai_truyen_hinh=id)
or exists(select first 1 1 from chuong_trinh_psk where dai_truyen_hinh=id)) and
1=1", TABLE_MAP);
var query = new QueryBuilder(sql);
if (isAdd == true)
query.addCondition("VISIBLE_BIT='Y'");
query.setAscOrderBy("ID");
DataSet ds = HelpDB.getDatabase().LoadDataSet(query, TABLE_MAP);
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0];
return null;
}
示例12: CreateDataset
public void CreateDataset(long perForCurrentFormID, params long[] idNguoiNhan)
{
InitColumn(false);
QueryBuilder query = new QueryBuilder(@"SELECT * FROM DM_NHAN_VIEN WHERE 1=1");
query.addCondition("(DEPARTMENT_ID IS NOT NULL )");
query.addBoolean("VISIBLE_BIT", true);
dsSource = HelpDB.getDatabase().LoadDataSet(query);
dsSource.Tables[0].Columns.Add("CHON", typeof(System.String));
foreach (DataRow row in dsSource.Tables[0].Rows)
{
row["CHON"] = "N";
}
this.gridControlNguoiTheoDoi.DataSource = _SetDefault(dsSource.Tables[0], perForCurrentFormID, idNguoiNhan);
HelpGridExt1.DisableCaptionGroupCol(this.gridViewNguoiTheoDoi);
this.gridViewNguoiTheoDoi.BestFitColumns();
this.gridViewNguoiTheoDoi.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.None;
}
示例13: GetAddressList
public static AddressList GetAddressList(long[] Keys)
{
QueryBuilder query = new QueryBuilder(@"SELECT e.ID, e.NAME, cat.USERID as ID, cat.USERNAME, e.EMAIL FROM USER_CAT cat left join DM_NHAN_VIEN e on e.ID=cat.EMPLOYEE_ID WHERE 1=1");
query.addBoolean("e.VISIBLE_BIT", true);
query.addCondition("(EMAIL<>'')");
if (Keys.Length > 0)
query.addID("e.ID", Keys);
DataSet dsTo = HelpDB.getDatabase().LoadDataSet(query, "CAT");
AddressList to = new AddressList();
foreach (DataRow row in dsTo.Tables[0].Rows)
{
if (!to.ToAddressListString().Contains(row["EMAIL"].ToString()))
to.Add(new MailboxAddress(row["NAME"].ToString(), row["EMAIL"].ToString()));
}
return to;
}
示例14: InitCtrl
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();
}
示例15: btnView_Click
private void btnView_Click(object sender, EventArgs e)
{
var sql =string.Format(@"SELECT PGS_ID,NAME,
TU_NGAY, DEN_NGAY, MA_PGS,IS_DELETE,FILE_NAME, NGUOI_TAO,
NGAY_TAO, NGUOI_CAP_NHAT, NGAY_CAP_NHAT,CONG_TY,
PHONG_BAN,GHI_CHU,NULL CONTENT_FILE,'' PATH_FILE
FROM TNS_PROGRAMS_GRID_SCR pgs
WHERE (is_delete='N' or is_delete is null) and 1=1");
var query = new QueryBuilder(sql);
query.addLike("LOWER(" + TNS_PROGRAMS_GRID_SCR.NAME + ")", TenNguon.Text.ToLower());
query.addLike("LOWER(" + TNS_PROGRAMS_GRID_SCR.FILE_NAME + ")", TenFile.Text.ToLower());
AppCtrl.addID(query, TNS_PROGRAMS_GRID_SCR.NGUOI_TAO, NguoiLap);
AppCtrl.addFilterFromTo(query, TNS_PROGRAMS_GRID_SCR.NGAY_TAO, NgayLap);
query.addDateFromTo(TNS_PROGRAMS_GRID_SCR.TU_NGAY, StartDateFrom.DateTime, StartDateTo.DateTime);
query.addDateFromTo(TNS_PROGRAMS_GRID_SCR.DEN_NGAY, EndDateFrom.DateTime, EndDateTo.DateTime);
query.addCondition("1=1");
query.setDescOrderBy("NGAY_TAO");
var ds = HelpDB.getDBService().LoadDataSet(query);
if(ds!=null&&ds.Tables.Count>0)
{
gridControlDetail.DataSource = ds.Tables[0];
}
}