/// <summary> /// 填充解码ElTransCode /// </summary> /// <param name="cpid"></param> /// <returns></returns> protected ElTransCode[] transElCode(string cpid) { Model.ElementRelation[] mEleTransSetType = dbll.DecordeDataSetType(cpid); int countEleTransType = mEleTransSetType.Length; ElTransCode[] elTrans = new ElTransCode[countEleTransType]; for (int i = 0; i < countEleTransType; i++) { elTrans[i] = new ElTransCode(); List <ElCode> elTransCH = new List <ElCode>(); int typeID = mEleTransSetType[i].ElementCodeType; Model.ElementRelation[] mDataSet = dbll.DecordeDataSet(typeID.ToString()); elTrans[i].ElementCodeType = typeID; for (int j = 0; j < mDataSet.Length; j++) { ElCode elCode = new ElCode(); elCode.ElementCode = mDataSet[j].ElementCode.ToString(); elCode.TransCodeCH = mDataSet[j].TransCodeName; elTransCH.Add(elCode); } elTrans[i].ELementCode = elTransCH; } return(elTrans); }
protected ArrayList transCodeArrayList(string cpid) { Model.ElementRelation[] mDataSetType = dbll.DecordeDataSetType(cpid); int countDataType = mDataSetType.Length; ArrayList[] alDataSetType = new ArrayList[countDataType]; Hashtable[] htDataSet = new Hashtable[countDataType]; for (int i = 0; i < mDataSetType.Length; i++) { string typeID = mDataSetType[i].ElementCodeType.ToString(); alDataSetType[i] = new ArrayList(); alDataSetType[i].Add(typeID); htDataSet[i] = new Hashtable(); Model.ElementRelation[] mDataSet = dbll.DecordeDataSet(typeID); for (int j = 0; j < mDataSet.Length; j++) { htDataSet[i].Add(mDataSet[j].ElementCode.ToString(), mDataSet[j].TransCodeName); } alDataSetType[i].Add(htDataSet[i]); alTransCode.Add(alDataSetType[i]); } return(alTransCode); }