Пример #1
0
        private LabelRule convertToObjFromMaintainInfo(LabelRule obj, LabelRuleMaintainInfo temp)
        {
            obj.TemplateName = temp.TemplateName;

            return obj;
        }
Пример #2
0
        private LabelRuleMaintainInfo convertToMaintainInfoFromObj(LabelRule temp)
        {
            LabelRuleMaintainInfo labelRule = new LabelRuleMaintainInfo();

            labelRule.RuleID = temp.RuleID;
            labelRule.TemplateName = temp.TemplateName;

            return labelRule;
        }
Пример #3
0
        public IList<LabelRuleMaintainInfo> getLabelRuleByTemplateName(string strTemplateName)
        {
            IList<LabelRuleMaintainInfo> labelRuleList = new List<LabelRuleMaintainInfo>();
            try
            {
                IList<LabelRule> tmpLabelRuleList = labelTypeRepository.GetLabelRuleByTemplateName(strTemplateName);

                foreach (LabelRule temp in tmpLabelRuleList)
                {
                    LabelRuleMaintainInfo labelRule = new LabelRuleMaintainInfo();

                    labelRule = convertToMaintainInfoFromObj(temp);

                    labelRuleList.Add(labelRule);
                }

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

            return labelRuleList;
        }
Пример #4
0
        public int AddLabelRule(LabelRuleMaintainInfo infoLabelRule)
        {
            FisException ex;
            List<string> paraError = new List<string>();
            try
            {

                LabelRule labelRuleObj = new LabelRule();
                labelRuleObj = convertToObjFromMaintainInfo(labelRuleObj, infoLabelRule);

                IUnitOfWork work = new UnitOfWork();

                labelTypeRepository.AddLabelRuleDefered(work, labelRuleObj);

                work.Commit();
                return labelRuleObj.RuleID;

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
Пример #5
0
 protected void btnAdd1_Click(object sender, System.EventArgs e)
 {
     string ruleid;
     try
     {
         LabelRuleMaintainInfo tmp = new LabelRuleMaintainInfo();
         tmp.TemplateName = this.valTemplate.Text;
         ruleid = iLabelSettingManager.AddLabelRule(tmp).ToString();
         bindRules();
     }
     catch (FisException ex)
     {
         showErrorMessage(ex.mErrmsg);
         return;
     }
     catch (Exception ex)
     {
         //show error
         showErrorMessage(ex.Message);
         return;
     }
     ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "Add1Complete", "Add1Complete(\"" + ruleid + "\");", true);
 }