本文整理汇总了C#中ISession.CreateEntityQuery方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.CreateEntityQuery方法的具体用法?C# ISession.CreateEntityQuery怎么用?C# ISession.CreateEntityQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISession
的用法示例。
在下文中一共展示了ISession.CreateEntityQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteInvCheckOrder
public static void DeleteInvCheckOrder(ISession _session, string InvCheckNumber)
{
if (_session.CreateEntityQuery<INVCheckHead>().Where(Exp.Eq("OrderNumber", InvCheckNumber)).And(Exp.Eq("Status", 1)).List<INVCheckHead>().Count == 0)
{
throw new Exception("库存盘点单不存在或已经确认!");
}
_session.CreateEntityQuery<INVCheckHead>().Where(Exp.Eq("OrderNumber", InvCheckNumber)).Delete();
_session.CreateEntityQuery<INVCheckLine>().Where(Exp.Eq("OrderNumber", InvCheckNumber)).Delete();
_session.CreateEntityQuery<INVCheckWh>().Where(Exp.Eq("OrderNumber", InvCheckNumber)).Delete();
}
示例2: Retrieve
public static ItemSpec Retrieve(ISession session, string itemCode, string colorCode, string sizeCode)
{
IList<ItemSpec> skus = session.CreateEntityQuery<ItemSpec>()
.Where(Exp.Eq("ItemCode", itemCode.Trim().ToUpper()) & Exp.Eq("ColorCode", colorCode.Trim().ToUpper()) & Exp.Eq("SizeCode", sizeCode.Trim().ToUpper()))
.List<ItemSpec>();
return skus == null || skus.Count <= 0 ? null : skus[0];
}
示例3: QueryBySNNumber
public static IList<ReturnHead> QueryBySNNumber(ISession session, string snNumber)
{
if (string.IsNullOrEmpty(snNumber) || snNumber.Trim().Length <= 0) return null;
return session.CreateEntityQuery<ReturnHead>()
.Where(Exp.Eq("RefOrderNumber", snNumber.Trim().ToUpper()))
.List<ReturnHead>();
}
示例4: QueryAndBindData
private void QueryAndBindData(ISession session)
{
this.repeaterControl.DataSource = session.CreateEntityQuery<OrderRuleDef>()
.OrderBy("RuleDefineID")
.List<OrderRuleDef>();
this.repeaterControl.DataBind();
}
示例5: Retrieve
internal static NotificationReceiver Retrieve(ISession session, int notifyId, string userId)
{
IList<NotificationReceiver> receivers = session.CreateEntityQuery<NotificationReceiver>()
.Where(Exp.Eq("NotifyID", notifyId) & Exp.Eq("UserID", userId))
.List<NotificationReceiver>();
return receivers == null || receivers.Count <= 0 ? null : receivers[0];
}
示例6: EffectiveList
public static IList<WHLocation> EffectiveList(ISession session)
{
return session.CreateEntityQuery<WHLocation>()
.Where(Magic.Framework.ORM.Query.Exp.Eq("Status", WHStatus.Enable))
.OrderBy("LocationCode")
.List<WHLocation>();
}
示例7: GetOpenPeriod
public static INVPeriod GetOpenPeriod(ISession session)
{
IList<INVPeriod> periods = session.CreateEntityQuery<INVPeriod>()
.Where(Exp.Eq("Status", INVPeriodStatus.Open))
.List<INVPeriod>();
return periods.Count > 0 ? periods[0] : null;
}
示例8: QueryAndBindData
private void QueryAndBindData(ISession session)
{
this.repeaterControl.DataSource = session.CreateEntityQuery<TransTypeDef>()
.OrderBy("TransTypeCode")
.List<TransTypeDef>();
this.repeaterControl.DataBind();
}
示例9: ClosedPeriods
public static IList<INVPeriod> ClosedPeriods(ISession session)
{
return session.CreateEntityQuery<INVPeriod>()
.Where(Exp.Eq("Status", INVPeriodStatus.Close))
.OrderBy("StartingDate", Order.Desc)
.List<INVPeriod>();
}
示例10: Query
public static SOHead Query(ISession session, string soNumber)
{
IList<SOHead> headers = session.CreateEntityQuery<SOHead>()
.Where(Exp.Eq("OrderNumber", soNumber))
.List<SOHead>();
return headers.Count <= 0 ? null : headers[0];
}
示例11: GetEffectiveLogistics
public static IList<Logistics> GetEffectiveLogistics(ISession session)
{
return session.CreateEntityQuery<Logistics>()
.Where(Exp.Eq("Status", LogisticsStatus.Enable))
.OrderBy("ShortName")
.List<Logistics>();
}
示例12: Retrieve
public static ItemMaster Retrieve(ISession session, string itemCode)
{
IList<ItemMaster> master = session.CreateEntityQuery<ItemMaster>()
.Where(Exp.Eq("ItemCode", itemCode))
.List<ItemMaster>();
return master == null || master.Count <= 0 ? null : master[0];
}
示例13: ReceiveFinish
public bool ReceiveFinish(ISession session, decimal rcvQty, decimal iqcQty)
{
//使用DbSession,避免并发冲突
if (rcvQty == 0M && iqcQty == 0M) return true;
if (this._lineStatus != POLineStatus.Open)
throw new Exception(string.Format("订单行({0}-{1})不是Open状态,无法进行收货", this._orderNumber, this._lineNumber));
DbSession dbSession = session.DbSession as DbSession;
System.Text.StringBuilder builder = new System.Text.StringBuilder();
builder.Append("update ")
.Append(EntityManager.GetEntityMapping(typeof(POLine)).TableName)
.Append(" set ")
.Append(EntityManager.GetPropMapping(typeof(POLine), "UnfinishedReceiveQty").ColumnName)
.Append("=")
.Append(EntityManager.GetPropMapping(typeof(POLine), "UnfinishedReceiveQty").ColumnName)
.Append("-:qty1,")
.Append(EntityManager.GetPropMapping(typeof(POLine), "IQCQty").ColumnName)
.Append("=")
.Append(EntityManager.GetPropMapping(typeof(POLine), "IQCQty").ColumnName)
.Append("+:qty2,")
.Append(EntityManager.GetPropMapping(typeof(POLine), "ReceiveQty").ColumnName)
.Append("=")
.Append(EntityManager.GetPropMapping(typeof(POLine), "ReceiveQty").ColumnName)
.Append("+:qty3 where ")
.Append(EntityManager.GetPropMapping(typeof(POLine), "OrderNumber").ColumnName)
.Append("=:ordNum and ")
.Append(EntityManager.GetPropMapping(typeof(POLine), "LineNumber").ColumnName)
.Append("=:lineNum");
IDbCommand command = dbSession.CreateSqlStringCommand(builder.ToString());
dbSession.AddParameter(command, ":qty1", EntityManager.GetPropMapping(typeof(POLine), "UnfinishedReceiveQty").DbTypeInfo, iqcQty);
dbSession.AddParameter(command, ":qty2", EntityManager.GetPropMapping(typeof(POLine), "IQCQty").DbTypeInfo, iqcQty);
dbSession.AddParameter(command, ":qty3", EntityManager.GetPropMapping(typeof(POLine), "ReceiveQty").DbTypeInfo, rcvQty);
dbSession.AddParameter(command, ":ordNum", EntityManager.GetPropMapping(typeof(POLine), "OrderNumber").DbTypeInfo, this._orderNumber);
dbSession.AddParameter(command, ":lineNum", EntityManager.GetPropMapping(typeof(POLine), "LineNumber").DbTypeInfo, this._lineNumber);
bool result = dbSession.ExecuteNonQuery(command) > 0;
//尝试自动关闭PO行,PO
if (this._receiveQty + rcvQty >= this._purchaseQty)
{
//收货数量大于等于采购数量,自动关闭PO行
//TODO: 是否采用参数配置这个动作
this._lineStatus = POLineStatus.Close;
this.Update(session, "LineStatus");
//所有PO行状态为关闭或取消,则自动关闭PO
if (session.CreateEntityQuery<POLine>()
.Where(Exp.Eq("OrderNumber", this._orderNumber) & Exp.Eq("LineStatus", POLineStatus.Open))
.Count() <= 0)
{
POHead head = POHead.Retrieve(session, this._orderNumber);
if (head != null)
{
head.Status = POStatus.Close;
head.Update(session, "Status");
}
}
}
return true;
}
示例14: Query
public static ICHead Query(ISession session, string snNumber)
{
IList<ICLine> lines = session.CreateEntityQuery<ICLine>()
.Where(Exp.Eq("RefOrderNumber", snNumber))
.List<ICLine>();
if (lines == null || lines.Count <= 0) return null;
return ICHead.Retrieve(session, lines[0].OrderNumber);
}
示例15: GetPeriod
public static INVPeriod GetPeriod(ISession session, DateTime date)
{
DateTime dt = new DateTime(date.Year, date.Month, date.Day);
IList<INVPeriod> periods = session.CreateEntityQuery<INVPeriod>()
.Where(Exp.Ge("EndDate", dt) & Exp.Le("StartingDate", dt))
.List<INVPeriod>();
return periods.Count > 0 ? periods[0] : null;
}