Beispiel #1
0
        public IList<LabelTypeMaintainInfo> getLableTypeList()
        {
            IList<LabelTypeMaintainInfo> labelTypeList = new List<LabelTypeMaintainInfo>();
            try
            {
                IList<LabelType> tmpLabelTypeList = labelTypeRepository.GetLabelTypeList();

                foreach (LabelType temp in tmpLabelTypeList)
                {
                    LabelTypeMaintainInfo labelType = new LabelTypeMaintainInfo();

                    labelType = convertToMaintainInfoFromObj(temp);

                    labelTypeList.Add(labelType);
                }

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

            return labelTypeList;
        }
Beispiel #2
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;
            }
        }
Beispiel #3
0
    /// <summary>
    /// labelType的保存按钮按下时触发的事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSaveLabelType_Click(Object sender, EventArgs e)
    {
        try
        {
            LabelTypeMaintainInfo tmpLabelTypeInfo = new LabelTypeMaintainInfo();


            tmpLabelTypeInfo.LabelType = txtLabelType.Text;
            tmpLabelTypeInfo.PrintMode = Int32.Parse(selPrintMode.SelectedValue);
            tmpLabelTypeInfo.RuleMode = Int32.Parse(selRuleMode.SelectedValue);
            tmpLabelTypeInfo.Description = txtDescription1.Text;
            tmpLabelTypeInfo.Editor = editor;

            //如果txtLabelType内容没变, 表示将来需要通过hidLabelType保存
            if (hidLabelType.Value == txtLabelType.Text)
            {
                iLabelSettingManager.SaveLabelType(tmpLabelTypeInfo);
            }
            //否则,做新增
            else
            {
                iLabelSettingManager.AddLabelType(tmpLabelTypeInfo);
            }


            bindLabelTypeTable();
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        this.updatePanel1.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "Add1Complete", "Add1Complete(\"" + txtLabelType.Text + "\"); resetTableHeight();", true);
    }
Beispiel #4
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;
        }
Beispiel #5
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;
        }
Beispiel #6
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;
            }
        }