Exemple #1
0
        public ViewChartSet GetChartSet(Int64 id, Guid userId)
        {
            Trace.Assert(_db != null);
            ObjectSet <ViewChartSet> os     = _db.ViewChartSet;
            ViewChartSet             result = os.Single(t => (t.ID == id) && (t.DataOwnerID == userId));

            return(result);
        }
Exemple #2
0
 public ActionResult Create(ViewChartSet v)
 {
     try
     {
         _chartSetRepository.AddChartSet(v, GetUserId());
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #3
0
 public ActionResult Edit(int id)
 {
     try
     {
         ViewChartSet v = _chartSetRepository.GetChartSet(id, GetUserId());
         return(View(v));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
Exemple #4
0
 public ActionResult Edit(int id, ViewChartSet v)
 {
     try
     {
         if (null != v)
         {
             v.ID = id;
             _chartSetRepository.UpdateChartSet(v, GetUserId());
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ViewResult Index(Int64 id /*chart set id.*/)
        {
            try
            {
                Guid         userId = GetUserId();
                ViewChartSet v      = _chartSetRepository.GetChartSet(id, userId);

                ViewBag.ChartSetName = v.Name;
                ViewBag.ChartSetID   = v.ID;
                return(View(_chartSetsChartsRepository.GetChartSetChartsList(id, userId)));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Exemple #6
0
        public ActionResult View(int id)
        {
            try
            {
                Guid         userId = GetUserId();
                ViewChartSet v      = _chartSetRepository.GetChartSet(id, userId);

                List <ViewChartSetsCharts> l = _chartSetsChartsRepository.GetChartSetChartsList(id, userId);
                ViewBag.ChartSetsCharts = l;
                return(View(v));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Exemple #7
0
 public void UpdateChartSet(ViewChartSet v, Guid userId)
 {
 }
Exemple #8
0
 public void AddChartSet(ViewChartSet v, Guid userId)
 {
     DeviceRowAffected++;
 }
Exemple #9
0
 public void UpdateChartSet(ViewChartSet v, Guid userId)
 {
     Trace.Assert(_db != null);
     _db.UpdateChartSet(v.Name, v.ID, v.CellWidth, v.CellHeight, v.Rows, v.Cols, v.Margin, userId);
 }