Ejemplo n.º 1
0
 public void UpdateDeviceOwner(ViewDeviceOwner v, Guid userId)
 {
     Trace.Assert(_db != null);
     Trace.Assert(v != null);
     _db.UpdateDeviceOwner(
         v.ID, v.FirstName, v.LastName, v.Company, v.Apartament, v.Building, v.Street, v.City,
         v.State, v.Country, v.ZipCode, v.EMail, v.Phone, v.Cell, userId);
 }
Ejemplo n.º 2
0
 public ActionResult Edit(long id)
 {
     try
     {
         ViewDeviceOwner viewdeviceowner = _deviceOwnerRepository.GetDeviceOwner(id, GetUserId());
         return(View(viewdeviceowner));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
Ejemplo n.º 3
0
        public long?AddDeviceOwner(ViewDeviceOwner v, Guid userId)
        {
            Trace.Assert(_db != null);
            Trace.Assert(v != null);
            ObjectResult <long?> result = _db.AddDeviceOwner(
                v.FirstName, v.LastName, v.Company, v.Apartament, v.Building, v.Street, v.City,
                v.State, v.Country, v.ZipCode, v.EMail, v.Phone, v.Cell, userId);

            Trace.Assert(result != null);
            IEnumerator <long?> resultList = result.GetEnumerator();

            Trace.Assert(resultList != null);
            resultList.MoveNext();
            long?id = resultList.Current;

            resultList.Dispose(); //  for transaction to be able to complete
            return(id);
        }
Ejemplo n.º 4
0
 public ActionResult Edit(ViewDeviceOwner viewdeviceowner)
 {
     try
     {
         if (viewdeviceowner != null)
         {
             if (ModelState.IsValid)
             {
                 _deviceOwnerRepository.UpdateDeviceOwner(viewdeviceowner, GetUserId());
                 return(RedirectToAction("Index"));
             }
         }
         return(View(viewdeviceowner));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
Ejemplo n.º 5
0
        public ActionResult Create(ViewDeviceOwner viewdeviceowner, String returnTo)
        {
            try
            {
                if (viewdeviceowner != null)
                {
                    if (ModelState.IsValid)
                    {
                        long?ownerId = _deviceOwnerRepository.AddDeviceOwner(viewdeviceowner, GetUserId());

                        return(RedirectToAction("SelectOwner", new { id = ownerId, returnTo }));
                    }
                }
                return(View(viewdeviceowner));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Ejemplo n.º 6
0
 public void UpdateDeviceOwner(ViewDeviceOwner v, Guid userId)
 {
 }
Ejemplo n.º 7
0
 public long?AddDeviceOwner(ViewDeviceOwner v, Guid userId)
 {
     return(null);
 }