zoukankan      html  css  js  c++  java
  • EAS 最大单据号获取

    BaseService

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using EAS.Data.Access;
    
    namespace Drug.BLL
    {
        public class ContextDataAccessor
        {
            public static EAS.Data.Access.IDataAccessor DataAccessor
            {
                get
                {
                    return EAS.Context.ContextHelper.GetContext().Container.GetComponentInstance("DataAccessor") as EAS.Data.Access.IDataAccessor;
                }
            }
    
            public static string  IndetitySQL
            {
                get
                {
                    StringBuilder sql = new StringBuilder();
                    sql.Append(" update dbo.EAS_IDENTITYVALUES Set ITEMVALUE = ITEMVALUE + 1 where ITEMKEY = @ITEMKEY ");
                    sql.Append(" select ITEMVALUE from dbo.EAS_IDENTITYVALUES where ITEMKEY = @ITEMKEY  ");
                    return sql.ToString();
                }
            }
        }
    }

    获取最大号接口

    using System;
    
    namespace Drug.BLL
    {
        public interface IMaxID
        {
            int GetMaxID(string table);
        }
    }

    获取最大号服务

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using EAS.Services;
    using EAS.Data.Access;
    using EAS.Transactions;
    
    namespace Drug.BLL
    {
        [ServiceBind(typeof(IMaxID))]
        public class MaxID : IMaxID
        {
            [Transaction(System.Transactions.IsolationLevel.Serializable)]
            public int GetMaxID(string itemKey)
            {
                ParameterCollection pc = new ParameterCollection();
                pc.Add("ITEMKEY", itemKey);
                return (int)(ContextDataAccessor.DataAccessor.Query(ContextDataAccessor.IndetitySQL, pc));
            }
        }
    }
  • 相关阅读:
    搞明白这八个问题,Linux系统就好学多了
    Fedora 25 Alpha版本今天发布啦
    Linux新手应掌握的10个基本命令
    PC-BSD 换名 TrueOS
    JPA+Springboot实现分页效果
    陈亮
    押尾光太郎
    岸部真明
    面试必备-网络的七层协议
    JavaScript中的快速排序
  • 原文地址:https://www.cnblogs.com/docomo/p/3341041.html
Copyright © 2011-2022 走看看