Exemple #1
0
        public ActionResult SaveMonitorPointPosition(int id, int left, int top, int typeId, int originalId)
        {
            MonitorPoint point = null;
            string       error = string.Empty;

            try {
                point = dao.SaveMonitorPointPosition(id, left, top, typeId, originalId);
            }
            catch (Exception ex) {
                error = ex.Message;
            }
            return(Json(new
            {
                success = string.IsNullOrEmpty(error),
                entity = point,
                title = point == null ? "" : point.ToString(),
                message = error
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult SaveMonitorPoint(MonitorPoint point)
        {
            int    result = 0;
            string error  = string.Empty;

            try {
                result = dao.SaveMonitorPoint(point);
            }
            catch (Exception ex) {
                error = ex.Message;
            }
            return(Json(new
            {
                success = string.IsNullOrEmpty(error),
                entity = point,
                title = point == null ? "" : point.ToString(),
                message = error
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult SaveMonitorPointPosition(int id, int left, int top, int typeId)
        {
            int          result = 0;
            string       error  = string.Empty;
            MonitorPoint point  = null;

            try {
                var monitorContent = dao.GetMonitorContent(typeId);
                point  = new MonitorPoint(id, left, top, typeId, monitorContent);
                result = dao.SaveMonitorPointPosition(point);
            }
            catch (Exception ex) {
                error = ex.Message;
            }
            return(Json(new
            {
                success = string.IsNullOrEmpty(error),
                entity = point,
                title = point == null ? "" : point.ToString(),
                message = error
            }, JsonRequestBehavior.AllowGet));
        }