コード例 #1
0
        public JsonResult AllMarkers()
        {
            List <Marker> devices = new List <Marker>();

            try
            {
                devices = repo.GetAllMarkers().ToList();
            }
            catch (Exception ex)
            {
                LogMessage message = new LogMessage()
                {
                    Id          = -1,
                    MessageDate = DateTime.Now,
                    UserName    = User.Identity.Name,
                    MessageType = "error",
                    MessageText = ex.Message + ex.StackTrace
                };

                loger.LogToFile(message);
                loger.LogToDatabase(message);
            }

            return(Json(devices, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
ファイル: ReportController.cs プロジェクト: radevon/unicom
        //
        // GET: /Report/

        public ActionResult Index()
        {
            List <Marker> objects = repo_.GetAllMarkers().OrderBy(x => x.Address).ToList();
            ReportSource  rc      = new ReportSource();

            rc.Adresses = objects.Select(x => new SelectListItem()
            {
                Text = x.Address, Value = x.Identity
            }).ToList();

            return(View("ReportIndex", rc));
        }