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));
            }
        }
    }
  • 相关阅读:
    回头再看libpcap
    lex error
    perl 的威力
    什么叫回流和重绘?
    HTTP协议与FTP协议的区别【转】
    Linux操作系统Redhat系列与Debian系列 【转】
    dock是什么? docker就是集装箱原理【转】
    光端机的作用【转】
    c++ -- call_once用法
    c++ -- thread详细解析
  • 原文地址:https://www.cnblogs.com/docomo/p/3341041.html
Copyright © 2011-2022 走看看