コード例 #1
0
ファイル: LabelSettingManager.cs プロジェクト: wra222/testgit
 private PrintTemplate convertToObjFromMaintainInfo(PrintTemplate obj, PrintTemplateMaintainInfo temp)
 {
     obj.TemplateName = temp.TemplateName;
     obj.LblType = temp.LabelType;
     obj.Piece = temp.Piece;
     obj.SpName = temp.SpName;
     obj.Layout = temp.Layout;
     obj.Description = temp.Description;
     obj.Editor = temp.Editor;
     return obj;
 }
コード例 #2
0
ファイル: LabelSettingManager.cs プロジェクト: wra222/testgit
        public void SavePrintTemplate(PrintTemplateMaintainInfo infoPrintTemplate)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                PrintTemplate printTemplateObj = new PrintTemplate();
                printTemplateObj = convertToObjFromMaintainInfo(printTemplateObj, infoPrintTemplate);
                IUnitOfWork work = new UnitOfWork();
                labelTypeRepository.SavePrintTemplateDefered(work, printTemplateObj);
                work.Commit();

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
コード例 #3
0
ファイル: LabelSettingManager.cs プロジェクト: wra222/testgit
        private PrintTemplateMaintainInfo convertToMaintainInfoFromObj(PrintTemplate temp)
        {
            PrintTemplateMaintainInfo printTemplate = new PrintTemplateMaintainInfo();

            printTemplate.LabelType = temp.LblType;
            printTemplate.TemplateName = temp.TemplateName;
            printTemplate.SpName = temp.SpName;
            printTemplate.Piece = temp.Piece;
            printTemplate.Layout = temp.Layout;
            printTemplate.Description = temp.Description;
            printTemplate.Editor = temp.Editor;
            printTemplate.Cdt = temp.Cdt;
            printTemplate.Udt = temp.Udt;

            return printTemplate;
        }
コード例 #4
0
ファイル: LabelSettingManager.cs プロジェクト: wra222/testgit
        public void AddPrintTemplate(PrintTemplateMaintainInfo infoPrintTemplate)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {
                //检查是否已存在相同的Process
                if (labelTypeRepository.CheckExistedTemplateName(infoPrintTemplate.TemplateName) > 0)
                {
                    ex = new FisException("DMT134", paraError);
                    throw ex;
                }
                else
                {
                    PrintTemplate printTemplateObj = new PrintTemplate();
                    printTemplateObj = convertToObjFromMaintainInfo(printTemplateObj, infoPrintTemplate);
                    IUnitOfWork work = new UnitOfWork();
                    labelTypeRepository.AddPrintTemplateDefered(work, printTemplateObj);
                    work.Commit();
                }

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