コード例 #1
0
        public ViewOBISSet GetObisSet(Int64 id, Guid userId)
        {
            Trace.Assert(_db != null);
            ObjectSet <ViewOBISSet> os     = _db.ViewOBISSet;
            ViewOBISSet             result = os.Single(t => (t.ID == id) && (t.DataOwnerID == userId));

            return(result);
        }
コード例 #2
0
 public ViewResult Details(long id)
 {
     try
     {
         ViewOBISSet viewobisset = _obisSetRepository.GetObisSet(id, GetUserId());
         FillAuxData(viewobisset);
         return(View(viewobisset));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
コード例 #3
0
 public ActionResult Delete(long id)
 {
     try
     {
         ViewOBISSet viewobisset = _obisSetRepository.GetObisSet(id, GetUserId());
         //Trace.Assert(viewobisset != null); allowed...
         FillAuxData(viewobisset);
         return(View(viewobisset));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
コード例 #4
0
 public ActionResult Edit(ViewOBISSet viewobisset)
 {
     try
     {
         if (viewobisset != null)
         {
             if (ModelState.IsValid)
             {
                 _obisSetRepository.UpdateObisSet(viewobisset, GetUserId());
                 return(RedirectToAction("Index"));
             }
         }
         FillAuxData(viewobisset);
         return(View(viewobisset));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
コード例 #5
0
        private void FillAuxData(ViewOBISSet viewobisset)
        {
            Guid userId = GetUserId();

            if (viewobisset != null)
            {
                if (viewobisset.DeviceTypeID != null)
                {
                    ViewDeviceType vdt = _deviceTypeRepository.GetDeviceType((Int64)viewobisset.DeviceTypeID, userId);
                    ViewBag.DeviceTypeName = vdt.Description;
                }
            }
            if (viewobisset != null && viewobisset.DeviceTypeID != null)
            {
                ViewBag.DeviceTypeID = _deviceTypeRepository.GetDeviceTypes(userId,
                                                                            (Int64)viewobisset.DeviceTypeID, null);
            }
            ViewBag.AID = _obisGroupRepository.GetObisGroups("A", userId, viewobisset != null ? viewobisset.AID : 0);
            ViewBag.BID = _obisGroupRepository.GetObisGroups("B", userId, viewobisset != null ? viewobisset.BID : 0);
            ViewBag.CID = _obisGroupRepository.GetObisGroups("C", userId, viewobisset != null ? viewobisset.CID : 0);
            ViewBag.DID = _obisGroupRepository.GetObisGroups("D", userId, viewobisset != null ? viewobisset.DID : 0);
            ViewBag.EID = _obisGroupRepository.GetObisGroups("E", userId, viewobisset != null ? viewobisset.EID : 0);
            ViewBag.FID = _obisGroupRepository.GetObisGroups("F", userId, viewobisset != null ? viewobisset.FID : 0);
        }
コード例 #6
0
 public void UpdateObisSet(ViewOBISSet viewObisSettype, Guid userId)
 {
 }
コード例 #7
0
 public void AddObisSet(ViewOBISSet viewObisSet, Guid userId)
 {
     ObisSetRowAffected++;
 }
コード例 #8
0
 public void UpdateObisSet(ViewOBISSet viewObisSettype, Guid userId)
 {
     Trace.Assert(_db != null);
     Trace.Assert(viewObisSettype != null);
     _db.UpdateOBISSet(viewObisSettype.ID, viewObisSettype.AID, viewObisSettype.BID, viewObisSettype.CID, viewObisSettype.DID, viewObisSettype.EID, viewObisSettype.FID, viewObisSettype.DeviceTypeID, userId, viewObisSettype.Standard);
 }
コード例 #9
0
 public void AddObisSet(ViewOBISSet viewObisSet, Guid userId)
 {
     Trace.Assert(_db != null);
     Trace.Assert(viewObisSet != null);
     _db.AddOBISSet(viewObisSet.AID, viewObisSet.BID, viewObisSet.CID, viewObisSet.DID, viewObisSet.EID, viewObisSet.FID, viewObisSet.DeviceTypeID, userId, viewObisSet.Standard);
 }