Ejemplo n.º 1
0
        //
        // 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));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LumluxSSYDB.Model.tPrjectInfo model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 public ProjectInfo(Model.tPrjectInfo p)
 {
     tProjectInfo = p;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(LumluxSSYDB.Model.tPrjectInfo model)
 {
     return(dal.Add(model));
 }