当前位置: 首页>>代码示例>>C#>>正文


C# QueryBuilder.addDuyet方法代码示例

本文整理汇总了C#中QueryBuilder.addDuyet方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.addDuyet方法的具体用法?C# QueryBuilder.addDuyet怎么用?C# QueryBuilder.addDuyet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryBuilder的用法示例。


在下文中一共展示了QueryBuilder.addDuyet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     DataSet ds;
     if (!checkTin_noi_bat.Checked)
     {
         QueryBuilder query = new QueryBuilder
         (
             " SELECT ID,PRIOR,TT.NHOM_TIN,TIEU_DE, NGAY_CAP_NHAT,TT.NGUOI_CAP_NHAT,NHOM_TIN,DUYET," +
             " CASE WHEN PRIOR='Y' THEN 'Tin tức nổi bật' ELSE NULL END TIN_NOI_BAT" +
             " FROM TIN_TUC TT WHERE 1=1"
         );
         query.addID("NHOM_TIN", PLNhomTT._getSelectedID());
         query.addDateFromTo("NGAY_CAP_NHAT", dateTungay.DateTime, dateDenngay.DateTime);
         query.setDescOrderBy("NGAY_CAP_NHAT");
         if (DATinTuc.Instance.getNguoiDuyet(DATinTuc.quyenDuyet).Contains(FrameworkParams.currentUser.employee_id))
             query.addDuyet(PLDBUtil.FIELD_DUYET, DuyetSelect.layTrangThai());
         else
             query.addCondition(string.Format("{0} = 2 or NGUOI_CAP_NHAT = {1}", PLDBUtil.FIELD_DUYET, FrameworkParams.currentUser.employee_id));
         ds = DABase.getDatabase().LoadDataSet(query);
         barSubItem1.Enabled = ds.Tables[0].Rows.Count > 0;
         gridControlMaster.DataSource = ds.Tables[0];
         HookFocusRow();
     }
     else
     {
         ds = DATinTuc.Instance.Get_5_tin(PLNhomTT._getSelectedID(), dateTungay.DateTime, dateDenngay.DateTime,DuyetSelect);
         barSubItem1.Enabled = ds.Tables[0].Rows.Count > 0;
         gridControlMaster.DataSource = ds.Tables[0];
         HookFocusRow();
     }
     if (ds.Tables[0].Rows.Count == 0)
     {
         this.ThongTinNoiBat(null, null);
         barButtonItemDuyet.Enabled = false;
         barButtonItemK_Duyet.Enabled = false;
     }
     return null;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:38,代码来源:frmNewsPaperQL.cs

示例2: barbtTimKiem_ItemClick

 private void barbtTimKiem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     GUIValidation.TrimAllData(new object[] { txtTenTaiLieu });
     string str = @"SELECT * FROM DM_TAI_LIEU Where 1=1";
     QueryBuilder query = new QueryBuilder(str);
     query.addDuyet(PLDBUtil.FIELD_DUYET, DuyetSelect.layTrangThai());
     query.addLike("upper(TEN_TAI_LIEU)", txtTenTaiLieu.Text.ToUpper());
     if (node_ID != 1)
         query.addID("LOAI_TAI_LIEU_ID", node_ID);
     DataSet ds = DABase.getDatabase().LoadDataSet(query);
     gridDSCongviec.DataSource = ds.Tables[0];
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:12,代码来源:frmDocumentQL.cs

示例3: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     FWWaitingMsg msg = new FWWaitingMsg();
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addID("NV_ID", NhanVien._getSelectedID());
     filter.addDateFromTo("NGAY_LAM_VIEC", ngayLamViec.FromDate, ngayLamViec.ToDate);
     filter.addDuyet(PLConst.FIELD_DUYET, DuyetSelect.layTrangThai());
     filter.addIn("LOAI_XAC_NHAN", this.getLoaiXacNhan());
     msg.Finish();
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:11,代码来源:frmPhieuXacNhanLamViecQL.cs

