コード例 #1
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool InsertInfo(PlaceOfOriginInfo info)
        {
            int cnt = dal.GetCounts("[ITEM_NAME] = N'" + info.ItemName + "' and [CODE_FID] = N'" + codeFid + "'");

            if (cnt > 0)
            {
                throw new Exception("MC:0x00000085");///名称不能重复
            }
            cnt = dal.GetCounts("[ITEM_NAME_EN] = N'" + info.ItemName + "' and [CODE_FID] = N'" + codeFid + "'");
            if (cnt > 0)
            {
                throw new Exception("MC:0x00000086");///代码不能重复
            }
            CodeItemInfo codeItemInfo = new CodeItemInfo();

            codeItemInfo.Fid        = Guid.NewGuid();
            codeItemInfo.ItemNameEn = info.ItemNameEn;
            codeItemInfo.ItemName   = info.ItemName;
            codeItemInfo.Comments   = info.Comments;
            codeItemInfo.CodeFid    = Guid.Parse(codeFid);
            codeItemInfo.ValidFlag  = true;
            codeItemInfo.CreateUser = info.CreateUser;
            codeItemInfo.CreateDate = info.CreateDate;
            return(dal.Add(codeItemInfo) > 0 ? true : false);
        }
コード例 #2
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool InsertInfo(InboundTypeInfo info)
        {
            int cnt = dal.GetCounts("[ITEM_NAME] = N'" + info.ItemName + "' and [CODE_FID] = N'" + codeFid + "'");

            if (cnt > 0)
            {
                throw new Exception("MC:0x00000119");///进仓类型不能重复
            }
            string itemValue = new SeqDefineDAL().GetCurrentCode("INBOUND_TYPE_VALUE");

            cnt = dal.GetCounts("[ITEM_VALUE] = " + itemValue + " and [CODE_FID] = N'" + codeFid + "'");
            if (cnt > 0 || string.IsNullOrEmpty(itemValue))
            {
                throw new Exception("MC:0x00000119");///进仓类型不能重复
            }
            CodeItemInfo codeItemInfo = new CodeItemInfo();

            codeItemInfo.Fid        = Guid.NewGuid();
            codeItemInfo.ItemValue  = int.Parse(itemValue);
            codeItemInfo.ItemName   = info.ItemName;
            codeItemInfo.Comments   = info.Comments;
            codeItemInfo.CodeFid    = Guid.Parse(codeFid);
            codeItemInfo.ValidFlag  = true;
            codeItemInfo.CreateUser = info.CreateUser;
            codeItemInfo.CreateDate = info.CreateDate;
            return(dal.Add(codeItemInfo) > 0 ? true : false);
        }
