本文整理汇总了C#中QueryField.MoreEqual方法的典型用法代码示例。如果您正苦于以下问题:C# QueryField.MoreEqual方法的具体用法?C# QueryField.MoreEqual怎么用?C# QueryField.MoreEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryField
的用法示例。
在下文中一共展示了QueryField.MoreEqual方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetApproveLevel
/**
* 根据金额和审批类型查找需要流程所需最低审批Level和最高Level
*/
public static Hashtable GetApproveLevel(float amount, string approveType)
{
var qLowAmount = new QueryField("LowAmount", false);
var qHighAmount = new QueryField("HighAmount", false);
CamlExpression exp = null;
exp = WorkFlowUtil.LinkAnd(exp, qLowAmount.LessThan(amount));
exp = WorkFlowUtil.LinkAnd(exp, qHighAmount.MoreEqual(amount));
SPListItemCollection lc = ListQuery.Select()
.From(WorkFlowUtil.GetWorkflowList("ApproveLevel"))
.Where(exp)
.GetItems();
Hashtable ht = new Hashtable();
if (lc.Count > 0)
{
ht.Add("LowLevel", lc[0]["LowLevel"].ToString());
ht.Add("HighLevel", lc[0]["HighLevel"].ToString());
}
return ht;
}
示例2: GetDelemans
/*
* Get delegate users according to the given multi names.
* @Return array that contains delegate users
*/
public static List<string> GetDelemans(List<string> loginNames, string moduleId)
{
List<string> delemans = new List<string>();
var now = DateTime.Now.ToString("yyyyMMdd");
var qApprover = new QueryField("ApproverLoginName", false);
var qBeginOn = new QueryField("BeginOn", false);
var qEndOn = new QueryField("EndOn", false);
var qModules = new QueryField("Modules", false);
CamlExpression exp = null;
exp = WorkFlowUtil.LinkAnd(exp, qModules.Contains(moduleId));
exp = WorkFlowUtil.LinkAnd(exp, qBeginOn.LessEqual(now));
exp = WorkFlowUtil.LinkAnd(exp, qEndOn.MoreEqual(now));
CamlExpression exp2 = null;
foreach (string name in loginNames)
{
exp2 = WorkFlowUtil.LinkOr(exp2, qApprover.Equal(name));
}
exp = WorkFlowUtil.LinkAnd(exp, exp2);
SPListItemCollection coll = null;
SPSecurity.RunWithElevatedPrivileges(delegate
{
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
{
coll = ListQuery.Select()
.From(web.Lists["Delegates"])
.Where(exp)
.GetItems();
}
}
});
foreach (SPListItem item in coll)
{
// Need to check whether the delegate account is valid.
if (UserProfileUtil.GetEmployeeEx(item["DelegateToLoginName"].ToString()) != null)
{
delemans.Add(item["DelegateToLoginName"].ToString());
}
}
return delemans;
}
示例3: GetClaimStdByLevel
internal static SPListItem GetClaimStdByLevel(int jobLevel, string type)
{
var qLowLevel = new QueryField("LowLevel", false);
var qHighLevel = new QueryField("HighLevel", false);
var qType = new QueryField("ExpenseType", false);
CamlExpression exp = null;
if (type.Equals("Mobile phone", System.StringComparison.CurrentCultureIgnoreCase))
{
exp = WorkFlowUtil.LinkAnd(exp, qLowLevel.LessEqual(jobLevel));
exp = WorkFlowUtil.LinkAnd(exp, qHighLevel.MoreEqual(jobLevel));
}
exp = WorkFlowUtil.LinkAnd(exp, qType.MoreEqual(type));
SPListItemCollection lc = ListQuery.Select()
.From(WorkFlowUtil.GetWorkflowList("ExpenseClaimStd"))
.Where(exp)
.GetItems();
return lc.Count > 0 ? lc[0] : null;
}