示例4: PLBuildQueryFilter

        public override QueryBuilder PLBuildQueryFilter()
        {
            FWWaitingMsg msg = new FWWaitingMsg();
            DataSet ds = new DataSet();
            long nhom_tin = PLNhomTT._getSelectedID();
            Feature fQuanTri = Permission.loadFeature(AppPermission.FQuanTriTinTuc.id
                , AppPermission.FQuanTriTinTuc.featureName, FrameworkParams.currentUser.username);
            if (!checkTin_noi_bat.Checked)
            {
                //Lấy tin nổi bật đã được duyệt.

                QueryBuilder query = new QueryBuilder
                    (
                        @" SELECT ID,PRIOR,NHOM_TIN,TIEU_DE, NGAY_CAP_NHAT,NGUOI_CAP_NHAT,DUYET, CASE WHEN SO_NGAY_HIEU_LUC > 0 THEN DATEADD(DAY,SO_NGAY_HIEU_LUC,NGAY_CAP_NHAT) ELSE NULL END AS NGAY_HIEU_LUC,
                     CASE WHEN PRIOR='Y' THEN 'Tin tức nổi bật' ELSE NULL END TIN_NOI_BAT
                     FROM TIN_TUC  WHERE PRIOR = 'Y' AND DUYET = '2' AND 1=1"
                    );
                query.addDateFromTo("NGAY_CAP_NHAT", ngay.FromDate, ngay.ToDate);
                if (fQuanTri.isRead)//(DATinTuc.Instance.getNguoiDuyet(DATinTuc.quyenDuyet).Contains(FrameworkParams.currentUser.employee_id))
                    query.addDuyet(PLConst.FIELD_DUYET, DuyetSelect.layTrangThai());
                else
                    query.addCondition(string.Format("1=1 or NGUOI_CAP_NHAT = {0}", FrameworkParams.currentUser.employee_id));
                query.addCondition("NHOM_TIN IN (SELECT ID FROM DM_NHOM_TIN_TUC WHERE VISIBLE_BIT ='Y')");
                ds = TinTucPermission.I._LoadDataSetWithResGroupPermission(query, "NHOM_TIN", nhom_tin);

                //Lấy tin mới nhất đã được duyệt.
                QueryBuilder query1 = new QueryBuilder
                    (
                        @" SELECT ID,PRIOR,NHOM_TIN,TIEU_DE, NGAY_CAP_NHAT,NGUOI_CAP_NHAT,DUYET,CASE WHEN SO_NGAY_HIEU_LUC > 0 THEN DATEADD(DAY,SO_NGAY_HIEU_LUC,NGAY_CAP_NHAT) ELSE NULL END AS NGAY_HIEU_LUC,
                     CASE WHEN PRIOR='Y' THEN 'Tin tức nổi bật' ELSE NULL END TIN_NOI_BAT
                     FROM TIN_TUC  WHERE PRIOR = 'N' AND DUYET = '2'
                     AND NGAY_CAP_NHAT = (SELECT MAX(NGAY_CAP_NHAT)
                                            FROM TIN_TUC
                                            WHERE PRIOR = 'N' AND DUYET = '2')
                     AND 1=1"
                    );
                query1.addDateFromTo("NGAY_CAP_NHAT", ngay.FromDate, ngay.ToDate);
                query1.addCondition("NHOM_TIN IN (SELECT ID FROM DM_NHOM_TIN_TUC WHERE VISIBLE_BIT ='Y')");
                if (fQuanTri.isRead)//(DATinTuc.Instance.getNguoiDuyet(DATinTuc.quyenDuyet).Contains(FrameworkParams.currentUser.employee_id))
                    query1.addDuyet(PLConst.FIELD_DUYET, DuyetSelect.layTrangThai());
                else
                    query1.addCondition(string.Format("1=1 or NGUOI_CAP_NHAT = {0}", FrameworkParams.currentUser.employee_id));
                DataTable dtTT_Max = TinTucPermission.I._LoadDataSetWithResGroupPermission(query1, "NHOM_TIN", nhom_tin).Tables[0];

                //Lấy các tin còn lại
                QueryBuilder query2 = new QueryBuilder
                    (
                        @" SELECT ID,PRIOR,NHOM_TIN,TIEU_DE, NGAY_CAP_NHAT,NGUOI_CAP_NHAT,DUYET,CASE WHEN SO_NGAY_HIEU_LUC > 0 THEN DATEADD(DAY,SO_NGAY_HIEU_LUC,NGAY_CAP_NHAT) ELSE NULL END AS NGAY_HIEU_LUC,
                     CASE WHEN PRIOR='Y' THEN 'Tin tức nổi bật' ELSE NULL END TIN_NOI_BAT
                     FROM TIN_TUC  WHERE NGAY_CAP_NHAT <> (SELECT MAX(NGAY_CAP_NHAT)
                                            FROM TIN_TUC
                                            WHERE PRIOR = 'N' AND DUYET = '2')
                     AND 1=1"
                    );
                query2.addDateFromTo("NGAY_CAP_NHAT", ngay.FromDate, ngay.ToDate);
                query2.addCondition("NHOM_TIN IN (SELECT ID FROM DM_NHOM_TIN_TUC WHERE VISIBLE_BIT ='Y')");
                query2.setDescOrderBy("NGAY_CAP_NHAT");
                if (ds.Tables[0].Rows.Count > 0)
                    query2.addCondition(string.Format("ID != '{0}'", ds.Tables[0].Rows[0]["ID"].ToString()));
                if (fQuanTri.isRead)//(DATinTuc.Instance.getNguoiDuyet(DATinTuc.quyenDuyet).Contains(FrameworkParams.currentUser.employee_id))
                    query2.addDuyet(PLConst.FIELD_DUYET, DuyetSelect.layTrangThai());
                else
                    query2.addCondition(string.Format("{0}='2' or NGUOI_CAP_NHAT = {1}", PLConst.FIELD_DUYET, FrameworkParams.currentUser.employee_id));

                DataTable dtTT = TinTucPermission.I._LoadDataSetWithResGroupPermission(query2, "NHOM_TIN", nhom_tin).Tables[0];
                foreach (DataRow row in dtTT_Max.Rows) ds.Tables[0].ImportRow(row);
                foreach (DataRow row in dtTT.Rows) ds.Tables[0].ImportRow(row);
                gridControlMaster.DataSource = ds.Tables[0];
                barSubItem1.Enabled = ds.Tables[0].Rows.Count > 0;
                HookFocusRow();
            }
            else
            {
                ds = DATinTuc.Instance.Get_5_tin(PLNhomTT._getSelectedID(), ngay.FromDate, ngay.ToDate, DuyetSelect);
                barSubItem1.Enabled = ds.Tables[0].Rows.Count > 0;
                gridControlMaster.DataSource = ds.Tables[0];
                barSubItem1.Enabled = ds.Tables[0].Rows.Count > 0;
                HookFocusRow();
            }
            if (ds.Tables[0].Rows.Count == 0)
            {
                this.ThongTinNoiBat(null);
                barButtonItemDuyet.Enabled = false;
                barButtonItemK_Duyet.Enabled = false;
            }
            msg.Finish();
            return null;
        }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:88,代码来源:frmNewsPaperQL.cs

