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


C# QueryBuilder.setDescOrderBy方法代码示例

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


在下文中一共展示了QueryBuilder.setDescOrderBy方法的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;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:31,代码来源:frmBienMucTimPopupBanded.cs

示例2: 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;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:13,代码来源:frmBienMucTimPopupBandedBudget.cs

示例3: 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];
     }
 }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:23,代码来源:frmTNSProgramGrid.cs

示例4: PLBuildQueryFilter

        public override QueryBuilder PLBuildQueryFilter()
        {
            QueryBuilder filter = null;
            string sql = UpdateRow();
            filter = new QueryBuilder(sql);
            filter.addSoPhieu("CT." + CHUONG_TRINH.MA_CT, MaCT.Text);
            filter.addLike("LOWER(CT." + CHUONG_TRINH.NOI_DUNG + ")", NoiDung.Text.ToLower());
            filter.addLike("LOWER(CT." + CHUONG_TRINH.TEN_GOC + ")", TenGoc.Text.ToLower());
            filter.addLike("LOWER(CT." + CHUONG_TRINH.CATEGORY + ")", Category.Text.ToLower());
            AppCtrl.addID(filter, "CT." + CHUONG_TRINH.TIET_MUC, TietMuc);
            AppCtrl.addID(filter, "CT." + CHUONG_TRINH.NUOC_SAN_XUAT, NuocSX);
            AppCtrl.addFilterFromTo(filter, "PM." + CHUONG_TRINH_POST_MASTER.NGAY_NHAP, ngayNhap);
            AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.PHONG_BAN, PhongBan);
            AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.NGUOI_NHAP, NguoiNhap);
            AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.POST_MASTER_ID, PostMaster);
            AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.LOAI_LUU_TRU, LoaiLuuTru);

            filter.addCondition("1=1");
            if (this.ASCSortClause != "")
                filter.setAscOrderBy(ASCSortClause);
            if (this.DESCSortClause != "")
                filter.setDescOrderBy(DESCSortClause);
            return filter;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:24,代码来源:frmChuongTrinhTimPopupBanded.cs

