예제 #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);
        }
예제 #2
0
        public ObservationsBLL FindObservation(int ObsID)
        {
            ObservationsBLL ProposedReturnValue = null;
            ObservationsDAL DataLayerObject     = _context.FindObservation(ObsID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new ObservationsBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
예제 #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"));
            }
        }
예제 #6
0
 public void DeleteObservation(ObservationsBLL Observations)
 {
     _context.DeleteObservation(Observations.ObsID);
 }
예제 #7
0
 public void JustUpdateObservation(ObservationsBLL Observations)
 {
     _context.JustUpdateObservation(Observations.ObsID, Observations.Speed, Observations.LatNumber, Observations.LongNumber, Observations.PlateID, Observations.RegisteredOwner, Observations.DroneID);
 }