示例5: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     QueryBuilder filter = null;
     string sql = @"select ctccv_id,(select name from dm_loai_cong_viecn lcv where lcv.id=ctcv.lcv_id) TEN_CV,
     nv.ten_nv NHANVIEN,
     ctcv.ngay_lam_viec,ctcv.ngay_cap_nhat,ctcv.lcv_id,ctcv.nv_id,ctcv.mo_ta,ctcv.thoi_gian_thuc_hien,ctcv.duyet
     from chi_tiet_cong_viec ctcv inner join dm_nhan_vien nv on nv.id=ctcv.nv_id
     where nv.visible_bit='Y' and  1=1";
     filter = new QueryBuilder(sql);
     filter.addID("LCV_ID", Loai_Cv._getSelectedID());
     filter.addID("NV_ID", Nhan_vien._getSelectedID());
     filter.addDateFromTo("NGAY_LAM_VIEC", TuNgay.DateTime, DenNgay.DateTime);
     filter.addDuyet("DUYET", DuyetSelect.layTrangThai());
     filter.addGroupBy("ctccv_id,lcv_id,nv.ten_nv,ngay_lam_viec,ngay_cap_nhat,nv_id,mo_ta,thoi_gian_thuc_hien,duyet");
     filter.setDescOrderBy("NGAY_LAM_VIEC");
     DataSet ds = DABase.getDatabase().LoadDataSet(filter);
     gridControlMaster.DataSource = ds.Tables[0];
     return null;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:19,代码来源:frmTimeRecordQL.cs

