示例#1
0
    /// <summary>
    /// functionTree保存按钮按下时触发的事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void btnSaveTree_Click(Object sender, EventArgs e)
    {
        try
        {
            for (int i = 0; i < TreeView1.CheckedNodes.Count; i++)
            {
                if (TreeView1.CheckedNodes[i].ChildNodes.Count > 0)
                {
                    TreeView1.CheckedNodes.RemoveAt(i);
                    i--;
                }

            }

            if (TreeView1.CheckedNodes.Count == 0)
            {
                //return;
            }

            IList<string> lstCheckedNode = new List<string>();
            for (int i = 0; i < TreeView1.CheckedNodes.Count; i++)
            {
                lstCheckedNode.Add(TreeView1.CheckedNodes[i].Value);
            }

            PCodeLabelTypeMaintainInfo pCodeLabelType = new PCodeLabelTypeMaintainInfo();
            pCodeLabelType.LabelType = hidLabelType.Value;
            iLabelSettingManager.SavePCode(lstCheckedNode, pCodeLabelType);
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
            return;
        }
        catch (Exception ex)
        {
            //show error
            showErrorMessage(ex.Message);
            return;
        }
        this.updatePanel1.Update();
        this.updatePanel2.Update();
        ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "Add1Complete", "Add1Complete(\"" + txtLabelType.Text + "\"); resetTableHeight();DealHideWait();", true);

    }
示例#2
0
        private PCodeLabelType convertToObjFromMaintainInfo(PCodeLabelType obj, PCodeLabelTypeMaintainInfo temp)
        {
            obj.LabelType = temp.LabelType;
            obj.PCode = temp.PCode;

            return obj;
        }
示例#3
0
        public void SavePCode(IList<string> arrCheckedPCode, PCodeLabelTypeMaintainInfo PCodeLabelTypeInfo)
        {
            try
            {

                IUnitOfWork work = new UnitOfWork();
                labelTypeRepository.DeletePCodeByLabelTypeDefered(work, PCodeLabelTypeInfo.LabelType);

                for (int i = 0; i < arrCheckedPCode.Count(); i++)
                {
                    PCodeLabelType pCodeLabelTypeObj = new PCodeLabelType();


                    pCodeLabelTypeObj = convertToObjFromMaintainInfo(pCodeLabelTypeObj, PCodeLabelTypeInfo);

                    pCodeLabelTypeObj.PCode = arrCheckedPCode[i];

                    labelTypeRepository.SavePCodeDefered(work, pCodeLabelTypeObj);

                }

                work.Commit();

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
示例#4
0
        private PCodeLabelTypeMaintainInfo convertToMaintainInfoFromObj(PCodeLabelType temp)
        {
            PCodeLabelTypeMaintainInfo pCodeLabelType = new PCodeLabelTypeMaintainInfo();

            pCodeLabelType.LabelType = temp.LabelType;
            pCodeLabelType.PCode = temp.PCode;

            return pCodeLabelType;
        }
示例#5
0
        public IList<PCodeLabelTypeMaintainInfo> getPCodeByLabelType(string strLabelType)
        {
            IList<PCodeLabelTypeMaintainInfo> pCodeLabelTypeList = new List<PCodeLabelTypeMaintainInfo>();
            try
            {
                IList<PCodeLabelType> tmpPCodeLabelTypeList = labelTypeRepository.GetPCodeByLabelType(strLabelType);

                foreach (PCodeLabelType temp in tmpPCodeLabelTypeList)
                {
                    PCodeLabelTypeMaintainInfo pCodeLabelType = new PCodeLabelTypeMaintainInfo();

                    pCodeLabelType = convertToMaintainInfoFromObj(temp);

                    pCodeLabelTypeList.Add(pCodeLabelType);
                }

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

            return pCodeLabelTypeList;
        }