Пример #1
0
        // 递归树形
        public static string ComboPdrList(t_CM_Area model)
        {
            pdermsWebEntities bll   = new pdermsWebEntities();
            string            res_s = "";

            //你想要在视图中得到的值
            res_s += "{\"id\":\"" + model.AreaID + "\",\"text\":\"" + model.AreaName + "\"";

            IList <t_CM_Area> list = bll.t_CM_Area.Where(c => c.ParentID == model.AreaID).ToList();

            if (list != null && list.Count > 0)
            {
                res_s += "," + "\"children\":[";
                for (int i = 0; i < list.Count; i++)
                {
                    if (i > 0)
                    {
                        res_s += ",";
                    }
                    res_s += ComboPdrList(list[i]);
                }
                res_s += "]";
            }
            ;
            res_s += "}";
            return(res_s);
        }
Пример #2
0
 public PDRInfo2(t_CM_PDRInfo pdrInfo, t_CM_Constract constract, string Mobilephone, t_CM_Area area, t_ES_ElecVoltage vmodel, t_CM_Unit unit, t_ES_Industry ind)
 {
     // TODO: Complete member initialization
     this.pdrInfo     = pdrInfo;
     this.constract   = constract;
     this.Mobilephone = Mobilephone;
     this.area        = area;
     this.vmodel      = vmodel;
     this.unit        = unit;
     this.ind         = ind;
 }