示例6: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     FWWaitingMsg msg = new FWWaitingMsg();
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addCondition(PhieuTamUngFields.THANG_TAM_UNG + GetStringThangTamUng(dateThangNam,dateThangNamDen));
     filter.addID(PhieuTamUngFields.NGUOI_DE_NGHI_ID, NhanVien._getSelectedID());
     filter.addDuyet(PhieuTamUngFields.DUYET, DuyetSelect.layTrangThai());
     filter.addCondition(" 1=1 ");
     msg.Finish();
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:11,代码来源:frmPhieuTamUngQL.cs

示例7: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addID("NLV.NV_ID", PLNhanVien._getSelectedID());
     filter.addCondition("NLV.LOAI=" + (Int32)TimeInOutType.NghiPhep);
     filter.addDateFromTo("NLV.NGAY_LAM_VIEC", TuNgay.DateTime, DenNgay.DateTime);
     filter.setDescOrderBy("NLV.NGAY_LAM_VIEC");
     filter.setAscOrderBy("NV.TEN_NV");
     filter.addDuyet(PLDBUtil.FIELD_DUYET, DuyetSelect.layTrangThai());
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:11,代码来源:frmNghiPhepQL.cs

示例8: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     FWWaitingMsg msg = new FWWaitingMsg();
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addID("NLV.NV_ID", NhanVien._getSelectedID());
     filter.addCondition("NLV.LOAI=" + (Int32)TimeInOutType.NghiPhep);
     if (ngayLamViec.Types != SelectionTypes.None)
         filter.addDateFromTo("NLV.NGAY_LAM_VIEC", ngayLamViec.FromDate, ngayLamViec.ToDate);
     filter.setDescOrderBy("NLV.NGAY_LAM_VIEC");
     filter.setAscOrderBy("NAME");
     filter.addDuyet(PLConst.FIELD_DUYET, DuyetSelect.layTrangThai());
     StringBuilder str = new StringBuilder();
     if (chkNghi_KLuong.Checked && checkNghi_Nam.Checked)
         filter.addCondition("NGHI_KHONG_LUONG = 'Y' OR NGHI_PHEP_NAM ='Y'");
     else
     {
         if (chkNghi_KLuong.Checked) filter.addBoolean("NGHI_KHONG_LUONG", true);
         if (checkNghi_Nam.Checked) filter.addBoolean("NGHI_PHEP_NAM", true);
     }
     DataSet ds = HelpDB.getDatabase().LoadDataSet(filter);
     //ds.Tables[0].Columns.Add("IS_NGHI_BUOI_SANG",typeof(Int32));
     if (ds == null || ds.Tables[0].Rows.Count == 0) barButtonItemDuyet.Enabled = barButtonItemK_Duyet.Enabled = false;
     else
     {
         barButtonItemDuyet.Enabled = barButtonItemK_Duyet.Enabled = true;
     }
     msg.Finish();
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:29,代码来源:frmNghiPhepQL.cs


注:本文中的QueryBuilder.addDuyet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。