当前位置: 首页>>代码示例>>C#>>正文


C# ISession.CreateEntityQuery方法代码示例

本文整理汇总了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();
        }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:11,代码来源:INVCheckBusiness.cs

示例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];
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:ItemSpecImpl.cs

示例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>();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:ReturnHeadImpl.cs

示例4: QueryAndBindData

 private void QueryAndBindData(ISession session)
 {
     this.repeaterControl.DataSource = session.CreateEntityQuery<OrderRuleDef>()
         .OrderBy("RuleDefineID")
         .List<OrderRuleDef>();
     this.repeaterControl.DataBind();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:OrderNumberRuleDefManager.aspx.cs

示例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];
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:NotificationReceiverImpl.cs

示例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>();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:WHLocationImpl.cs

示例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;
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:INVPeriodImpl.cs

示例8: QueryAndBindData

 private void QueryAndBindData(ISession session)
 {
     this.repeaterControl.DataSource = session.CreateEntityQuery<TransTypeDef>()
         .OrderBy("TransTypeCode")
         .List<TransTypeDef>();
     this.repeaterControl.DataBind();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:TransTypeDefManager.aspx.cs

示例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>();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:INVPeriodImpl.cs

示例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];
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:SOHead.cs

示例11: GetEffectiveLogistics

 public static IList<Logistics> GetEffectiveLogistics(ISession session)
 {
     return session.CreateEntityQuery<Logistics>()
         .Where(Exp.Eq("Status", LogisticsStatus.Enable))
         .OrderBy("ShortName")
         .List<Logistics>();
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:LogisticsImpl.cs

示例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];
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:7,代码来源:ItemMasterImpl.cs

示例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;
        }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:59,代码来源:POLineImpl.cs

示例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);
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:8,代码来源:ICHeadImpl.cs

示例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;
 }
开发者ID:XtremeKevinChow,项目名称:rdroad,代码行数:8,代码来源:INVPeriodImpl.cs


注:本文中的ISession.CreateEntityQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。