示例#1
0
        private PartTypeMappingMaintainInfo convertToMaintainInfoFromObj(PartTypeMapping temp)
        {
            PartTypeMappingMaintainInfo part = new PartTypeMappingMaintainInfo();

            part.ID = temp.ID;
            part.SAPType = temp.SAPType;
            part.FISType = temp.FISType;
            part.Editor = temp.Editor;
            part.Cdt = temp.Cdt;
            part.Udt = temp.Udt;

            return part;
        }
示例#2
0
        private PartTypeMapping convertToObjFromMaintainInfo(PartTypeMappingMaintainInfo temp)
        {
            PartTypeMapping part = new PartTypeMapping();

            part.ID = temp.ID;
            part.FISType = temp.FISType;
            part.SAPType = temp.SAPType;
            part.Editor = temp.Editor;
            part.Cdt = part.Cdt;
            part.Udt = part.Udt;

            return part;
        }
示例#3
0
        public void SavePartTypeMapping(PartTypeMappingMaintainInfo Object)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                IList<int> lstId = new List<int>();
                int count;
                count = partRepository.CheckExistedSAPType(Object.FISType, Object.SAPType, Object.ID.ToString());
                //检查SAPType的内容是否已和该PartType的其他某个SAPType相同。若是,则提示异常。
                if (count > 0)
                {
                    ex = new FisException("DMT021", paraError);
                    throw ex;
                }
                else//==1,保存
                {
                    PartTypeMapping objPartTypeMapping = convertToObjFromMaintainInfo(Object);

                    IUnitOfWork work = new UnitOfWork();

                    partRepository.SavePartTypeMappingDefered(work, objPartTypeMapping);

                    work.Commit();
                }

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
示例#4
0
        public void DeletePartTypeMapping(string strId)
        {
            try
            {
                PartTypeMappingMaintainInfo tmpMaintainInfo = new PartTypeMappingMaintainInfo();
                tmpMaintainInfo.ID = Int32.Parse(strId);

                PartTypeMapping objPartTypeMapping = convertToObjFromMaintainInfo(tmpMaintainInfo);

                IUnitOfWork work = new UnitOfWork();

                partRepository.DeletePartTypeMappingDefered(work, objPartTypeMapping);

                work.Commit();
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
示例#5
0
        public IList<PartTypeMappingMaintainInfo> GetPartTypeMappingList(string PartType)
        {
            IList<PartTypeMappingMaintainInfo> partTypeMappingList = new List<PartTypeMappingMaintainInfo>();
            try
            {
                IList<PartTypeMapping> tmpPartTypeMappingList = partRepository.GetPartTypeMappingList(PartType);

                foreach (PartTypeMapping temp in tmpPartTypeMappingList)
                {
                    PartTypeMappingMaintainInfo partTypeMapping = new PartTypeMappingMaintainInfo();

                    partTypeMapping = convertToMaintainInfoFromObj(temp);

                    partTypeMappingList.Add(partTypeMapping);
                }

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }

            return partTypeMappingList;
        }