Exemple #1
0
        public int CreateDrone(DronesBLL Drones)
        {
            int ProposedReturnValue = -1;

            ProposedReturnValue = _context.CreateDrone(Drones.RoleID, Drones.DroneName, Drones.UserID);
            return(ProposedReturnValue);
        }
Exemple #2
0
        public DronesBLL FindDrone(int DroneID)
        {
            DronesBLL ProposedReturnValue = null;
            DronesDAL DataLayerObject     = _context.FindDrone(DroneID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new DronesBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
Exemple #3
0
        public List <DronesBLL> GetDronesRelatedToUser(int UserID, int Skip, int Take)
        {
            List <DronesBLL> ProposedReturnValue    = new List <DronesBLL>();
            List <DronesDAL> ListOfDataLayerObjects = _context.GetDronesRelatedToUser(UserID, Skip, Take);

            foreach (DronesDAL Drone in ListOfDataLayerObjects)
            {
                DronesBLL BusinessObject = new DronesBLL(Drone);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
Exemple #4
0
        public List <DronesBLL> GetDrones(int skip, int take)
        {
            List <DronesBLL> ProposedReturnValue    = new List <DronesBLL>();
            List <DronesDAL> ListOfDataLayerObjects = _context.GetDrones(skip, take);

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

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

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
Exemple #7
0
 public void DeleteDrone(DronesBLL Drones)
 {
     _context.DeleteDrone(Drones.DroneID);
 }
Exemple #8
0
 public void JustUpdateDrone(DronesBLL Drones)
 {
     _context.JustUpdateDrone(Drones.DroneID, Drones.RoleID, Drones.DroneName, Drones.UserID);
 }