private ICriteria GetOpenOppCrit(IRepository<IOpportunity> oRep, IExpressionFactory ep, string currentUserId) { ICriteria countCrit = ((IQueryable)oRep).CreateCriteria(); countCrit.Add(ep.Eq("Status", "Open")); countCrit.Add(ep.Eq("AccountManager.Id", currentUserId)); return countCrit; }
public StatementFactory(IExpressionFactory expressionFactory) { _expressionFactory = expressionFactory; _statementMap = new Dictionary<Type, Func<CodeStatement, CodeGeneratorOptions, IStatement>>(); ConstructStatementsMap(); System.Diagnostics.Debug.WriteLine("StatementFactory Created"); }
public TypescriptAssignStatement( IExpressionFactory expressionFactory, CodeAssignStatement codeAssignStatement, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _codeAssignStatement = codeAssignStatement; _options = options; }
/// <summary> /// Initialises instance /// </summary> public RegularExpressionBuilder(ISavedExpressionsData data, IExpressionFactory expressionFactory, ISaveExpressionMessageWindowFactory saveExpressionMessageWindowFactory, IStringPatternMatching stringPatternMatching) { InitializeComponent(); this.Data = data; ExpressionFactory = expressionFactory; this.SaveExpressionMessageWindowFactory = saveExpressionMessageWindowFactory; this.StringPatternMatching = stringPatternMatching; }
public TypescriptThrowExceptionStatement( IExpressionFactory expressionFactory, CodeThrowExceptionStatement statement, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public TypescriptCommentStatement( IExpressionFactory expressionFactory, CodeCommentStatement statement, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public MvcTalesModel(IEvaluatorSelector evaluatorRegistry, NamedObjectWrapper options = null, IExpressionFactory expressionCreator = null, object model = null) : base(evaluatorRegistry, options, expressionCreator, model) { }
public TypescriptMethodInvokeExpression( IExpressionFactory expressionFactory, CodeMethodInvokeExpression codeExpression, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _codeExpression = codeExpression; _options = options; System.Diagnostics.Debug.WriteLine("TypescriptMethodInvokeExpression Created"); }
public TypescriptIndexerExpression( IExpressionFactory expressionFactory, CodeIndexerExpression codeExpression, CodeGeneratorOptions options) { _codeExpression = codeExpression; _options = options; _expressionFactory = expressionFactory; System.Diagnostics.Debug.WriteLine("TypescriptIndexerExpression Created"); }
public TypescriptPropertyReferenceExpression( IExpressionFactory expressionFactory, CodePropertyReferenceExpression codeExpression, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _codeExpression = codeExpression; _options = options; System.Diagnostics.Debug.WriteLine("TypescriptPropertyReferenceExpression Created"); }
public static string GetParametersFromExpressions(this CodeExpressionCollection codeExpressions, IExpressionFactory expressionFactory, CodeGeneratorOptions options) { var parametersFromExpressions = codeExpressions .OfType<CodeExpression>() .Select(parameter => { var parameterExpression = expressionFactory.GetExpression(parameter, options); return parameterExpression.Evaluate(); }).ToList(); return string.Join(", ", parametersFromExpressions); }
public TypescriptMemberField( IExpressionFactory expressionFactory, ITypescriptTypeMapper typescriptTypeMapper, CodeMemberField member, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _typescriptTypeMapper = typescriptTypeMapper; _member = member; _options = options; }
public TypescriptGotoStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeGotoStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public TypescriptConstructor( IExpressionFactory expressionFactory, IStatementFactory statementFactory, CodeConstructor member, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statementFactory = statementFactory; _member = member; _options = options; }
public MvcTalesModel(IModel parent, IModel root, IEvaluatorSelector evaluatorRegistry, IExpressionFactory expressionCreator = null, object model = null) : base(parent, root, evaluatorRegistry, expressionCreator, model) { }
public TypescriptTryCatchFinallyStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeTryCatchFinallyStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; _typescriptTypeMapper = new TypescriptTypeMapper(); }
public TypescriptVariableDeclarationStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeVariableDeclarationStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; _typescriptTypeMapper = new TypescriptTypeMapper(); }
public TypescriptObjectCreateExpression( IExpressionFactory expressionFactory, CodeObjectCreateExpression codeExpression, CodeGeneratorOptions options, ITypescriptTypeMapper typescriptTypeMapper) { _expressionFactory = expressionFactory; _codeExpression = codeExpression; _options = options; _typescriptTypeMapper = typescriptTypeMapper; System.Diagnostics.Debug.WriteLine("TypescriptObjectCreateExpression Created"); }
public TypescriptMemberProperty( CodeMemberProperty member, IStatementFactory statementFactory, IExpressionFactory expressionFactory, ITypescriptTypeMapper typescriptTypeMapper, CodeGeneratorOptions options) { _member = member; _statementFactory = statementFactory; _expressionFactory = expressionFactory; _typescriptTypeMapper = typescriptTypeMapper; _options = options; }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.Tales.TalesModel"/> class. /// </summary> /// <param name="evaluatorRegistry">Evaluator registry.</param> /// <param name="options">Options.</param> /// <param name="expressionCreator">The expression factory to use.</param> /// <param name="modelObject">An object to which the ZPT document is to be applied.</param> public TalesModel(IEvaluatorSelector evaluatorRegistry, NamedObjectWrapper options = null, IExpressionFactory expressionCreator = null, object modelObject = null) : base(options, modelObject) { if(evaluatorRegistry == null) { throw new ArgumentNullException(nameof(evaluatorRegistry)); } _registry = evaluatorRegistry; _expressionCreator = expressionCreator?? new ExpressionFactory(); }
public TypescriptMemberMethod( IExpressionFactory expressionFactory, IStatementFactory statementFactory, ITypescriptTypeMapper typescriptTypeMapper, ITypescriptTypeParameter typescriptTypeParameter, CodeMemberMethod member, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statementFactory = statementFactory; _typescriptTypeMapper = typescriptTypeMapper; _typescriptTypeParameter = typescriptTypeParameter; _member = member; _options = options; }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.Tales.TalesModel"/> class. /// </summary> /// <param name="parent">The parent model.</param> /// <param name="root">The root model.</param> /// <param name="evaluatorRegistry">The expression evaluator registry.</param> /// <param name="expressionCreator">The expression factory to use.</param> /// <param name="modelObject">An object to which the ZPT document is to be applied.</param> public TalesModel(IModel parent, IModel root, IEvaluatorSelector evaluatorRegistry, IExpressionFactory expressionCreator = null, object modelObject = null) : base(parent, root, modelObject) { if(evaluatorRegistry == null) { throw new ArgumentNullException(nameof(evaluatorRegistry)); } _registry = evaluatorRegistry; _expressionCreator = expressionCreator?? new ExpressionFactory(); }
public TypescriptCodeGenerator( IMemberFactory memberFactory, IStatementFactory statementFactory, IExpressionFactory expressionFactory, ITypescriptNamespace typescriptNamespace, ITypescriptTypeMapper typescriptTypeMapper, ITypescriptKeywordsHandler typescriptKeywordsHandler) { _memberFactory = memberFactory; _typescriptKeywordsHandler = typescriptKeywordsHandler; _typescriptTypeMapper = typescriptTypeMapper; _expressionFactory = expressionFactory; _typescriptNamespace = typescriptNamespace; _statementFactory = statementFactory; System.Diagnostics.Debug.WriteLine("TypescriptCodeGenerator Created"); }
/// <summary> /// Gets the expression. /// </summary> /// <param name="ef">The ef.</param> /// <param name="expression">The expression.</param> /// <param name="propName">Name of the prop.</param> /// <param name="value">The value.</param> /// <returns></returns> public static IExpression GetExpression(IExpressionFactory ef, SearchParameter expression, string propName, string value) { switch (expression) { case SearchParameter.StartingWith: return ef.InsensitiveLike(propName, value, LikeMatchMode.BeginsWith); case SearchParameter.Contains: return ef.InsensitiveLike(propName, value, LikeMatchMode.Contains); case SearchParameter.EqualOrGreaterThan: return ef.Ge(propName, value); case SearchParameter.EqualOrLessThan: return ef.Le(propName, value); case SearchParameter.EqualTo: return ef.Eq(propName, value); case SearchParameter.GreaterThan: return ef.Gt(propName, value); case SearchParameter.LessThan: return ef.Lt(propName, value); case SearchParameter.NotEqualTo: return ef.InsensitiveNe(propName, value); } return null; }
public static string GetParametersFromExpressions(this CodeExpressionCollection codeExpressions, IExpressionFactory expressionFactory, CodeGeneratorOptions options) { var parametersFromExpressions = codeExpressions .OfType <CodeExpression>() .Select(parameter => { var parameterExpression = expressionFactory.GetExpression(parameter, options); return(parameterExpression.Evaluate()); }).ToList(); return(string.Join(", ", parametersFromExpressions)); }
public ExpressionParser(IExpressionFactory <T> expressionFactory) { this.expressionFactory = expressionFactory; }
/// <summary> /// Gets the filter expressions. /// </summary> /// <param name="expressions">The expressions.</param> /// <returns></returns> private ICriteria GetExpressions(ICriteria criteria, IExpressionFactory expressions) { if (chkLeadSource.Checked) criteria.Add(expressions.Eq("response.LeadSource", lbxLeadSource.SelectedItem.Text.ToString())); if (chkMethod.Checked) criteria.Add(expressions.Eq("response.ResponseMethod", lbxMethods.SelectedItem.Text)); if (chkStage.Checked) criteria.Add(expressions.Eq("response.Stage", lbxStage.SelectedItem.Text)); return criteria; }
protected override void OnFormBound() { base.OnFormBound(); bool bFoundActivityPhoneCall = false; bool bFoundActivityAppointment = false; bool bFoundActivityToDo = false; bool bFoundHistoryPhoneCall = false; bool bFoundHistoryAppointment = false; bool bFoundHistoryToDo = false; bool bFoundHistoryLetter = false; bool bFoundHistoryEmail = false; bool bFoundHistoryFax = false; bool bFoundHistoryUpdate = false; NextCallDate.Text = string.Empty; NextCallUser.Text = string.Empty; NextCallRegarding.Text = string.Empty; NextMeetDate.Text = string.Empty; NextMeetUser.Text = string.Empty; NextMeetRegarding.Text = string.Empty; NextToDoDate.Text = string.Empty; NextToDoUser.Text = string.Empty; NextToDoRegarding.Text = string.Empty; LastCallDate.Text = string.Empty; LastCallUser.Text = string.Empty; LastCallRegarding.Text = string.Empty; LastMeetDate.Text = string.Empty; LastMeetUser.Text = string.Empty; LastMeetRegarding.Text = string.Empty; LastToDoDate.Text = string.Empty; LastToDoUser.Text = string.Empty; LastToDoRegarding.Text = string.Empty; LastLetterDate.Text = string.Empty; LastLetterUser.Text = string.Empty; LastLetterRegarding.Text = string.Empty; LastEmailDate.Text = string.Empty; LastEmailUser.Text = string.Empty; LastEmailRegarding.Text = string.Empty; LastFaxDate.Text = string.Empty; LastFaxUser.Text = string.Empty; LastFaxRegarding.Text = string.Empty; LastUpdateDate.Text = string.Empty; LastUpdateUser.Text = string.Empty; IOpportunity opportunity = BindingSource.Current as IOpportunity; string EntityID = opportunity.Id.ToString(); IRepository <Activity> actRep = EntityFactory.GetRepository <Activity>(); IQueryable qryableAct = (IQueryable)actRep; IExpressionFactory expAct = qryableAct.GetExpressionFactory(); Sage.Platform.Repository.ICriteria critAct = qryableAct.CreateCriteria(); IList <Activity> ActivityList = critAct.Add( expAct.Eq("OpportunityId", EntityID)) .AddOrder(expAct.Asc("StartDate")) .List <Activity>(); if (ActivityList != null) { foreach (Activity OppActivity in ActivityList) { switch (OppActivity.Type) { case ActivityType.atPhoneCall: if (!bFoundActivityPhoneCall) { NextCallDate.Text = OppActivity.StartDate.ToShortDateString(); NextCallUser.Text = Sage.SalesLogix.Security.User.GetById(OppActivity.UserId).UserInfo.UserName; NextCallRegarding.Text = OppActivity.Description; bFoundActivityPhoneCall = true; break; } break; case ActivityType.atAppointment: if (!bFoundActivityAppointment) { NextMeetDate.Text = OppActivity.StartDate.ToShortDateString(); NextMeetUser.Text = Sage.SalesLogix.Security.User.GetById(OppActivity.UserId).UserInfo.UserName; NextMeetRegarding.Text = OppActivity.Description; bFoundActivityAppointment = true; break; } break; case ActivityType.atToDo: if (!bFoundActivityToDo) { NextToDoDate.Text = OppActivity.StartDate.ToShortDateString(); NextToDoUser.Text = Sage.SalesLogix.Security.User.GetById(OppActivity.UserId).UserInfo.UserName; NextToDoRegarding.Text = OppActivity.Description; bFoundActivityToDo = true; break; } break; default: break; } } } IRepository <History> hisRep = EntityFactory.GetRepository <History>(); IQueryable qryableHis = (IQueryable)hisRep; IExpressionFactory expHis = qryableHis.GetExpressionFactory(); Sage.Platform.Repository.ICriteria critHis = qryableHis.CreateCriteria(); IList <History> HistoryList = critHis.Add( expHis.Eq("OpportunityId", EntityID)) .AddOrder(expHis.Desc("CompletedDate")) .List <History>(); if (HistoryList != null) { foreach (History OppHistory in HistoryList) { switch (OppHistory.Type) { case HistoryType.atPhoneCall: if (!bFoundHistoryPhoneCall) { LastCallDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastCallUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastCallRegarding.Text = OppHistory.Description; bFoundHistoryPhoneCall = true; break; } break; case HistoryType.atAppointment: if (!bFoundHistoryAppointment) { LastMeetDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastMeetUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastMeetRegarding.Text = OppHistory.Description; bFoundHistoryAppointment = true; break; } break; case HistoryType.atToDo: if (!bFoundHistoryToDo) { LastToDoDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastToDoUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastToDoRegarding.Text = OppHistory.Description; bFoundHistoryToDo = true; break; } break; case HistoryType.atLiterature: if (!bFoundHistoryLetter) { LastLetterDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastLetterUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastLetterRegarding.Text = OppHistory.Description; bFoundHistoryLetter = true; break; } break; case HistoryType.atEMail: if (!bFoundHistoryEmail) { LastEmailDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastEmailUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastEmailRegarding.Text = OppHistory.Description; bFoundHistoryEmail = true; break; } break; case HistoryType.atFax: if (!bFoundHistoryFax) { LastFaxDate.Text = OppHistory.CompletedDate.ToShortDateString(); LastFaxUser.Text = Sage.SalesLogix.Security.User.GetById(OppHistory.UserId).UserInfo.UserName; LastFaxRegarding.Text = OppHistory.Description; bFoundHistoryFax = true; break; } break; default: if (!bFoundHistoryUpdate) { break; } break; } } } DateTime md = new DateTime(); if (opportunity.ModifyDate.HasValue) { md = Convert.ToDateTime(opportunity.ModifyDate); LastUpdateDate.Text = md.ToShortDateString(); } IUser user = EntityFactory.GetById <IUser>(opportunity.ModifyUser); if (user != null) { LastUpdateUser.Text = user.UserInfo.UserName; } }
/// <summary> /// Adds the comma delimited strings to the expression factory. /// </summary> /// <param name="criteria">The criteria.</param> /// <param name="expressions">The expressions.</param> /// <param name="text">The text.</param> /// <param name="propertyName">Name of the property.</param> /// <param name="clause">The clause.</param> private static void AddCommaDelimitedStringsToExpression(ICriteria criteria, IExpressionFactory expressions, String text, String propertyName, SearchParameter clause) { if (!string.IsNullOrEmpty(text)) { IList<IExpression> expression = new List<IExpression>(); IJunction junction; string[] values = text.Split(','); foreach (String value in values) { expression.Add(GetExpression(expressions, clause, propertyName, value)); } junction = expressions.Disjunction(); foreach (IExpression e in expression) { junction.Add(e); } criteria.Add(junction); } return; }
public void Setup() { _parsingContext = ParsingContext.Create(); var provider = MockRepository.GenerateStub<ExcelDataProvider>(); _factory = new ExpressionFactory(provider, _parsingContext); }
public ExpressionGraphBuilder(IExpressionFactory expressionFactory, ParsingContext parsingContext) { _expressionFactory = expressionFactory; _parsingContext = parsingContext; }
private void LoadContactGrid() { bool ConditionMet = false; string Company = ""; string FirstName = ""; string LastName = ""; string Title = ""; string Email = ""; string CityStatePostal = ""; string WorkPhone = ""; string WebAddress = ""; IExpressionFactory exp = null; ICriteria criteria = null; ILead lead = BindingSource.Current as ILead; if (lead != null) { Company = lead.Company; FirstName = lead.FirstName; LastName = lead.LastName; Title = lead.Title; Email = lead.Email; CityStatePostal = lead.Address.LeadCtyStZip; WorkPhone = lead.WorkPhone; WebAddress = lead.WebAddress; } IRepository <IContact> contactList = EntityFactory.GetRepository <IContact>(); IQueryable qryContact = (IQueryable)contactList; exp = qryContact.GetExpressionFactory(); criteria = qryContact.CreateCriteria(); criteria.CreateAlias("Address", "ad"); IList <IExpression> expression = new List <IExpression>(); if ((chkCompany.Checked) && (Company != null)) { expression.Add(GetExpression(exp, "AccountName", Company)); ConditionMet = true; } if ((chkFirstName.Checked) && (FirstName != null)) { expression.Add(GetExpression(exp, "FirstName", FirstName)); ConditionMet = true; } if ((chkLastName.Checked) && (LastName != null)) { expression.Add(GetExpression(exp, "LastName", LastName)); ConditionMet = true; } if ((chkTitle.Checked) && (Title != null)) { expression.Add(GetExpression(exp, "Title", Title)); ConditionMet = true; } if ((chkEmail.Checked) && (Email != null)) { expression.Add(GetExpression(exp, "Email", Email)); ConditionMet = true; } if ((chkCityStatePostal.Checked) && (CityStatePostal != null)) { expression.Add(GetExpression(exp, "ad.CityStateZip", CityStatePostal)); ConditionMet = true; } if ((chkWorkPhone.Checked) && (WorkPhone != null)) { expression.Add(GetExpression(exp, "WorkPhone", WorkPhone)); ConditionMet = true; } if ((chkWebAddress.Checked) && (WebAddress != null)) { expression.Add(GetExpression(exp, "WebAddress", WebAddress)); ConditionMet = true; } IJunction junction; if (rdbMatchAll.Checked) { junction = exp.Conjunction(); // AND } else { junction = exp.Disjunction(); // OR } foreach (IExpression e in expression) { junction.Add(e); } criteria.Add(junction); if (ConditionMet.Equals(true)) { IList list = criteria.List(); dtsContacts.setCustomData(list); lblContactMatches.Text = string.Format(GetLocalResourceObject("PotentialContactMatches_rsc").ToString(), list.Count); } }
/// <summary> /// Adds the expressions criteria. /// </summary> /// <param name="criteria">The criteria.</param> /// <param name="expressions">The expressions.</param> /// <returns></returns> private void AddExpressionsCriteria(ICriteria criteria, IExpressionFactory expressions) { if (criteria != null) { SearchParameter clause; Boolean isLeads = (rdgIncludeType.SelectedIndex == 0); Boolean isPrimaryContact = (rdgIncludeType.SelectedIndex == 1); Boolean isIndividual = (rdgIncludeType.SelectedIndex == 3); criteria.Add(expressions.Eq("address.IsPrimary", true)); if (isPrimaryContact) { criteria.Add(expressions.Eq("a1.IsPrimary", true)); } if (chkCompany.Checked) { clause = (SearchParameter)lbxCompany.SelectedIndex; criteria.Add(isLeads ? GetExpression(expressions, clause, "a1.Company", txtCompany.Text) : GetExpression(expressions, clause, "account.AccountName", txtCompany.Text)); } if (chkIndustry.Checked) { clause = (SearchParameter)lbxIndustry.SelectedIndex; criteria.Add(isLeads ? GetExpression(expressions, clause, "a1.Industry", pklIndustry.PickListValue) : GetExpression(expressions, clause, "account.Industry", pklIndustry.PickListValue)); } if (chkSIC.Checked) { clause = (SearchParameter)lbxSIC.SelectedIndex; criteria.Add(isLeads ? GetExpression(expressions, clause, "a1.SICCode", txtSIC.Text) : GetExpression(expressions, clause, "account.SicCode", txtSIC.Text)); } if (chkTitle.Checked) { clause = (SearchParameter)lbxTitle.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "a1.Title", pklTitle.PickListValue)); } if (chkProducts.Checked && !isLeads) { criteria.CreateCriteria("account.AccountProducts", "product"); clause = (SearchParameter)lbxProducts.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "product.ProductName", lueProducts.Text)); } if (chkStatus.Checked) { clause = (SearchParameter)lbxStatus.SelectedIndex; if (isLeads || isIndividual) { criteria.Add(GetExpression(expressions, clause, "a1.Status", pklStatus.PickListValue)); } else { criteria.Add(GetExpression(expressions, clause, "account.Status", pklStatus.PickListValue)); } } if (!chkSolicit.Checked) { criteria.Add(expressions.Or(expressions.Eq("a1.DoNotSolicit", false), expressions.IsNull("a1.DoNotSolicit"))); } if (!chkEmail.Checked) { criteria.Add(expressions.Or(expressions.Eq("a1.DoNotEmail", false), expressions.IsNull("a1.DoNotEmail"))); } if (!chkCall.Checked) { criteria.Add(expressions.Or(expressions.Eq("a1.DoNotPhone", false), expressions.IsNull("a1.DoNotPhone"))); } if (!chkMail.Checked) { criteria.Add(expressions.Or(expressions.Eq("a1.DoNotMail", false), expressions.IsNull("a1.DoNotMail"))); } if (!chkFax.Checked) { criteria.Add(isLeads ? expressions.Or(expressions.Eq("a1.DoNotFAX", false), expressions.IsNull("a1.DoNotFAX")) : expressions.Or(expressions.Eq("a1.DoNotFax", false), expressions.IsNull("a1.DoNotFax"))); } if (chkCity.Checked) { clause = (SearchParameter)lbxCity.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtCity.Text, "address.City", clause); } if (chkState.Checked) { clause = (SearchParameter)lbxState.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtState.Text, "address.State", clause); } if (chkZip.Checked) { clause = (SearchParameter)lbxZip.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtZip.Text, "address.PostalCode", clause); } if (chkLeadSource.Checked && rdgIncludeType.SelectedIndex != 3) { switch (rdgIncludeType.SelectedIndex) { case 0: criteria.CreateCriteria("a1.LeadSource", "leadsource"); break; case 3: criteria.CreateCriteria("a1.LeadSources", "leadsource"); break; default: criteria.CreateCriteria("account.LeadSource", "leadsource"); break; } clause = (SearchParameter)lbxLeadSource.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "leadsource.Description", lueLeadSource.Text)); } if (chkImportSource.Checked) { clause = (SearchParameter)lbxImportSource.SelectedIndex; if (isLeads || isIndividual) { criteria.Add(GetExpression(expressions, clause, "a1.ImportSource", pklImportSource.PickListValue)); } else { criteria.Add(GetExpression(expressions, clause, "account.ImportSource", pklImportSource.PickListValue)); } } if (!string.IsNullOrEmpty(dtpCreateFromDate.Text)) { if (chkCreateDate.Checked && (isLeads || isIndividual)) { criteria.Add(expressions.Between("a1.CreateDate", CheckForNullDate(dtpCreateFromDate.DateTimeValue), CheckForNullDate(dtpCreateToDate.DateTimeValue))); } else if (chkCreateDate.Checked) { criteria.Add(expressions.Between("account.CreateDate", CheckForNullDate(dtpCreateFromDate.DateTimeValue), CheckForNullDate(dtpCreateToDate.DateTimeValue))); } } } }
/// <summary> /// Initialises a new instance of the <see cref="NumericOperator"/> class. /// </summary> /// <param name="joinApplyMeasuresOp">The join apply measure operator.</param> /// <param name="dsResolver">The data structure resolver.</param> /// <param name="exprFac">The expression factory.</param> public PeriodIndicatorOperator(IJoinApplyMeasuresOperator joinApplyMeasuresOp, DataStructureResolver dsResolver, IExpressionFactory exprFac) { this._joinApplyMeasuresOp = joinApplyMeasuresOp; this._dsResolver = dsResolver; this._exprFac = exprFac; }
public ExpressionBuilderFactory(IExpressionFactory expressionFactory) { ExpressionFactory = expressionFactory; }
/// <summary> /// Initializes a new instance of the <see cref="Parser" /> class. /// </summary> /// <param name="factory">The factory.</param> public Parser(IExpressionFactory factory) { ExpressionFactory = factory; }
public SavedExpressionData(IExpressionFactory expressionFactory) { this.SavedExpressionsDataHelper = new SavedExpressionsDataHelper(expressionFactory); }
public XmlSpecificationCompiler(IExpressionFactory defaultExpressionFactory) : this(null, defaultExpressionFactory) { }
private void LoadAccountGrid() { bool ConditionMet = false; string Company = ""; string CityStatePostal = ""; string WorkPhone = ""; string TollFree = ""; string WebAddress = ""; string Industry = ""; IExpressionFactory exp = null; ICriteria criteria = null; ILead lead = BindingSource.Current as ILead; if (lead != null) { Company = lead.Company; CityStatePostal = lead.Address.LeadCtyStZip; WorkPhone = lead.WorkPhone; TollFree = lead.TollFree; WebAddress = lead.WebAddress; Industry = lead.Industry; } IRepository <IAccount> accountList = EntityFactory.GetRepository <IAccount>(); IQueryable qryAccount = (IQueryable)accountList; exp = qryAccount.GetExpressionFactory(); criteria = qryAccount.CreateCriteria(); criteria.CreateAlias("Address", "ad"); IList <IExpression> expression = new List <IExpression>(); if ((chkCompany.Checked) && (Company != null)) { expression.Add(GetExpression(exp, "AccountName", Company)); ConditionMet = true; } if ((chkIndustry.Checked) && (Industry != null)) { expression.Add(GetExpression(exp, "Industry", Industry)); ConditionMet = true; } if ((chkWebAddress.Checked) && (WebAddress != null)) { expression.Add(GetExpression(exp, "WebAddress", WebAddress)); ConditionMet = true; } if ((chkCityStatePostal.Checked) && (CityStatePostal != null)) { expression.Add(GetExpression(exp, "ad.CityStateZip", CityStatePostal)); ConditionMet = true; } if ((chkWorkPhone.Checked) && (WorkPhone != null)) { expression.Add(GetExpression(exp, "MainPhone", WorkPhone)); ConditionMet = true; } if ((chkTollFreePhone.Checked) && (TollFree != null)) { expression.Add(GetExpression(exp, "TollFree", TollFree)); ConditionMet = true; } IJunction junction; if (rdbMatchAll.Checked) { junction = exp.Conjunction(); // AND } else { junction = exp.Disjunction(); // OR } foreach (IExpression e in expression) { junction.Add(e); } criteria.Add(junction); if (ConditionMet.Equals(true)) { IList list = criteria.List(); dtsAccounts.setCustomData(list); lblAccountMatches.Text = string.Format(GetLocalResourceObject("PotentialAccountMatches_rsc").ToString(), list.Count); } }
public XmlSpecificationCompiler(IExpressionFactory defaultExpressionFactory, IExtensionPoint extensionOperators, ISpecificationProvider resolver = null) : this(defaultExpressionFactory, extensionOperators.CreateExtensions().Cast <IXmlSpecificationCompilerOperator>(), resolver) { }
/// <summary> /// Called when [set filters] event is fired on the TargetViewDataSource object. /// </summary> /// <param name="criteria">The criteria.</param> /// <param name="expressions">The expressions.</param> protected void OnSetFilters(ICriteria criteria, IExpressionFactory expressions) { ICampaign campaign = GetParentEntity() as ICampaign; criteria.Add(expressions.Eq("Campaignid", campaign.Id.ToString())); if (!chkContacts.Checked && !chkLeads.Checked) criteria.Add(expressions.Eq("TargetType", "NONE")); if (chkContacts.Checked && !chkLeads.Checked) criteria.Add(expressions.Eq("TargetType", "Contact")); if (!chkContacts.Checked && chkLeads.Checked) criteria.Add(expressions.Eq("TargetType", "Lead")); if (chkPriority.Checked && lbxPriority.SelectedItem != null) criteria.Add(expressions.Eq("Priority", lbxPriority.SelectedItem.Text)); if (chkGroup.Checked && lbxGroups.SelectedItem != null) criteria.Add(expressions.Eq("GroupName", lbxGroups.SelectedItem.Text)); if (chkStatus.Checked && lbxStatus.SelectedItem != null) criteria.Add(expressions.Eq("Status", lbxStatus.SelectedItem.Text)); if (chkStage.Checked && lbxStages.SelectedItem != null) criteria.Add(expressions.Eq("Stage", lbxStages.SelectedItem.Text)); if (chkResponded.Checked) { criteria.Add(rdgResponded.SelectedIndex == 0 ? expressions.IsNotNull("ResponseDate") : expressions.IsNull("ResponseDate")); } }
public XmlSpecificationCompiler(IExpressionFactory defaultExpressionFactory, ISpecificationProvider resolver = null) : this(defaultExpressionFactory, new IXmlSpecificationCompilerOperator[0], resolver) { }
/// <summary> /// Initialises a new instance of the <see cref="CheckDatapointOperator"/> class. /// </summary> /// <param name="dsResolver">The data structure resolver.</param> /// <param name="exprFac">The expression factory.</param> public CheckDatapointOperator(DataStructureResolver dsResolver, IExpressionFactory exprFac) { this._dsResolver = dsResolver; this._exprFac = exprFac; }
/// <summary> /// Inittializes a new instance of the <see cref="RenameBranch"/> class. /// </summary> /// <param name="exprFactory">The expression factory.</param> /// <param name="exprTextGen">The epression text generator.</param> public RenameBranch(IExpressionFactory exprFactory, IExpressionTextGenerator exprTextGen) { this._exprFactory = exprFactory; this._exprTextGen = exprTextGen; }
private void LoadContactGrid() { bool conditionMet = false; string company = String.Empty; string firstName = String.Empty; string lastName = String.Empty; string title = String.Empty; string email = String.Empty; string cityStatePostal = String.Empty; string workPhone = String.Empty; string webAddress = String.Empty; ILead lead = BindingSource.Current as ILead; if (lead != null) { company = lead.Company; firstName = lead.FirstName; lastName = lead.LastName; title = lead.Title; email = lead.Email; cityStatePostal = lead.Address.LeadCtyStZip; workPhone = lead.WorkPhone; webAddress = lead.WebAddress; } IRepository <IContact> contactList = EntityFactory.GetRepository <IContact>(); IQueryable qryContact = (IQueryable)contactList; IExpressionFactory exp = qryContact.GetExpressionFactory(); ICriteria criteria = qryContact.CreateCriteria(); criteria.CreateAlias("Address", "ad"); IList <IExpression> expression = new List <IExpression>(); if (chkCompany.Checked && company != null) { expression.Add(GetExpression(exp, "AccountName", company)); conditionMet = true; } if (chkFirstName.Checked && firstName != null) { expression.Add(GetExpression(exp, "FirstName", firstName)); conditionMet = true; } if (chkLastName.Checked && lastName != null) { expression.Add(GetExpression(exp, "LastName", lastName)); conditionMet = true; } if (chkTitle.Checked && title != null) { expression.Add(GetExpression(exp, "Title", title)); conditionMet = true; } if (chkEmail.Checked && email != null) { expression.Add(GetExpression(exp, "Email", email)); conditionMet = true; } if (chkCityStatePostal.Checked && cityStatePostal != null) { expression.Add(GetExpression(exp, "ad.CityStateZip", cityStatePostal)); conditionMet = true; } if (chkWorkPhone.Checked && workPhone != null) { expression.Add(GetExpression(exp, "WorkPhone", workPhone)); conditionMet = true; } if (chkWebAddress.Checked && webAddress != null) { expression.Add(GetExpression(exp, "WebAddress", webAddress)); conditionMet = true; } IJunction junction = rdbMatchAll.Checked ? exp.Conjunction() : exp.Disjunction(); foreach (IExpression e in expression) { junction.Add(e); } criteria.Add(junction); if (conditionMet) { IList list = criteria.List(); dtsContacts.setCustomData(list); lblContactMatches.Text = String.Format(GetLocalResourceObject("PotentialContactMatches_rsc").ToString(), list.Count); } }
/// <summary> /// Adds the expressions criteria. /// </summary> /// <param name="criteria">The criteria.</param> /// <param name="expressions">The expressions.</param> /// <returns></returns> private void AddExpressionsCriteria(ICriteria criteria, IExpressionFactory expressions) { if (criteria != null) { SearchParameter clause; Boolean isLeads = (rdgIncludeType.SelectedIndex == 0); Boolean isPrimaryContact = (rdgIncludeType.SelectedIndex == 1); Boolean isIndividual = (rdgIncludeType.SelectedIndex == 3); criteria.Add(expressions.Eq("address.IsPrimary", true)); if (isPrimaryContact) { criteria.Add(expressions.Eq("a1.IsPrimary", true)); } if (chkCompany.Checked) { clause = (SearchParameter)lbxCompany.SelectedIndex; if (isLeads) criteria.Add(GetExpression(expressions, clause, "a1.Company", txtCompany.Text)); else criteria.Add(GetExpression(expressions, clause, "account.AccountName", txtCompany.Text)); } if (chkIndustry.Checked) { clause = (SearchParameter)lbxIndustry.SelectedIndex; if (isLeads) criteria.Add(GetExpression(expressions, clause, "a1.Industry", pklIndustry.PickListValue)); else criteria.Add(GetExpression(expressions, clause, "account.Industry", pklIndustry.PickListValue)); } if (chkSIC.Checked) { clause = (SearchParameter)lbxSIC.SelectedIndex; if (isLeads) criteria.Add(GetExpression(expressions, clause, "a1.SICCode", txtSIC.Text)); else criteria.Add(GetExpression(expressions, clause, "account.SicCode", txtSIC.Text)); } if (chkTitle.Checked) { clause = (SearchParameter)lbxTitle.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "a1.Title", pklTitle.PickListValue)); } if (chkProducts.Checked && !isLeads) { criteria.CreateCriteria("account.AccountProducts", "product"); clause = (SearchParameter)lbxProducts.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "product.ProductName", lueProducts.Text)); } if (chkStatus.Checked) { clause = (SearchParameter)lbxStatus.SelectedIndex; if (isLeads || isIndividual) criteria.Add(GetExpression(expressions, clause, "a1.Status", pklStatus.PickListValue)); else criteria.Add(GetExpression(expressions, clause, "account.Status", pklStatus.PickListValue)); } if (!chkSolicit.Checked) criteria.Add(expressions.Or(expressions.Eq("a1.DoNotSolicit", false), expressions.IsNull("a1.DoNotSolicit"))); if (!chkEmail.Checked) criteria.Add(expressions.Or(expressions.Eq("a1.DoNotEmail", false), expressions.IsNull("a1.DoNotEmail"))); if (!chkCall.Checked) criteria.Add(expressions.Or(expressions.Eq("a1.DoNotPhone", false), expressions.IsNull("a1.DoNotPhone"))); if (!chkMail.Checked) criteria.Add(expressions.Or(expressions.Eq("a1.DoNotMail", false), expressions.IsNull("a1.DoNotMail"))); if (!chkFax.Checked) { if (isLeads) criteria.Add(expressions.Or(expressions.Eq("a1.DoNotFAX", false), expressions.IsNull("a1.DoNotFAX"))); else criteria.Add(expressions.Or(expressions.Eq("a1.DoNotFax", false), expressions.IsNull("a1.DoNotFax"))); } if (chkCity.Checked) { clause = (SearchParameter)lbxCity.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtCity.Text, "address.City", clause); } if (chkState.Checked) { clause = (SearchParameter)lbxState.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtState.Text, "address.State", clause); } if (chkZip.Checked) { clause = (SearchParameter)lbxZip.SelectedIndex; AddCommaDelimitedStringsToExpression(criteria, expressions, txtZip.Text, "address.PostalCode", clause); } if (chkLeadSource.Checked) { switch (rdgIncludeType.SelectedIndex) { case 0: criteria.CreateCriteria("a1.LeadSource", "leadsource"); break; case 3: criteria.CreateCriteria("a1.LeadSources", "leadsource"); break; default: criteria.CreateCriteria("account.LeadSource", "leadsource"); break; } clause = (SearchParameter)lbxLeadSource.SelectedIndex; criteria.Add(GetExpression(expressions, clause, "leadsource.Description", lueLeadSource.Text)); } if (chkImportSource.Checked) { clause = (SearchParameter)lbxImportSource.SelectedIndex; if (isLeads || isIndividual) criteria.Add(GetExpression(expressions, clause, "a1.ImportSource", pklImportSource.PickListValue)); else criteria.Add(GetExpression(expressions, clause, "account.ImportSource", pklImportSource.PickListValue)); } if (!string.IsNullOrEmpty(dtpCreateFromDate.Text)) { if (chkCreateDate.Checked && (isLeads || isIndividual)) criteria.Add(expressions.Between("a1.CreateDate", CheckForNullDate(dtpCreateFromDate.DateTimeValue), CheckForNullDate(dtpCreateToDate.DateTimeValue))); else if (chkCreateDate.Checked) criteria.Add(expressions.Between("account.CreateDate", CheckForNullDate(dtpCreateFromDate.DateTimeValue), CheckForNullDate(dtpCreateToDate.DateTimeValue))); } } return; }
private IExpression GetExpression(IExpressionFactory ef, string propName, string value) { return(!chkMatchExactly.Checked ? ef.InsensitiveLike(propName, value, LikeMatchMode.Contains) : ef.Eq(propName, value)); }
private void LoadAccountGrid() { bool conditionMet = false; string company = String.Empty; string cityStatePostal = String.Empty; string workPhone = String.Empty; string tollFree = String.Empty; string webAddress = String.Empty; string industry = String.Empty; ILead lead = BindingSource.Current as ILead; if (lead != null) { company = lead.Company; cityStatePostal = lead.Address.LeadCtyStZip; workPhone = lead.WorkPhone; tollFree = lead.TollFree; webAddress = lead.WebAddress; industry = lead.Industry; } IRepository <IAccount> accountList = EntityFactory.GetRepository <IAccount>(); IQueryable qryAccount = (IQueryable)accountList; IExpressionFactory exp = qryAccount.GetExpressionFactory(); ICriteria criteria = qryAccount.CreateCriteria(); criteria.CreateAlias("Address", "ad"); IList <IExpression> expression = new List <IExpression>(); if (chkCompany.Checked && company != null) { expression.Add(GetExpression(exp, "AccountName", company)); conditionMet = true; } if (chkIndustry.Checked && industry != null) { expression.Add(GetExpression(exp, "Industry", industry)); conditionMet = true; } if (chkWebAddress.Checked && webAddress != null) { expression.Add(GetExpression(exp, "WebAddress", webAddress)); conditionMet = true; } if (chkCityStatePostal.Checked && cityStatePostal != null) { expression.Add(GetExpression(exp, "ad.CityStateZip", cityStatePostal)); conditionMet = true; } if (chkWorkPhone.Checked && workPhone != null) { expression.Add(GetExpression(exp, "MainPhone", workPhone)); conditionMet = true; } if (chkTollFreePhone.Checked && tollFree != null) { expression.Add(GetExpression(exp, "TollFree", tollFree)); conditionMet = true; } IJunction junction = rdbMatchAll.Checked ? exp.Conjunction() : exp.Disjunction(); foreach (IExpression e in expression) { junction.Add(e); } criteria.Add(junction); if (conditionMet) { IList list = criteria.List(); dtsAccounts.setCustomData(list); lblAccountMatches.Text = String.Format(GetLocalResourceObject("PotentialAccountMatches_rsc").ToString(), list.Count); } }
public SavedExpressionsDataHelper(IExpressionFactory expressionFactory) { this.ExpressionFactory = expressionFactory; }
public ExpressionGenerator(IExpressionFactory expressionFactory) { _expressionFactory = expressionFactory; }
public ExpressionGraphBuilder(IExpressionFactory expressionFactory, ParsingContext parsingContext) { _expressionFactory = expressionFactory; _parsingContext = parsingContext; }
public void Register(string name, IExpressionFactory api) { m_Apis.Add(name, api); }
/// <summary> /// Inittializes a new instance of the <see cref="UsingBranch"/> class. /// </summary> /// <param name="exprFactory">The expression factory.</param> public UsingBranch(IExpressionFactory exprFactory) { this.exprFactory = exprFactory; }