예제 #1
0
        /// <summary>
        /// 获取预案列表
        /// </summary>
        /// <param name="sw">sw</param>
        /// <param name="org">org</param>
        /// <returns></returns>
        public static IEnumerable <JC_FIRE_PLAN_Model> getModelList(JC_FIRE_PLAN_SW sw, string org = "")
        {
            var result = new List <JC_FIRE_PLAN_Model>();

            DataTable dt = BaseDT.JC_FIRE_PLAN.getDT(sw);//列表

            DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                                               //获取单位
            DataTable dtFIRELEVEL = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW {
                DICTTYPEID = "22"
            });                                                                                     //火险等级

            if (dt != null)
            {
                ArrayList aList = new ArrayList();
                if (PublicCls.OrgIsZhen(org))//乡镇
                {
                    aList.Add(org);
                }
                aList.Add(PublicCls.getXianIncOrgNo(org) + "000");  //县
                aList.Add(PublicCls.getShiIncOrgNo(org) + "00000"); //市
                for (int i = 0; i < aList.Count; i++)
                {
                    DataRow[] arrayDR = dt.Select(string.Format("BYORGNO='{0}'", aList[i].ToString()));
                    var       list    = GetYAList(arrayDR, dtORG, dtFIRELEVEL, org);
                    result.AddRange(list);
                }
            }

            dt.Clear();
            dt.Dispose();
            dtFIRELEVEL.Clear();
            dtFIRELEVEL.Dispose();
            dtFIRELEVEL.Clear();
            dtFIRELEVEL.Dispose();
            return(result);
        }