• 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));
            }
        }
    }
  • 相关阅读:
    装饰器
    函数对象与闭包
    名称空间与作用域
    函数的参数
    函数的基本使用
    ${}与#{}的区别
    thymeleaf之日期格式化
    template might not exist or might not be accessible by any of the configured Template Resolvers
    springboot使用@Scheduled之cron表达式详解
    自定义springboot项目启动图案
  • 原文地址:https://www.cnblogs.com/docomo/p/3341041.html
Copyright © 2020-2023  润新知