Exemplo n.º 1
0
        public int CreateObservation(ObservationsBLL Observations)
        {
            int ProposedReturnValue = -1;

            ProposedReturnValue = _context.CreateObservation(Observations.Speed, Observations.LatNumber, Observations.LongNumber, Observations.PlateID, Observations.RegisteredOwner, Observations.DroneID);
            return(ProposedReturnValue);
        }
Exemplo n.º 2
0
        public ObservationsBLL FindObservation(int ObsID)
        {
            ObservationsBLL ProposedReturnValue = null;
            ObservationsDAL DataLayerObject     = _context.FindObservation(ObsID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new ObservationsBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
Exemplo n.º 3
0
        public List <ObservationsBLL> GetObservationsRelatedToObs(int skip, int take)
        {
            List <ObservationsBLL> ProposedReturnValue    = new List <ObservationsBLL>();
            List <ObservationsDAL> ListOfDataLayerObjects = _context.GetObservationsRelatedToObs(skip, take);

            foreach (ObservationsDAL Observations in ListOfDataLayerObjects)
            {
                ObservationsBLL BusinessObject = new ObservationsBLL(Observations);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
        public ActionResult Delete(int id, RavenBLL.ObservationsBLL collection)
        {
            try
            {
                //if (!ModelState.IsValid)
                //{
                //    return View(collection);
                //}
                // TODO: Add insert logic here
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.DeleteObservation(id);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
        public ActionResult Create(RavenBLL.ObservationsBLL collection)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(collection));
                }
                // TODO: Add insert logic here
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.CreateObservation(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
Exemplo n.º 6
0
 public void DeleteObservation(ObservationsBLL Observations)
 {
     _context.DeleteObservation(Observations.ObsID);
 }
Exemplo n.º 7
0
 public void JustUpdateObservation(ObservationsBLL Observations)
 {
     _context.JustUpdateObservation(Observations.ObsID, Observations.Speed, Observations.LatNumber, Observations.LongNumber, Observations.PlateID, Observations.RegisteredOwner, Observations.DroneID);
 }