Ejemplo n.º 1
0
        /// <summary>
        /// Adds a properly formatted <see cref="WildcardToken"/> to the <see cref="WhereParameter"/> value
        /// </summary>
        /// <param name="wItem">The <see cref="WhereParameter"/> that needs the <see cref="WildcardToken"/></param>
        protected void BuildWildcardValue(WhereParameter wItem)
        {
            switch (wItem.Operator)
            {
            case WhereParameter.Operand.StartsWith:
            case WhereParameter.Operand.NotStartsWith:
                wItem.Value = string.Format("{1}{0}", WildcardToken, wItem.Value);
                break;

            case WhereParameter.Operand.EndsWith:
            case WhereParameter.Operand.NotEndsWith:
                wItem.Value = string.Format("{0}{1}", WildcardToken, wItem.Value);
                break;

            case WhereParameter.Operand.Contains:
            case WhereParameter.Operand.NotContains:
                wItem.Value = string.Format("{0}{1}{0}", WildcardToken, wItem.Value);
                break;

            default:
                break;
            }
        }
        public void BetweenClauseWithTearoffs()
        {
            obj.Where.HIREDATE.BetweenBeginValue = "01/01/1999";
            obj.Where.HIREDATE.BetweenEndValue   = "12/31/1999";
            obj.Where.HIREDATE.Operator          = WhereParameter.Operand.Between;

            // Create tearoff
            WhereParameter wp = obj.Where.TearOff.HIREDATE;

            wp.BetweenBeginValue = "01/01/2001";
            wp.BetweenEndValue   = "12/31/2001";
            wp.Operator          = WhereParameter.Operand.Between;

            // Create tearoff
            wp = obj.Where.TearOff.HIREDATE;
            wp.BetweenBeginValue = "01/01/2003";
            wp.BetweenEndValue   = "12/31/2003";
            wp.Operator          = WhereParameter.Operand.Between;

            Assert.IsTrue(obj.Query.Load("OR"));
            Console.WriteLine("BetweenClauseWithTearoffs: {0}", obj.Query.LastQuery);
            Assert.AreEqual(12, obj.RowCount);
        }
Ejemplo n.º 3
0
            public void WhereClauseReset()
            {
                _EmployeeID_W      = null;
                _LastName_W        = null;
                _FirstName_W       = null;
                _Title_W           = null;
                _TitleOfCourtesy_W = null;
                _BirthDate_W       = null;
                _HireDate_W        = null;
                _Address_W         = null;
                _City_W            = null;
                _Region_W          = null;
                _PostalCode_W      = null;
                _Country_W         = null;
                _HomePhone_W       = null;
                _Extension_W       = null;
                _Photo_W           = null;
                _Notes_W           = null;
                _ReportsTo_W       = null;
                _PhotoPath_W       = null;

                this._entity.Query.FlushWhereParameters();
            }
			public void WhereClauseReset()
			{
				_ID_W = null;
				_FullName_W = null;
				_Address_W = null;
				_Mobile_W = null;
				_UserName_W = null;
				_Password_W = null;
				_UserType_W = null;
				_Active_W = null;
				_FirstName_W = null;
				_LastName_W = null;
				_DepartmentID_W = null;
				_JobTitleID_W = null;
				_CreatedByID_W = null;
				_LastLogin_W = null;
				_CreatedDate_W = null;
				_ModifiedDate_W = null;
				_PasswordExpires_W = null;
				_ExpirationDate_W = null;

				this._entity.Query.FlushWhereParameters();

			}
