本文整理汇总了C#中QueryField.NotEqual方法的典型用法代码示例。如果您正苦于以下问题:C# QueryField.NotEqual方法的具体用法?C# QueryField.NotEqual怎么用?C# QueryField.NotEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryField
的用法示例。
在下文中一共展示了QueryField.NotEqual方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterChangeHistory
private SPListItemCollection FilterChangeHistory(string orderNumber, string department, bool isCompleted)
{
string status = null;
var qOrderNumber = new QueryField("Order_x0020_Number", false);
var qStatus = new QueryField("Status", false);
var qDepartment = new QueryField("Department", false);
CamlExpression exp = null;
exp = WorkFlowUtil.LinkAnd(exp, qOrderNumber.Equal(orderNumber));
if (department.IsNotNullOrWhitespace())
{
exp = WorkFlowUtil.LinkAnd(exp, qDepartment.Equal(department));
}
if (isCompleted)
{
status = CAWorkflowStatus.Completed;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.Equal(status));
}
else
{
//the status should not be "pending", "notstart", "financemanagerreject", "cforeject".
status = CAWorkflowStatus.Pending;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.Completed;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.IODepartmentManagerReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.IOCFOReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.IOFinanceReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
}
SPListItemCollection lc = ListQuery.Select()
.From(WorkFlowUtil.GetWorkflowList("Internal Order Maintenance Workflow"))
.Where(exp)
.OrderBy(new QueryField("Title", false), false)
.GetItems();
return lc;
}
示例2: isExistRunningVendor
protected bool isExistRunningVendor(string vendId, string departmentVal)
{
var qStatus = new QueryField("Status", false);
var qVendId = new QueryField("Vendor_x0020_ID", false);
var qDepartmentVal = new QueryField("DepartmentVal", false);
CamlExpression exp = null;
exp = WorkFlowUtil.LinkAnd(exp, qVendId.Equal(vendId));
exp = WorkFlowUtil.LinkAnd(exp, qDepartmentVal.Equal(departmentVal));
//the status should not be "pending", "notstart", "financemanagerreject", "cforeject".
var status = CAWorkflowStatus.Pending;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.Completed;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.NTVDepartmentHeadReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.NTVCFOReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
status = CAWorkflowStatus.NTVFinanceReject;
exp = WorkFlowUtil.LinkAnd(exp, qStatus.NotEqual(status));
var result = ListQuery.Select().From(WorkFlowUtil.GetWorkflowList("Non Trade Supplier Setup Maintenance Workflow"))
.Where(exp)
.OrderBy(new QueryField("Title", false), true)
.GetItems();
return result.Count > 0;
}
示例3: DeleteTask
/// <summary>
/// 删除Tasks组里的其它人
/// </summary>
/// <param name="sItemId"></param>
/// <param name="sGroup"></param>
void DeleteTask(string sItemId,string sGroup)
{
CamlExpression exp = null;
SPGroup spGroup = WorkFlowUtil.GetUserGroup("wf_BSS");
SPGroup spGroupMMC = WorkFlowUtil.GetUserGroup("wf_MMC");
////(), "wf_BSS");
//// nc = GetApproverInGroup("wf_MMC")
QueryField qWorkflowItemId = new QueryField("WorkflowItemId", false);
QueryField qfWorkflowListId = new QueryField("WorkflowListId", false);
QueryField qfStatus = new QueryField("Status", false);//Status
exp = WorkFlowUtil.LinkAnd(exp, qWorkflowItemId.Equal(sItemId));///AcceleratorWorkflow 里的记录ID相等
exp = WorkFlowUtil.LinkAnd(exp, qfWorkflowListId.Equal(SPContext.Current.ListId));//ListID相等
exp = WorkFlowUtil.LinkAnd(exp, qfStatus.NotEqual("Completed"));//Completed没有完成的task
QueryField qAssignedTo = new QueryField("AssignedTo", false);//task的执行人
CamlExpression ceOR = null;
foreach (SPUser user in spGroup.Users)
{
string sLoginName = user.LoginName;
if (sLoginName.Equals("SHAREPOINT\\System", StringComparison.CurrentCultureIgnoreCase) || sLoginName.Equals(CurrentEmployee.UserAccount, StringComparison.CurrentCultureIgnoreCase))
{
continue;
}
ceOR = WorkFlowUtil.LinkOr(ceOR, qAssignedTo.Equal(sLoginName));
CommonUtil.logError(sLoginName);
}
foreach (SPUser user in spGroupMMC.Users)
{
string sLoginName = user.LoginName;
if (sLoginName.Equals("SHAREPOINT\\System", StringComparison.CurrentCultureIgnoreCase) || sLoginName.Equals(CurrentEmployee.UserAccount, StringComparison.CurrentCultureIgnoreCase))
{
continue;
}
CommonUtil.logError(sLoginName);
ceOR = WorkFlowUtil.LinkOr(ceOR, qAssignedTo.Equal(sLoginName));
}
exp = WorkFlowUtil.LinkAnd(exp, ceOR);
SPQuery q = new SPQuery();
SPSecurity.RunWithElevatedPrivileges(delegate
{
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
{
SPList list = web.Lists["Tasks"];
SPQuery query = new SPQuery
{
Query = CamlBuilder.Where(list, exp)
};
CommonUtil.logError(query.Query);
SPListItemCollection splic = list.GetItems(query);
web.AllowUnsafeUpdates = true;
if (null != splic)
{
for (int i = 0; i < splic.Count; i++)
{
CommonUtil.logError("删除Task: " + splic[i]["AssignedTo"].ToString()+" " + splic[i]["Title"].AsString());
splic[i].Delete();
//splic[i].Delete();
}
}
}
}
});
}
示例4: FilterColl
private SPListItemCollection FilterColl()
{
lblTmpXlsUrl.Text = "";
string fApplicant = txtfApplicant.Text;
string fLeaveType = ddlLeaveType.SelectedValue;//txtfLeaveType.Text;
string fLeaveDays = txtfLeaveDays.Text;
string fDateFrom = txtfDateFrom.Text;
string fDateTo = txtfDateTo.Text;
string fDepartments = ddlDepartments.SelectedValue;//txtfDepartments.Text;
QueryField qApplicant = new QueryField("Applicant", false);
QueryField qLeaveType = new QueryField("LeaveType", false);
QueryField qLeaveDays = new QueryField("LeaveDays", false);
QueryField qDateFrom = new QueryField("DateFrom", false);
QueryField qDateTo = new QueryField("DateTo", false);
QueryField qDepartment = new QueryField("Department", false);
QueryField qStatus = new QueryField("Status", false);
CamlExpression exp = null;
CamlExpression exp2 = null;
var alldepts = new List<string>();
foreach (SPListItem dept in SPContext.Current.Site.RootWeb.Lists["Department"].Items)
{
alldepts.Add(dept["Name"] + "");
}
if (!string.IsNullOrEmpty(fApplicant))
{
exp = LinkAnd(exp, qApplicant.Contains(fApplicant));
}
if (!string.IsNullOrEmpty(fLeaveType))
{
exp = LinkAnd(exp, qLeaveType.Contains(fLeaveType));
}
if (!string.IsNullOrEmpty(fLeaveDays))
{
exp = LinkAnd(exp, qLeaveDays.Equal(fLeaveDays));
}
if (!string.IsNullOrEmpty(fDateFrom))
{
exp = LinkAnd(exp, qDateTo >= fDateFrom);
}
if (!string.IsNullOrEmpty(fDateTo))
{
exp = LinkAnd(exp, qDateFrom <= fDateTo);
}
if (!string.IsNullOrEmpty(hidAssoDepts.Value))
{
if (!string.IsNullOrEmpty(fDepartments))
{
//exp2 = qDepartment.Equal(fDepartments);
if (ddlDepartments.SelectedValue.ToLower().Contains("store"))
{
//选中的是store,查 不包含在departments list里的员工
foreach (string dept in alldepts)
{
exp2 = LinkAnd(exp2, qDepartment.NotEqual(dept));
}
}
else
{
//选中的是别的部门,查 匹配该部门的员工
exp2 = qDepartment.Equal(fDepartments);
}
}
else
{
string[] depts = hidAssoDepts.Value.Split(',');
//foreach (string dept in depts)
//{
// exp2 = LinkOr(exp2, qDepartment.Equal(dept));
//}
if (hidAssoDepts.Value.ToLower().Contains("store"))
{
//如果权限里含有store,查满足 匹配权限 或者 不在alldepts中的
foreach (string dept in depts)
{
exp2 = LinkOr(exp2, qDepartment.Equal(dept));
}
CamlExpression exp3 = null;
foreach (string dept in alldepts)
{
exp3 = LinkAnd(exp3, qDepartment.NotEqual(dept));
}
exp2 = LinkOr(exp2, exp3);
}
else
{
//如果权限里不含store,查满足 匹配权限 的
foreach (string dept in depts)
{
exp2 = LinkOr(exp2, qDepartment.Equal(dept));
//.........这里部分代码省略.........
示例5: GetPOItemCollection
/**
* 查询当前帐号对应的已产生PO的且为未收货状态的Item
*/
private SPListItemCollection GetPOItemCollection(string sPONumber,string sPRNumber)
{
var qIsReceived = new QueryField("IsReceived", false);
QueryField qCostCenter = new QueryField("CostCenter", false);
QueryField qCreated = new QueryField("Created", false);
CamlExpression exp = null;
exp = WorkFlowUtil.LinkAnd(exp, qIsReceived.NotEqual(true));
string sUserName = SPContext.Current.Web.CurrentUser.LoginName;
if (PurchaseRequestCommon.IsInGroups(sUserName, new string[] { "wf_Store" }))
{
List<string> costCenters = GetOwnCostCenters(SPContext.Current.Web.CurrentUser.LoginName);
if (costCenters.Count == 0)
{
return null;
}
CamlExpression ceOR = null;
foreach (var costCenter in costCenters)
{
ceOR = WorkFlowUtil.LinkOr(ceOR, qCostCenter.Equal(costCenter));
}
exp = WorkFlowUtil.LinkAnd(exp, ceOR);
}
else if (PurchaseRequestCommon.IsInGroups(sUserName, new string[] { "wf_HO" }))//如果是wf_HO
{
QueryField qAuthor = new QueryField("Author", false);
exp = WorkFlowUtil.LinkAnd(exp, qAuthor.Equal(SPContext.Current.Web.CurrentUser.Name));
HFIsHO.Value = "True";
}
else if (PurchaseRequestCommon.IsInGroups(sUserName, new string[] { "w_PMGR" }))
{
QueryField qfTitle = new QueryField("Title", false);
exp = WorkFlowUtil.LinkAnd(exp, qfTitle.BeginsWith("H"));
}
int iPO = sPONumber.Length;
int iPR = sPRNumber.Length;
if (iPO > 0)//按PONumber查询
{
QueryField qTitle = new QueryField("Title", false);
exp = WorkFlowUtil.LinkAnd(exp, qTitle.Equal(sPONumber));
}
if (iPR > 0)
{
QueryField qPRNO = new QueryField("PRNumber", false);
exp = WorkFlowUtil.LinkAnd(exp, qPRNO.Equal(sPRNumber));
}
if (iPO > 0 || iPR > 0)
{
QueryField qTitle = new QueryField("Title", false);
CamlExpression ce = null;
ce = WorkFlowUtil.LinkAnd(ce,qIsReceived.NotEqual(true));
ce = WorkFlowUtil.LinkAnd(ce, qTitle.Contains("R"));
exp = WorkFlowUtil.LinkOr(ce, exp);
}
SPListItemCollection lc = ListQuery.Select()
.From(SPContext.Current.Web.Lists["PurchaseOrderItems"])
.Where(exp)
.GetItems();
return lc;
}