private LabelRule convertToObjFromMaintainInfo(LabelRule obj, LabelRuleMaintainInfo temp) { obj.TemplateName = temp.TemplateName; return obj; }
private LabelRuleMaintainInfo convertToMaintainInfoFromObj(LabelRule temp) { LabelRuleMaintainInfo labelRule = new LabelRuleMaintainInfo(); labelRule.RuleID = temp.RuleID; labelRule.TemplateName = temp.TemplateName; return labelRule; }
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; }
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; } }
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); }