public ProjectInfo GetModel(string guid) { Model.tPrjectInfo pi = new BLL.tPrjectInfo().GetModel(guid); if (pi != null) { return(new ProjectInfo(pi)); } return(null); }
// // GET: /Lamp/Main/ public ActionResult Index() { #region 加载左侧所有主机信息 LumluxSSYDB.Model.tUserInfoes ui = new LumluxSSYDB.Model.tUserInfoes(); LumluxSSYDB.BLL.tUserInfoes uiBll = new LumluxSSYDB.BLL.tUserInfoes(); ui = uiBll.GetModel(UserID); ViewBag.ConfigMap = ui.sRemark; ViewBag.PrjectGUID = PrjGUID; BLL.tHostInfo bllhost = new BLL.tHostInfo(); MainViewModel mainVM = new MainViewModel(); BLL.tPrjectInfo tp = new BLL.tPrjectInfo(); Model.tPrjectInfo tp_mod = tp.GetModel(PrjGUID); if (tp_mod != null) { mainVM.MapCenterLat = tp_mod.fLat.ToString(); mainVM.MapCenterLng = tp_mod.fLng.ToString(); } //mainVM.MapCenterLat = GetLat("Prject_CenterPoint_Lat"); //mainVM.MapCenterLng = GetLng("Prject_CenterPoint_Lng"); DataTable allhostdt = bllhost.GetHostInfo("dbo.tHostInfo.sProjectInfoGUID='" + PrjGUID + "'"); if (allhostdt != null) { allhostdt.Columns.Add("hostByLightCount"); allhostdt.Columns.Add("hostByAlarmLightCount"); HostInfoVM hvm; foreach (DataRow dr in allhostdt.Rows) { hvm = addInfo(dr); mainVM.HostInfos.Add(hvm); } } #endregion #region 获取当前项目的标题 ViewBag.Title = ToString(GetSetValue("MainTitle", "sValue")) == "" ? "无标题,请联系管理员..." : ToString(GetSetValue("MainTitle", "sValue")); #endregion ViewData["Message"] = "WW"; return(View(mainVM)); }