コード例 #3
0
        /// <summary>
        /// SelectInfo
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public EquipmentTypeInfo SelectInfo(long id)
        {
            CodeItemInfo codeItemInfo = dal.GetInfo(id);

            if (codeItemInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            EquipmentTypeInfo equipmentTypeInfo = new EquipmentTypeInfo();

            equipmentTypeInfo.Id         = codeItemInfo.Id;
            equipmentTypeInfo.ItemName   = codeItemInfo.ItemName;
            equipmentTypeInfo.Comments   = codeItemInfo.Comments;
            equipmentTypeInfo.ValidFlag  = codeItemInfo.ValidFlag.GetValueOrDefault();
            equipmentTypeInfo.CreateUser = codeItemInfo.CreateUser;
            equipmentTypeInfo.CreateDate = codeItemInfo.CreateDate.GetValueOrDefault();
            return(equipmentTypeInfo);
        }
コード例 #4
0
        /// <summary>
        /// SelectInfo
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public PartGroupInfo SelectInfo(long id)
        {
            CodeItemInfo codeItemInfo = dal.GetInfo(id);

            if (codeItemInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            PartGroupInfo partTypeInfo = new PartGroupInfo();

            partTypeInfo.Id         = codeItemInfo.Id;
            partTypeInfo.ItemName   = codeItemInfo.ItemName;
            partTypeInfo.Comments   = codeItemInfo.Comments;
            partTypeInfo.ValidFlag  = codeItemInfo.ValidFlag.GetValueOrDefault();
            partTypeInfo.CreateUser = codeItemInfo.CreateUser;
            partTypeInfo.CreateDate = codeItemInfo.CreateDate.GetValueOrDefault();
            return(partTypeInfo);
        }
コード例 #5
0
        /// <summary>
        /// SelectInfo
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public InboundTypeInfo SelectInfo(long id)
        {
            CodeItemInfo codeItemInfo = dal.GetInfo(id);

            if (codeItemInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            InboundTypeInfo inboundTypeInfo = new InboundTypeInfo();

            inboundTypeInfo.Id         = codeItemInfo.Id;
            inboundTypeInfo.ItemValue  = codeItemInfo.ItemValue.GetValueOrDefault();
            inboundTypeInfo.ItemName   = codeItemInfo.ItemName;
            inboundTypeInfo.Comments   = codeItemInfo.Comments;
            inboundTypeInfo.ValidFlag  = codeItemInfo.ValidFlag.GetValueOrDefault();
            inboundTypeInfo.CreateUser = codeItemInfo.CreateUser;
            inboundTypeInfo.CreateDate = codeItemInfo.CreateDate.GetValueOrDefault();
            return(inboundTypeInfo);
        }
コード例 #6
0
        /// <summary>
        /// SelectInfo
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public BusinessAccountProjectInfo SelectInfo(long id)
        {
            CodeItemInfo codeItemInfo = dal.GetInfo(id);

            if (codeItemInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            BusinessAccountProjectInfo businessAccountProjectInfo = new BusinessAccountProjectInfo();

            businessAccountProjectInfo.Id         = codeItemInfo.Id;
            businessAccountProjectInfo.ItemNameEn = codeItemInfo.ItemNameEn;
            businessAccountProjectInfo.ItemName   = codeItemInfo.ItemName;
            businessAccountProjectInfo.Comments   = codeItemInfo.Comments;
            businessAccountProjectInfo.ValidFlag  = codeItemInfo.ValidFlag.GetValueOrDefault();
            businessAccountProjectInfo.CreateUser = codeItemInfo.CreateUser;
            businessAccountProjectInfo.CreateDate = codeItemInfo.CreateDate.GetValueOrDefault();
            return(businessAccountProjectInfo);
        }
コード例 #7
0
        /// <summary>
        /// SelectInfo
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public CurrencyInfo SelectInfo(long id)
        {
            CodeItemInfo codeItemInfo = dal.GetInfo(id);

            if (codeItemInfo == null)
            {
                throw new Exception("MC:0x00000084");///数据错误
            }
            CurrencyInfo currencyInfo = new CurrencyInfo();

            currencyInfo.Id         = codeItemInfo.Id;
            currencyInfo.ItemName   = codeItemInfo.ItemName;
            currencyInfo.ItemNameEn = codeItemInfo.ItemNameEn;
            currencyInfo.Comments   = codeItemInfo.Comments;
            currencyInfo.ValidFlag  = codeItemInfo.ValidFlag.GetValueOrDefault();
            currencyInfo.CreateUser = codeItemInfo.CreateUser;
            currencyInfo.CreateDate = codeItemInfo.CreateDate.GetValueOrDefault();
            return(currencyInfo);
        }
コード例 #8
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool InsertInfo(InspectionModeInfo info)
        {
            int cnt = dal.GetCounts("[ITEM_NAME] = N'" + info.ItemName + "' and [CODE_FID] = N'" + codeFid + "'");

            if (cnt > 0)
            {
                throw new Exception("MC:0x00000327");///贸易方式不能重复
            }
            CodeItemInfo codeItemInfo = new CodeItemInfo();

            codeItemInfo.Fid        = Guid.NewGuid();
            codeItemInfo.ItemName   = info.ItemName;
            codeItemInfo.ItemValue  = dal.GetMaxValue(Guid.Parse(codeFid)) + 10;
            codeItemInfo.Comments   = info.Comments;
            codeItemInfo.CodeFid    = Guid.Parse(codeFid);
            codeItemInfo.ValidFlag  = true;
            codeItemInfo.CreateUser = info.CreateUser;
            codeItemInfo.CreateDate = info.CreateDate;
            return(dal.Add(codeItemInfo) > 0 ? true : false);
        }
コード例 #9
0
        /// <summary>
        /// InsertInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public long InsertInfo(CodeItemInfo info)
        {
            int cnt = dal.GetCounts("[CODE_FID] = N'" + info.CodeFid.GetValueOrDefault() + "' and [ITEM_VALUE] = " + info.ItemValue.GetValueOrDefault() + "");

            if (cnt > 0)
            {
                throw new Exception("MC:0x00000009");///不允许相同代码出现在同一系统代码集中
            }
            cnt = dal.GetCounts("[CODE_FID] = N'" + info.CodeFid.GetValueOrDefault() + "' and [ITEM_NAME] = N'" + info.ItemName + "'");
            if (cnt > 0)
            {
                throw new Exception("MC:0x00000009");///不允许相同代码出现在同一系统代码集中
            }
            cnt = dal.GetCounts("[CODE_FID] = N'" + info.CodeFid.GetValueOrDefault() + "' and [ITEM_NAME_EN] = N'" + info.ItemNameEn + "'");
            if (cnt > 0)
            {
                throw new Exception("MC:0x00000009");///不允许相同代码出现在同一系统代码集中
            }
            return(dal.Add(info));
        }