Пример #1
0
        public void SetZuMiaoShu()
        {
            IList <XZDM> xzdms = XZDMCustom.GetXzdms(DJZQDM);
            string       str   = "1";

            for (int a = 2; a < xzdms.Count; a++)
            {
                str = str + "、" + a;
            }
            ZuToatal = str;
        }
Пример #2
0
        /// <summary>
        /// 集体所有权转 行政代码
        /// </summary>
        /// <param name="jtsyqs"></param>
        /// <returns></returns>
        public static IList <XZDM> JTSYQToXZDM(IList <JTSYQ> jtsyqs)
        {
            IList <XZDM> xzdms = XZDMCustom.GetExcelXZDM();
            IList <XZDM> list  = new List <XZDM>();

            IList <JTSYQ> jtsqyGroups = JTSYQCustom.GroupByZu(jtsyqs);

            // Dictionary<string, IList<JTSYQ>> jtsyqDic = Utils.GetGroupDicToList("BM", jtsyqs);
            Dictionary <string, XZDM> xzdmsDic = Utils.GetGroupDic("DJZQDM", xzdms);
            XZDM xzdm;

            foreach (JTSYQ groupJTSYQ in jtsqyGroups)
            {
                string bm = groupJTSYQ.BM;
                if (bm.EndsWith("JA00998"))
                {
                }

                if (!xzdmsDic.TryGetValue(bm.Replace("JA000", ""), out xzdm))
                {
                    if (bm.Contains("99"))
                    {
                        bm = bm.Substring(0, 12);
                        if (!xzdmsDic.TryGetValue(bm, out xzdm))
                        {
                            if (!xzdmsDic.TryGetValue(bm.Substring(0, 9), out xzdm))
                            {
                                xzdm = null;
                            }
                        }
                    }
                }
                if (xzdm != null)
                {
                    xzdm.JTSYQS = groupJTSYQ.GroupJTSYQ;
                    xzdm.JTSYQ  = groupJTSYQ;
                    //list.Add(xzdm);
                }
            }

            return(xzdmsDic.Values.ToList());
        }