예제 #1
0
        private LabelType convertToObjFromMaintainInfo(LabelType obj, LabelTypeMaintainInfo temp)
        {
            obj.LblType = temp.LabelType;
            obj.PrintMode = temp.PrintMode;
            obj.RuleMode = temp.RuleMode;
            obj.Description = temp.Description;
            obj.Editor = temp.Editor;

            return obj;
        }
예제 #2
0
        private LabelTypeMaintainInfo convertToMaintainInfoFromObj(LabelType temp)
        {
            LabelTypeMaintainInfo labelType = new LabelTypeMaintainInfo();

            labelType.LabelType = temp.LblType;
            labelType.PrintMode = temp.PrintMode;
            labelType.RuleMode = temp.RuleMode;
            labelType.Description = temp.Description;
            labelType.Editor = temp.Editor;
            labelType.Cdt = temp.Cdt;
            labelType.Udt = temp.Udt;

            return labelType;
        }
예제 #3
0
        public void AddLabelType(LabelTypeMaintainInfo infoLabelType)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                //检查是否已存在相同的Process
                if (labelTypeRepository.CheckExistedLabelType(infoLabelType.LabelType) > 0)
                {
                    ex = new FisException("DMT132", paraError);
                    throw ex;

                }
                else
                {
                    LabelType labelTypeObj = new LabelType();
                    labelTypeObj = convertToObjFromMaintainInfo(labelTypeObj, infoLabelType);

                    IUnitOfWork work = new UnitOfWork();

                    labelTypeRepository.AddLabelTypeDefered(work, labelTypeObj);

                    work.Commit();
                }

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
예제 #4
0
        public void SaveLabelType(LabelTypeMaintainInfo infoLabelType)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                LabelType labelTypeObj = new LabelType();
                labelTypeObj = convertToObjFromMaintainInfo(labelTypeObj, infoLabelType);

                IUnitOfWork work = new UnitOfWork();

                labelTypeRepository.SaveLabelTypeDefered(work, labelTypeObj);

                work.Commit();

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