示例5: PLBuildQueryFilter

        public override QueryBuilder PLBuildQueryFilter()
        {
            QueryBuilder filter = new QueryBuilder(UpdateRow());
            filter.addLike("LOWER(" + KE_HOACH_LPS.MA_KHLPS + ")", MaKeHoach.Text.ToLower());
            filter.addLike("LOWER(" + KE_HOACH_LPS.TEN_KE_HOACH + ")", TenKeHoach.Text.ToLower());
            AppCtrl.addID(filter, KE_HOACH_LPS.NGUOI_LAP, NguoiLap);
            AppCtrl.addID(filter, KE_HOACH_LPS.KENH_PHAT, kenhPhat);
            AppCtrl.addFilterFromTo(filter, KE_HOACH_LPS.NGAY_LAP, NgayLap);
            AppCtrl.addID(filter, CHUONG_TRINH.PHONG_BAN, PhongBan);

            filter.addCondition("1=1");
            filter.setDescOrderBy(this.DESCSortClause);
            return filter;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:14,代码来源:frmKeHoachLPSQL.cs

示例6: 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

示例7: SetNext

        public void SetNext()
        {
            //LockControls = false;
            string idT = GetIDsThu();
            _doLichPhatSong = DALichPhatSongNew.I.LoadAll(-2);

            _rootLichPhatSong = null;
            _isAdd = true;
            btnCreateDetail.Text = "Tạo chi tiết LPS  >>";

            var qr = new QueryBuilder(@"select first 1 ngay_phat_song from ql_lich_phat_song_ct lpsct
                 inner join ql_lich_phat_song lps on lps.lps_id=lpsct.lps_id
                where extract(weekday from ngay_phat_song) in(" + idT + ") and 1=1");
            qr.add(QL_LICH_PHAT_SONG_CT.NGAY_PHAT_SONG, Operator.GreaterEqual, NgayPhatCuoi.DateTime, DbType.DateTime);
            qr.addID("lps." + QL_LICH_PHAT_SONG.KENH_PHAT, KenhPhat._getSelectedID());
            qr.add(string.Format("extract(hour from {0})", "LPS." + QL_LICH_PHAT_SONG.GIO_PHAT_SONG), Operator.Equal, GioPhat.Time.Hour, DbType.Int32);
            qr.add(string.Format("extract(minute from {0})", "LPS." + QL_LICH_PHAT_SONG.GIO_PHAT_SONG), Operator.Equal, GioPhat.Time.Minute, DbType.Int32);
            qr.setDescOrderBy(QL_LICH_PHAT_SONG_CT.NGAY_PHAT_SONG);
            var ds = HelpDB.getDatabase().LoadDataSet(qr);
            var thus = AppCtrl.GetThuTrongTuan(ThuTrongTuan._getSelectedIDs());
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                NgayBatDau.DateTime = AppCtrl.GetNextDate((DateTime)ds.Tables[0].Rows[0][0], thus);
            }

            else
                NgayBatDau.DateTime = AppCtrl.GetNextDate(NgayPhatCuoi.DateTime, thus);

            _replaceType = ReplaceType.NONE;
            NgayPhatCuoi.EditValue = null;
            SoNgayPhat.EditValue = null;
            GhiChu.Text = "";
            NoiDung._setSelectedID(-1);
            TenGoc.Text = "";
            Category.Text = "";
            TongTapPhat.EditValue = null;
            TongTapCT.EditValue = null;
            NuocSX._setSelectedIDs(new long[] { -1 });
            NamSX.EditValue = null;
            TietMuc._setSelectedID(-1);
            PostMaster._setSelectedID(-1);
            ThoiLuong.Text = "";
            // LockControls = false;
            _dsDetail.Clear();
            gridControlDetail.DataSource = _dsDetail.Tables[0];
            btnNext.Enabled = false;
            btnDelete.Enabled = false;
            btnCopy.Enabled = false;
            Title.Text = "TẠO MỚI LỊCH PHÁT SÓNG";
            ColStart.Visible = false;

            NgayBatDau.Properties.ReadOnly = false;
            KenhPhat.MainCtrl.Properties.ReadOnly = false;
            ThuTrongTuan.Properties.ReadOnly = false;
            GioPhat.Properties.ReadOnly = false;

            _error.ClearErrors();
            groupBox1.Visible = false;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:59,代码来源:frmLichPhatSonNew.cs

示例8: PLBuildQueryFilter

 /// <summary>Step 5: Xây dựng Query Buider cho việc tìm kiếm
 /// Xây dựng một QueryBuilder từ những chọn lựa trong phần filter.
 /// Từ QueryBuilder này ta có thể lấy được dữ liệu thỏa điều kiện.
 /// Nếu hỗ trợ duyệt thì trong câu truy vấn trả về 
 /// phải có cột là DUYET_BIT
 /// </summary>
 public override QueryBuilder PLBuildQueryFilter()
 {
     QueryBuilder query =  new QueryBuilder(UpdateRow());
     query.addSoPhieu("LOWER(" + BANG_GIA_BUDGET.MA_BGBG + ")", MaKeHoach.Text.ToLower());
     AppCtrl.addID(query, BANG_GIA_BUDGET.NGUOI_LAP, NguoiLap);
     AppCtrl.addFilterFromTo(query, BANG_GIA_BUDGET.NGAY_LAP, NgayLap);
     AppCtrl.addID(query, BANG_GIA_BUDGET.NGUOI_CAP_NHAT, NguoiXoa);
     AppCtrl.addFilterFromTo(query, BANG_GIA_BUDGET.NGAY_CAP_NHAT,NgayXoa);
     query.addCondition("1=1");
     query.setDescOrderBy(this.DESCSortClause);
     return query;
 }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:18,代码来源:frmBangGiaBudgetDeletedQL.cs

示例9: PLBuildQueryFilter

        /// <summary>Step 5: Xây dựng Query Buider cho việc tìm kiếm
        /// Xây dựng một QueryBuilder từ những chọn lựa trong phần filter.
        /// Từ QueryBuilder này ta có thể lấy được dữ liệu thỏa điều kiện.
        /// Nếu hỗ trợ duyệt thì trong câu truy vấn trả về 
        /// phải có cột là DUYET_BIT
        /// </summary>
        public override QueryBuilder PLBuildQueryFilter()
        {
            error.ClearErrors();
            gridViewMaster.ClearGrouping();
            if (TruongCap1.Text != string.Empty)
            {
                gridViewMaster.Columns[(int)TruongCap1._getSelectedID()].Group();
                gridViewMaster.Columns[(int)TruongCap1._getSelectedID()].Visible = false;
            }

            if (TruongCap2.Text != string.Empty)
            {
                if (TruongCap2.Text != TruongCap1.Text)
                {
                    gridViewMaster.Columns[(int)TruongCap2._getSelectedID()].Group();
                    gridViewMaster.Columns[(int)TruongCap2._getSelectedID()].Visible = false;
                }
                else TruongCap2.SetError(error, "Trường thống kê này đã được sử dụng!");
            }
            if (TruongCap3.Text != string.Empty)
            {
                if (TruongCap3.Text != TruongCap1.Text && TruongCap3.Text != TruongCap2.Text)
                {
                    gridViewMaster.Columns[(int)TruongCap3._getSelectedID()].Group();
                    gridViewMaster.Columns[(int)TruongCap3._getSelectedID()].Visible = false;
                }
                else TruongCap3.SetError(error, "Trường thống kê này đã được sử dụng!");
            }

            QueryBuilder filter = new QueryBuilder(UpdateRow());
            filter.addSoPhieu(BIEN_MUC.MA_BANG, MaBang.Text);
            filter.addLike("LOWER(" + BIEN_MUC.NOI_DUNG + ")", NoiDung.Text.ToLower());
            filter.addID(BIEN_MUC.SO_DKCB_HD, SoDKHDCB._getSelectedIDs());
            filter.addID(BIEN_MUC.TIET_MUC, TietMuc._getSelectedIDs());
            filter.addID(BIEN_MUC.LOAI_LUU_TRU, LoaiBang._getSelectedIDs());
            filter.addIn(BIEN_MUC.POST_MASTER, AppCtrl.GetCheckedValues(TinhTrang, true));
            filter.addID(BIEN_MUC.DON_VI_CUNG_CAP, DonViCungCap._getSelectedIDs());
            filter.addID(BIEN_MUC.DON_VI_SO_HUU, DonViSoHuu._getSelectedIDs());
            filter.addDateFromTo(BIEN_MUC.NGAY_NHAP, ngayNhap.FromDate, ngayNhap.ToDate);
            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 " + BIEN_MUC.NUOC_SAN_XUAT + " like '" + id + ",%' or " + 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;
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:61,代码来源:frmTKTongHopTrenThuocTinh.cs

示例10: PLBuildQueryFilter

        public override QueryBuilder PLBuildQueryFilter()
        {
            FWWaitingMsg msg = new FWWaitingMsg();
            if (dtRecipient == null) dtRecipient = HelpDB.getDatabase().LoadDataSet("SELECT ID,NAME FROM DM_NHAN_VIEN").Tables[0];
            QueryBuilder query = new QueryBuilder(UpdateRow());

            StringBuilder cond = new StringBuilder("");
            if (cmbNguoiYC._getSelectedID() != -1) cond.Append(string.Format("YC.NGUOI_GUI_ID = {0}", cmbNguoiYC._getSelectedID()));
            long[] arrNguoiNhan = cmbNguoiNhan._SelectedIDs;
            if (arrNguoiNhan.Length > 0 && cond.Length > 0) cond.Append(" OR ");
            int temp = arrNguoiNhan.Length;
            foreach (long id in arrNguoiNhan)
            {
                cond.Append(string.Format(@"(YC.NGUOI_NHAN_ID LIKE '{0}%')
                        OR (YC.NGUOI_NHAN_ID LIKE '%,{0},%') OR (YC.NGUOI_NHAN_ID LIKE '%,{0}')
                        OR (YCTL.NGUOI_NHAN_ID LIKE '{0}%')
                        OR (YCTL.NGUOI_NHAN_ID LIKE '%,{0},%') OR (YCTL.NGUOI_NHAN_ID LIKE '%,{0}')", id));
                temp--;
                if (temp > 0)
                {
                    cond.Append(" OR ");
                }
            }
            if (cond.Length > 0)
            {
                query.addCondition(cond.ToString());
            }
            if (mruEditYeuCau.Text.Trim() != "" && mruEditYeuCau.Text.Trim() != null)
            {
                query.addCondition(string.Format("CHU_DE = '{0}'", mruEditYeuCau.Text.Trim()));
            }
            if (PLMucuutien._getSelectedID() != -1)
                query.add("MUC_UU_TIEN", Operator.Equal,PLMucuutien._getSelectedID() , DbType.Int32);
            if (PLTinhtrang._getSelectedID() != -1)
                query.add("TINH_TRANG", Operator.Equal, PLTinhtrang._getSelectedID(), DbType.Int32);

            query.addDateFromTo("YC.NGAY_GUI", ngayLamViec.FromDate, ngayLamViec.ToDate);
            query.setDescOrderBy("YC.NGAY_GUI");
            DataSet ds = HelpDB.getDatabase().LoadDataSet(query);
            foreach (DataRow  row in ds.Tables[0].Rows)
                row["NGUOI_NHAN"] = GetNameOfRecipient(row["NGUOI_NHAN_ID"].ToString());
            gridControlMaster.DataSource = ds.Tables[0];
            msg.Finish();
            return null;
        }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:45,代码来源:frmQLHoTro.cs

示例11: 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

示例12: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     PLOptions.ReSetData();
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addID("NLV.NV_ID", PLNhanVien._getSelectedID());
     if (this.getISChamCong().Length == 3)
         filter.addCondition("(IS_CHAM_CONG in ('Y','N','') or IS_CHAM_CONG is null )");
     else
         filter.addIn("IS_CHAM_CONG", this.getISChamCong());
     StringBuilder s_condition = new StringBuilder("");
     if (chkDi_tre.Checked)
         s_condition.Append("GIO_BAT_DAU>='" + PLOptions.GIO_DI_TRE.TimeOfDay.ToString() + "'");
     if (chkVe_som.Checked && chkDi_tre.Checked)
         s_condition.Append("OR GIO_KET_THUC<CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + PLOptions.GIO_NGHI_TRUA.TimeOfDay.ToString() + "' ELSE '" + PLOptions.GIO_VE_SOM.TimeOfDay.ToString() + "' END");
     else if (chkVe_som.Checked)
         s_condition.Append("GIO_KET_THUC<CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + PLOptions.GIO_NGHI_TRUA.TimeOfDay.ToString() + "' ELSE '" + PLOptions.GIO_VE_SOM.TimeOfDay.ToString() + "' END");
     if (s_condition.Length > 0)
         filter.addCondition(s_condition.ToString());
     filter.addDateFromTo("NLV.NGAY_LAM_VIEC", TuNgay.DateTime, DenNgay.DateTime);
     filter.setDescOrderBy("NLV.NGAY_LAM_VIEC");
     filter.setAscOrderBy("NV.TEN_NV");
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:23,代码来源:frmTimeInOutQL.cs

示例13: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     AppCtrl.DisplayTheoTuyBienCot(gridViewMaster, repositoryItemCheckedCotHienThi);
     //if (repositoryItemCheckedCotHienThi.GetCheckedItems().ToString() != string.Empty)
     //{
     //    if (colKenhPhat.Visible) colKenhPhat.Group();
     //    if (colNgay.Visible) colNgay.Group();
     //    if (colTietMuc.Visible) colTietMuc.Group();
     //}
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     AppCtrl.addID(filter,LichPhatSong.KENH_PHAT,kenhPhat);
     AppCtrl.addFilterFromTo(filter,LichPhatSong.NGAY_PHAT_SONG, ngayNhap);
     filter.setDescOrderBy(LichPhatSong.NGAY_PHAT_SONG);
     filter.setAscOrderBy(LichPhatSong.GIO_PHAT_SONG);
     filter.addCondition("1=1");
     return filter;
 }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:17,代码来源:frmLibXemLichPhatSongQL.cs

示例14: PLBuildQueryFilter

 public override QueryBuilder PLBuildQueryFilter()
 {
     FWWaitingMsg msg = new FWWaitingMsg();
     QueryBuilder filter = new QueryBuilder(UpdateRow());
     filter.addID("NLV.NV_ID", NhanVien._getSelectedID());
     if (this.getISChamCong().Length == 3)
         filter.addCondition("(IS_CHAM_CONG in ('Y','N','') or IS_CHAM_CONG is null )");
     else
         filter.addIn("IS_CHAM_CONG", this.getISChamCong());
     if (chkBinhThuong.Checked ==  true &&
         chkDi_tre.Checked == true && chkVe_som.Checked == true) goto Nhan;
     StringBuilder s_condition = new StringBuilder("");
     if (chkDi_tre.Checked)
         s_condition.Append("GIO_BAT_DAU>='" + AppGetSysParam.GetGIO_BAT_DAU_SANG.ToString() + "'");
     if (chkVe_som.Checked && chkDi_tre.Checked)
         s_condition.Append(" OR GIO_KET_THUC<CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + AppGetSysParam.GetGIO_KET_THUC_SANG.ToString() + "' ELSE '" + ((DateTime)frmAppParamsHelp.GetThamSo("GIO_KET_THUC_CHIEU")).TimeOfDay.ToString() + "' END");
     else if (chkVe_som.Checked)
         s_condition.Append("GIO_KET_THUC<CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + AppGetSysParam.GetGIO_KET_THUC_SANG.ToString() + "' ELSE '" + ((DateTime)frmAppParamsHelp.GetThamSo("GIO_KET_THUC_CHIEU")).TimeOfDay.ToString() + "' END");
     if (s_condition.Length > 0)
     {
         if (chkBinhThuong.Checked)
             s_condition.Append(" OR (GIO_BAT_DAU<'" + AppGetSysParam.GetGIO_BAT_DAU_SANG.ToString() + "' AND GIO_KET_THUC >=CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + AppGetSysParam.GetGIO_KET_THUC_SANG.ToString() + "' ELSE '" + ((DateTime)frmAppParamsHelp.GetThamSo("GIO_KET_THUC_CHIEU")).TimeOfDay.ToString() + "'END)");
     }
     else {
         if (chkBinhThuong.Checked)
             s_condition.Append("(GIO_BAT_DAU<'" + AppGetSysParam.GetGIO_BAT_DAU_SANG.ToString() + "' AND GIO_KET_THUC >=CASE WHEN EXTRACT(WEEKDAY FROM NLV.NGAY_LAM_VIEC)=6 THEN '" + AppGetSysParam.GetGIO_KET_THUC_SANG.ToString() + "' ELSE '" + ((DateTime)frmAppParamsHelp.GetThamSo("GIO_KET_THUC_CHIEU")).TimeOfDay.ToString() + "' END)");
     }
     filter.addCondition(s_condition.ToString());
     //if (this.chkDi_tre.Checked || chkVe_som.Checked)
         //filter.addID("LOAI", 1);
     Nhan:
     if (ngayLamViec.Types != SelectionTypes.None)
         filter.addDateFromTo("NLV.NGAY_LAM_VIEC", ngayLamViec.FromDate, ngayLamViec.ToDate);
     filter.setDescOrderBy("NLV.NGAY_LAM_VIEC");
     filter.setAscOrderBy("NAME");
     msg.Finish();
     return filter;
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:38,代码来源:frmTimeInOutQL.cs

示例15: PLBuildQueryFilter

        /// <summary>Step 5: Xây dựng Query Buider cho việc tìm kiếm
        /// Xây dựng một QueryBuilder từ những chọn lựa trong phần filter.
        /// Từ QueryBuilder này ta có thể lấy được dữ liệu thỏa điều kiện.
        /// Nếu hỗ trợ duyệt thì trong câu truy vấn trả về 
        /// phải có cột là DUYET_BIT
        /// </summary>
        public override QueryBuilder PLBuildQueryFilter()
        {
            if (isAdvance)
            {
                try
                {

                    //if (filterControl1.FilterString != "")
                    //    filterControl1.FilterCriteria = PrepairFilter(filterControl1.FilterCriteria);
                    FilterControlHelper fch = new FirebirdFilterToSQLStatement(filterControl1);
                    SQLDATA sqlData = fch.GetSQLFilter(true, true);
                    DataSet ds = null;
                    if (sqlData.Filters != "")
                    {

                        ds = filterCase.DataSetFilterFromDatabase(sqlData, "category, noi_dung");
                    }
                    else
                    {
                        QueryBuilder query = new QueryBuilder(UpdateRow());
                        query.addCondition("1=1");
                        if (this.ASCSortClause != "")
                            query.setAscOrderBy(ASCSortClause);
                        if (this.DESCSortClause != "")
                            query.setDescOrderBy(DESCSortClause);
                        ds = HelpDB.getDatabase().LoadDataSet(query);
                    }
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        gridControlMaster.DataSource = ds.Tables[0];
                        // filterControl1.FilterColumns.Remove(filterControl1.FilterColumns[BIEN_MUC.NGAY_PHAT_DAU_TIEN]);
                        //filterControl1.FilterColumns.Remove(filterControl1.FilterColumns[BIEN_MUC.THOI_HAN_BAN_QUYEN_DISPLAY]);

                    }
                }
                catch
                {

                }
                return null;

            }
            else
            {
                QueryBuilder filter = null;
                string sql = UpdateRow();
                filter = new QueryBuilder(sql);
                filter.addSoPhieu("CT." + CHUONG_TRINH.MA_CT, MaCT.Text);
                filter.addLike("LOWER(CT." + CHUONG_TRINH.NOI_DUNG + ")", NoiDung.Text.ToLower());
                AppCtrl.addID(filter, "CT." + CHUONG_TRINH.TIET_MUC, TietMuc);
                AppCtrl.addFilterFromTo(filter, "PM." + CHUONG_TRINH_POST_MASTER.NGAY_NHAP, ngayNhap);
                AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.PHONG_BAN, PhongBan);
                AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.NGUOI_NHAP, NguoiNhap);
                AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.POST_MASTER_ID, PostMaster);
                AppCtrl.addID(filter, "PM." + CHUONG_TRINH_POST_MASTER.LOAI_LUU_TRU, LoaiLuuTru);
                if (!SoDKCBHD._IsNotCheckAnyOrCheckedAll)
                {
                    filter.addCondition("exists(select chd.ctpm_hd_id from chuong_trinh_post_Master_hd chd where chd.ctpm_id=pm.ctpm_id and chd.so_dkcb_hd in " + SoDKCBHD._getStrSelectedIDs() + ")");
                }

                string w2 = "";
                if (TapSoTu.Value > 0)
                {
                    w2 += " AND bm.tap_so >= " + TapSoTu.Value;
                }
                if (TapSoDen.Value > 0)
                {
                    w2 += " AND bm.tap_so <=" + TapSoDen.Value;
                }

                if (TenTap.Text.Trim() != "")
                {
                    w2 += " AND lower(bm.ten_tap) like '%" + TenTap.Text.Trim().ToLower() + "%'";
                }

                if (w2 != "")
                {
                    filter.addCondition(string.Format("exists(select bm.bm_id from bien_muc bm where (is_delete='N' or is_delete is null) and bm.ctpm_id=pm.ctpm_id {0})", w2));
                }
                filter.addCondition("1=1");
                if (this.ASCSortClause != "")
                    filter.setAscOrderBy(ASCSortClause);
                if (this.DESCSortClause != "")
                    filter.setDescOrderBy(DESCSortClause);
                return filter;
            }
        }
开发者ID:khanhdtn,项目名称:did-vlib-2011,代码行数:93,代码来源:frmPostMasterSearchQL.cs


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