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));
            }
        }
    }
  • 相关阅读:
    浅谈Objeact.clone克隆(纯个人理解,如有错误请指正)
    Spring集成Swagger,Java自动生成Api文档
    Spring @Value注入值失败,错误信息提示:Could not resolve placeholder
    触发器
    存储过程
    JavaEE笔记(十四)
    JavaEE笔记(十三)
    JavaEE笔记(十二)
    JavaEE笔记(十一)
    vue相关面试知识点总结
  • 原文地址:https://www.cnblogs.com/docomo/p/3341041.html
Copyright © 2011-2022 走看看