Ejemplo n.º 5
0
            public void WhereClauseReset()
            {
                _Id_W = null;
                _Company_id_W = null;
                _Name_W = null;
                _LastResortTechId_W = null;
                _ConfigDistributedRouting_W = null;
                _TintClassType_W = null;
                _BitRestrictToTechs_W = null;
                _TxtDesc_W = null;
                _BitAllowEmailParsing_W = null;
                _IntPriorityId_W = null;
                _TintLevelOverride_W = null;
                _BtInactive_W = null;
                _ParentId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 6
0
            public void WhereClauseReset()
            {
                PreferredId_W = null;
                _LocationId_W = null;
                _SubstituteId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 7
0
            public void WhereClauseReset()
            {
                _ProductID_W = null;
                _ProductCategoryID_W = null;
                _ProductFileID_W = null;
                _ProductName_W = null;
                _Price_W = null;
                _InitContent_W = null;
                _MainContent_W = null;
                _Status_W = null;
                _Images_W = null;
                _Priority_W = null;
                _ViewCount_W = null;
                _InitContent2_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 8
0
            public void WhereClauseReset()
            {
                _Id_W = null;
                _Login_id_W = null;
                _Company_id_W = null;
                _Location_id_W = null;
                _UserType_Id_W = null;
                _Room_W = null;
                _CheckinStatus_W = null;
                _Notes_W = null;
                _QueEmailAddress_W = null;
                _DtLastLogin_W = null;
                _ConfigHourlyRate_W = null;
                _ConfigPartialSetup_W = null;
                _ConfigEmailNewTicket_W = null;
                _ConfigEmailTicketResponse_W = null;
                _ConfigEmailUserTicketResponse_W = null;
                _ConfigEmailUserNewTicket_W = null;
                _BitAllowQueEmailParsing_W = null;
                _Token_W = null;
                _TintLevel_W = null;
                _SupGroupId_W = null;
                _IntAccountId_W = null;
                _IntAcctLocationId_W = null;
                _BtCfgCCRep_W = null;
                _VchOrganization_W = null;
                _BtGlobalFilterEnabled_W = null;
                _BtLimitToAssignedTkts_W = null;
                _BtDisabledReports_W = null;
                _BtUserInactive_W = null;
                _PrintFontSize_W = null;
                _AccountLocationId_W = null;
                _CreationCatId_W = null;
                _LocationId_W = null;
                _TintTicketTimer_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 9
0
            public void WhereClauseReset()
            {
                _TestimonialID_W = null;
                _ClientName_W = null;
                _ClientInfo_W = null;
                _MainContent_W = null;
                _Status_W = null;
                _Priority_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 10
0
        //*** This is where you consruct Query 2
        void SetupQuery2()
        {
            // This is what we are going for:
            //   The top 5 distinct employees where
            //   (LastNames have "A" anywhere in them
            //   or begin with "P")
            //   and the HireDate is not NULL
            //   (and the BirthDate is between 1/1/1990 and today
            //   or BirthDate is NULL.)
            // In SQL syntax:
            //  SELECT  DISTINCT  TOP 5 [EmployeeID], [LastName], [FirstName], [BirthDate]
            //  FROM [Employees]
            //  WHERE ([LastName] LIKE @LastName1 OR [LastName] LIKE @LastName2 )
            //    OR [HireDate] IS NOT NULL
            //    AND ([BirthDate] BETWEEN @BirthDate4 AND @BirthDate5 OR [BirthDate] IS NULL )
            //  ORDER BY [LastName] ASC, [FirstName] ASC

            // 'LastNames that have "A" anywhere in them
            // or begin with "P".'
            // Use a TearOff to use LastName in 2 Where clauses.
            // Notice:
            //   The conjunction will precede the Where clause.
            //   The wp.Conjuction mis-spelling.
            tmpEnt2.Query.OpenParenthesis();
            tmpEnt2.Where.LastName.Value    = "%A%";
            tmpEnt2.Where.LastName.Operator = WhereParameter.Operand.Like;
            WhereParameter wp = tmpEnt2.Where.TearOff.LastName;

            wp.Value      = "P%";
            wp.Operator   = WhereParameter.Operand.Like;
            wp.Conjuction = WhereParameter.Conj.Or;
            tmpEnt2.Query.CloseParenthesis();

            // 'And the HireDate is not NULL.'
            // The default conjunction is "AND".
            // To change the default conjuction use
            //    tmpEnt2.Query.Load("OR");
            tmpEnt2.Where.HireDate.Operator = WhereParameter.Operand.IsNotNull;

            // 'And the BirthDate is between 1/1/1990 and today
            // or BirthDate is NULL.'
            // We'll need another TearOff for the second use
            // of BirthDate.
            // We need this before OpenParenthesis().
            tmpEnt2.Query.AddConjunction(WhereParameter.Conj.And);

            tmpEnt2.Query.OpenParenthesis();
            tmpEnt2.Where.BirthDate.Operator          = WhereParameter.Operand.Between;
            tmpEnt2.Where.BirthDate.BetweenBeginValue = "1900/01/01 00:00:00";
            tmpEnt2.Where.BirthDate.BetweenEndValue   = DateTime.Today.ToString();
            wp            = tmpEnt2.Where.TearOff.BirthDate;
            wp.Operator   = WhereParameter.Operand.IsNull;
            wp.Conjuction = WhereParameter.Conj.Or;
            tmpEnt2.Query.CloseParenthesis();

            // Only return the EmployeeID, LastName, FirstName, and BirthDate
            // If you have no AddResultColumns,
            // then the query defaults to 'SELECT *'.
            // Once we limit columns, we cannot call Save().
            tmpEnt2.Query.AddResultColumn(Employees.ColumnNames.EmployeeID);
            tmpEnt2.Query.AddResultColumn(Employees.ColumnNames.LastName);
            tmpEnt2.Query.AddResultColumn(Employees.ColumnNames.FirstName);
            tmpEnt2.Query.AddResultColumn(Employees.ColumnNames.BirthDate);

            // Order by LastName, FirstName
            // You can add as many order by columns as you like
            // by repeatedly calling this.
            tmpEnt2.Query.AddOrderBy(Employees.ColumnNames.LastName, WhereParameter.Dir.ASC);
            tmpEnt2.Query.AddOrderBy(Employees.ColumnNames.FirstName, WhereParameter.Dir.ASC);

            // Bring back only distinct rows
            tmpEnt2.Query.Distinct = true;

            // Bring back the top 5 rows
            tmpEnt2.Query.Top = 5;
        }
Ejemplo n.º 11
0
            public void WhereClauseReset()
            {
                _NewsID_W = null;
                _Title_W = null;
                _NewsCategoryID_W = null;
                _Image_W = null;
                _PostedDate_W = null;
                _Status_W = null;
                _Priority_W = null;
                _MainContent_W = null;
                _InitContent_W = null;
                _Image2_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 12
0
            public void WhereClauseReset()
            {
                _ID_W = null;
                _SiteName_W = null;
                _Name_W = null;
                _Content_W = null;
                _Description_W = null;
                _IsActive_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 13
0
            public void WhereClauseReset()
            {
                _MaTB_W = null;
                _ThoiGian_W = null;
                _SoTruyCap_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 14
0
            public void WhereClauseReset()
            {
                _DId_W = null;
                _Id_W = null;
                _TintPriority_W = null;
                _Name_W = null;
                _Description_W = null;
                _SLAPercentage_W = null;
                _SLADays_W = null;
                _SLAHours_W = null;
                _SLAMinutes_W = null;
                _BitDefault_W = null;
                _BtSkipSaturday_W = null;
                _BtSkipSunday_W = null;
                _BtSkipHolidays_W = null;
                _BtUseBusHours_W = null;
                _SLAResponsePercentage_W = null;
                _SLAResponseDays_W = null;
                _SLAResponseHours_W = null;
                _SLAResponseMinutes_W = null;
                _BtResponseSkipSaturday_W = null;
                _BtResponseSkipSunday_W = null;
                _BtResponseSkipHolidays_W = null;
                _BtResponseUseBusHours_W = null;
                _BtRstrctUsr_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 15
0
            public void WhereClauseReset()
            {
                _Id_W = null;
                _DId_W = null;
                _BtInactive_W = null;
                _IntCreated_W = null;
                _DtCreated_W = null;
                _IntUpdatedBy_W = null;
                _DtUpdated_W = null;
                _VchName_W = null;
                _ParentId_W = null;
                _BtResolved_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 16
0
            public void WhereClauseReset()
            {
                _ProductFileID_W = null;
                _FileName_W = null;
                _Url_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 17
0
            public void WhereClauseReset()
            {
                _MailLogId_W = null;
                _LocationId_W = null;
                _SendDate_W = null;
                _MailTo_W = null;
                _MailFrom_W = null;
                _Subject_W = null;
                _Message_W = null;
                _MailType_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 18
0
            public void WhereClauseReset()
            {
                _Id_W = null;
                _DId_W = null;
                _LocationId_W = null;
                _TicketLevel_W = null;
                _TechPoolType_W = null;
                _RoutingMethod_W = null;
                _LastResortTechId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 19
0
            public void WhereClauseReset()
            {
                _TemplateId_W = null;
                _Name_W = null;
                _Header_W = null;
                _Description_W = null;
                _Text_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 20
0
            public void WhereClauseReset()
            {
                _DId_W = null;
                _TintOrder_W = null;
                _TintRoute_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 21
0
            public void WhereClauseReset()
            {
                _LocationId_W = null;
                _Name_W = null;
                _NameShort_W = null;
                _Street_W = null;
                _City_W = null;
                _ZipCode_W = null;
                _PhoneNumOffice_W = null;
                _RegionId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 22
0
            public void WhereClauseReset()
            {
                _SubstituteId_W = null;
                _Active_W = null;
                _AvailabilityTimeStart_W = null;
                _AvailabilityTimeEnd_W = null;
                _AvailabilityWeekDays_W = null;
                _GradeId_W = null;
                _UserId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 23
0
            public void WhereClauseReset()
            {
                _ProductFileUploadID_W = null;
                _ProductFileID_W = null;
                _ProductID_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 24
0
            public void WhereClauseReset()
            {
                _SettingID_W = null;
                _MetaKeyword1_W = null;
                _MetaDescription1_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 25
0
            public void WhereClauseReset()
            {
                TeacherId_W = null;
                _Active_W = null;
                UserProfileId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 26
0
            public void WhereClauseReset()
            {
                _BannerID_W = null;
                _Images_W = null;
                _ImageThumb_W = null;
                _Link_W = null;
                _Title_W = null;
                _InitContent_W = null;
                _Priority_W = null;
                _Status_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 27
0
            public void WhereClauseReset()
            {
                _Id_W = null;
                _Class_id_W = null;
                _LoginCompanyJunc_id_W = null;
                _Locations_id_W = null;
                _LocationId_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 28
0
            public void WhereClauseReset()
            {
                _StaticPageID_W = null;
                _PageCode_W = null;
                _PageName_W = null;
                _MenuName_W = null;
                _Parent_W = null;
                _PageContent_W = null;
                _DateCreated_W = null;
                _Images_W = null;
                _Priority_W = null;
                _Status_W = null;
                _InitContent_W = null;
                _GroupID_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 29
0
            public void WhereClauseReset()
            {
                _StaticPageGroupID_W = null;
                _Description_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 30
0
            public void WhereClauseReset()
            {
                _Company_id_W = null;
                _Company_name_W = null;
                _DtAccountCreated_W = null;
                _DtExpiration_W = null;
                _IntLicensedUsers_W = null;
                _ActiveStatus_W = null;
                _ConfigNewUserWizard_W = null;
                _LogoName_W = null;
                _ConfigClassTracking_W = null;
                _ConfigPartstracking_W = null;
                _ConfigTechCheckin_W = null;
                _ConfigSerialNumber_W = null;
                _SerialNumberName_W = null;
                _ConfigFolders_W = null;
                _ConfigUAQ_W = null;
                _BtCfgSchedTkt_W = null;
                _ConfigChooseTechnician_W = null;
                _ConfigAssetTracking_W = null;
                _ConfigPasswordStorage_W = null;
                _ConfigOnHoldStatus_W = null;
                _ConfigTimeTracking_W = null;
                _ConfigCalenderDate_W = null;
                _ConfigLocationTracking_W = null;
                _ConfigPriorities_W = null;
                _ConfigUserPriorities_W = null;
                _ConfigRoomNumber_W = null;
                _ConfigChooseTechLimitQues_W = null;
                _ConfigCategoryTracking_W = null;
                _LastTicketNumber_W = null;
                _ConfigHourlyRate_W = null;
                _ConfigCustomFields_W = null;
                _DtCancelled_W = null;
                _TktExportdtStart_W = null;
                _TktExportdtEnd_W = null;
                _ConfigMiscCost_W = null;
                _ConfigTrvlCost_W = null;
                _ConfigViewTktCost_W = null;
                _ConfigAllowEmailNewAcct_W = null;
                _ConfigDirectory_W = null;
                _ConfigNTP_W = null;
                _IntLicensedAssets_W = null;
                _ConfigExpectDueDateUser_W = null;
                _TinyBusHourStart_W = null;
                _TinyBusMinStart_W = null;
                _TinyBusHourStop_W = null;
                _TinyBusMinStop_W = null;
                _SintHourOffset_W = null;
                _ConfigUpdtLctnPrfl_W = null;
                _ConfigUCP_W = null;
                _ConfigRCD_W = null;
                _ConfigLVL_W = null;
                _TintRoutingOrder_W = null;
                _BtConfigLVLUser_W = null;
                _TintDateFormat_W = null;
                _IntBWAId_W = null;
                _TintGraceDays_W = null;
                _BtCfgAcctMngr_W = null;
                _BtAcctRtOvr_W = null;
                _TintAcctRtOvrLevel_W = null;
                _TintAcctRtOvrOption_W = null;
                _TintAcctRtOvrRouteType_W = null;
                _IntUTROL_W = null;
                _IntTTROL_W = null;
                _BtReqClosureNote_W = null;
                _BtCfgACDC_W = null;
                _BtCfgRES_W = null;
                _BtCfgCON_W = null;
                _BtCfgAFTE_W = null;
                _BtCfgAECT_W = null;
                _BtCfgEAHA_W = null;
                _CharWDays_W = null;
                _BtCfgSuppressBWALogos_W = null;
                _BtCfgESG_W = null;
                _BtCfgIDM_W = null;
                _BtCfgCCS_W = null;
                _BtCfgESC_W = null;
                _BtCfgEMTE_W = null;
                _BtCfgSBTP_W = null;
                _BtCfgCUSN_W = null;
                _BtCfgACCT_W = null;
                _RemoteAssistanceSessions_W = null;
                _BtCfgRAST_W = null;
                _BtCfgASTT_W = null;
                _PrintFontSize_W = null;
                _BtCfgATCL_W = null;
                _BtCfgCFTO_W = null;
                _CharCurrency_W = null;
                _ReportStartDate_W = null;
                _ReportEndDate_W = null;
                _ReportDateRange_W = null;
                _CreationCatId_W = null;
                _TintTicketTimer_W = null;
                _BtCfgTEDO_W = null;
                _BtCfgTROL_W = null;
                _BtCfgMSAL_W = null;
                _CompanyStatus_W = null;
                _BWAAccountId_W = null;
                _BWADepartmentId_W = null;
                _BtGeneralLdap_W = null;
                _BtLdap_W = null;
                _LdapLocalURL_W = null;
                _BtCfgLimTechAsts_W = null;
                _BtCfgNRAdmin_W = null;
                _BtGlobalSSL_W = null;
                _BtGlobalLDAP_W = null;
                _BtCfgDTTCOT_W = null;
                _Company_guid_W = null;
                _DefaultDistanceRate_W = null;
                _BtCfgAllowSelectAnyLocation_W = null;
                _BtAllowSUserToChooseAnyLogin_W = null;
                _BtAllowSUserToChooseAnyLocation_W = null;
                _BtDisallowTechsToCreateLocations_W = null;
                _BtMailHyperLinksStatus_W = null;
                _EmailSuffixes_W = null;
                _BtCfgFLCN_W = null;
                _BtCfgATTU_W = null;
                _BtDisplayAddUserLink_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 31
0
            public void WhereClauseReset()
            {
                GradeId_W = null;
                _Name_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 32
0
            public void WhereClauseReset()
            {
                _UserProfileId_W = null;
                _UserId_W = null;
                _Phone_W = null;
                _Email_W = null;
                _Address_W = null;
                _Address2_W = null;
                _APPENDAGE_W = null;
                _BirthDate_W = null;
                _JobPosition_W = null;
                _JobAssignmentDescription_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 33
0
            public void WhereClauseReset()
            {
                _ID_W = null;
                _CompanyID_W = null;
                _DLOrganizationID_W = null;
                _DLDepartmentID_W = null;
                _Enabled_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 34
0
            public void WhereClauseReset()
            {
                _UserID_W = null;
                _Username_W = null;
                _Password_W = null;
                _Email_W = null;
                _Status_W = null;
                _RoleID_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 35
0
            public void WhereClauseReset()
            {
                _AdvTypeID_W = null;
                _Description_W = null;

                this._entity.Query.FlushWhereParameters();
            }
Ejemplo n.º 36
0
            public void WhereClauseReset()
            {
                _ID_W = null;

                this._entity.Query.FlushWhereParameters();
            }