예제 #1
0
        public ActionResult Create([Bind(Include = "CountryID,Name")] Countries m)
        {
            if (ModelState.IsValid)
            {
                db.Countries.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Country"));
            }

            return(View(m));
        }
예제 #2
0
        public ActionResult Create([Bind(Include = "ReportID,CreatedOn,CreatedBy,Comments,DeviceType,DeviceSerialNumber")] Reports m)
        {
            if (ModelState.IsValid)
            {
                db.Reports.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Reports"));
            }

            return(View(m));
        }
        public ActionResult Create([Bind(Include = "SlotStatusID,Status")] SlotStatus m)
        {
            if (ModelState.IsValid)
            {
                db.SlotStatus.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "SlotStatus"));
            }

            return(View(m));
        }
        public ActionResult Create([Bind(Include = "ImageTypeID,Name")] ImageTypes imageTypes)
        {
            if (ModelState.IsValid)
            {
                db.ImageTypes.Add(imageTypes);
                db.SaveChanges();
                return(RedirectToAction("Index", " ImageTypes"));
            }

            return(View(imageTypes));
        }
        public ActionResult Create([Bind(Include = "BoardAerialID,Name")] BoardAerials m)
        {
            if (ModelState.IsValid)
            {
                db.BoardAerials.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "BoardAerials"));
            }

            return(View(m));
        }
예제 #6
0
        public ActionResult Create([Bind(Include = "OperatorTypeID,Name")] OperatorTypes m)
        {
            if (ModelState.IsValid)
            {
                db.OperatorTypes.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "OperatorTypes"));
            }

            return(View(m));
        }
예제 #7
0
        public ActionResult Create([Bind(Include = "ManufacturerID,ManufacturedDate,Name")] Manufacturers m)
        {
            if (ModelState.IsValid)
            {
                db.Manufacturers.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Manufacturers"));
            }

            return(View(m));
        }
예제 #8
0
 public ActionResult Create([Bind(Include = "SIMCardID,SIMBatchID,SerialNumber,MobileNumber,ActivatedOn,IsActive")] SimCards m)
 {
     if (ModelState.IsValid)
     {
         m.IsAvailable = true;
         db.SimCards.Add(m);
         db.SaveChanges();
         return(RedirectToAction("Index", "SimCards"));
     }
     ViewBag.SIMBatchID = new SelectList(db.SimCardBatches, "SimBatchID", "BatchReference", m.SIMBatchID);
     return(View(m));
 }
        public ActionResult Create([Bind(Include = "SMIB_CardManufacturerID,SMIBoardTypeID,Name")] BoardManufacturers m)
        {
            if (ModelState.IsValid)
            {
                db.BoardManufacturers.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "BoardManufacturers"));
            }

            ViewBag.BoardType = new SelectList(db.BoardTypes, "SMIBoardTypeID", "Name", m.SMIBoardTypeID);
            return(View(m));
        }
예제 #10
0
        public ActionResult Create([Bind(Include = "SlotHarnessID,SlotID,Name,CableLength,COM_Jumper_Type,COM_Jumper_Number,Power_Jumper_Number,BS_DataConnect,BS_PowerConnect,BS_DataConnectType,BS_DataConnect_PinOut,BS_PowerConnect_PinOut,DS_DataConnect,DS_PowerConnect,DS_DataConnectType,DS_DataConnect_PinOut,DS_PowerConnect_PinOut")] SlotHarnesses m)
        {
            if (ModelState.IsValid)
            {
                db.SlotHarnesses.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.SlotID = new SelectList(db.Slots, "SlotID", "SerialNumber", m.SlotID);
            return(View(m));
        }
        public ActionResult Create([Bind(Include = "ManufacturerModelID,ManufacturerID,Name")] ManufacturerModels m)
        {
            if (ModelState.IsValid)
            {
                db.ManufacturerModels.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "ManufacturerModels"));
            }

            ViewBag.ManufacturerID = new SelectList(db.Manufacturers, "ManufacturerID", "Name", m.ManufacturerID);
            return(View(m));
        }
예제 #12
0
        public ActionResult Create([Bind(Include = "CompanyID,CreatedBy,CreatedOn,IsActive,Name,Number,Phone,Email,Website,AddressOne,AddressTwo,Town,PostCode,CountryID")] Company m)
        {
            if (ModelState.IsValid)
            {
                db.Companies.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name", m.CountryID);
            return(View(m));
        }
예제 #13
0
        public ActionResult Create([Bind(Include = "ReturnID,ReportID,CourierID,ReturnDate,ReturnedBy,TrackingNumber,Dispatched")] Returns m)
        {
            if (ModelState.IsValid)
            {
                db.Returns.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Returns"));
            }

            ViewBag.CourierID = new SelectList(db.CourierServices, "CourierID", "Name", m.CourierID);
            ViewBag.ReportID  = new SelectList(db.Reports, "ReportID", "CreatedBy", m.ReportID);
            return(View(m));
        }
예제 #14
0
        public ActionResult Create([Bind(Include = "OperatorID,CompanyID,CreatedOn,IsActive,Name,Website,AddressOne,AddressTwo,Town,CountryID")] Operators m)
        {
            if (ModelState.IsValid)
            {
                db.Operators.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "Name", m.CompanyID);
            ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name", m.CountryID);
            return(View(m));
        }
예제 #15
0
        public ActionResult Create([Bind(Include = "SMIBatchID,SMIB_ManufacturerID,SMIBoardTypeID,ReceivedOn,BatchNumber,UnitsReceived,BoardLocation")] BoardBatches m)
        {
            if (ModelState.IsValid)
            {
                db.BoardBatches.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "BoardBatches"));
            }

            ViewBag.BoardManufacturer = new SelectList(db.BoardManufacturers, "SMIB_CardManufacturerID", "Name", m.SMIB_ManufacturerID);
            ViewBag.BoardType         = new SelectList(db.BoardTypes, "SMIBoardTypeID", "Name", m.SMIBoardTypeID);
            return(View(m));
        }
예제 #16
0
        public ActionResult Create([Bind(Include = "SimBatchID,SIM_ManufacturerID,SIM_CardTypeID,ReceivedOn,BatchReference,UnitsReceived,CardLocation")] SimCardBatches m)
        {
            if (ModelState.IsValid)
            {
                db.SimCardBatches.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "SimCardBatches"));
            }

            ViewBag.SIM_ManufacturerID = new SelectList(db.SimCardManufacturers, "SIM_CardManufacturerID", "Name", m.SIM_ManufacturerID);
            ViewBag.SIM_CardTypeID     = new SelectList(db.SimCardTypes, "SIM_CardTypeID", "Name", m.SIM_CardTypeID);
            return(View(m));
        }
        public ActionResult Create([Bind(Include = "VenueID,OperatorID,OperatorTypeID,IsActive,Permit,Manager,Name,Phone,Email,AddressOne,AddressTwo,PostCode,Town,CountryID")] OperatorVenues m)
        {
            if (ModelState.IsValid)
            {
                db.OperatorVenues.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.OperatorID     = new SelectList(db.Operators, "OperatorID", "Name", m.OperatorID);
            ViewBag.OperatorTypeID = new SelectList(db.OperatorTypes, "OperatorTypeID", "Name", m.OperatorTypeID);
            ViewBag.CountryID      = new SelectList(db.Countries, "CountryID", "Name", m.CountryID);
            return(View(m));
        }
예제 #18
0
        public ActionResult Create([Bind(Include = "ContactID,VenueID,TitleID,CreatedOn,IsActive,FName,LName,Company,Position,Email,Phone,Mobile,CountryID")] Contacts contacts)
        {
            if (ModelState.IsValid)
            {
                db.Contacts.Add(contacts);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name", contacts.CountryID);
            ViewBag.VenueID   = new SelectList(db.OperatorVenues, "VenueID", "Name", contacts.VenueID);
            ViewBag.TitleID   = new SelectList(db.Titles, "TitleID", "Name", contacts.TitleID);
            return(View(contacts));
        }
예제 #19
0
        public ActionResult Create([Bind(Include = "SMIBID,SMIBatchID,SMIBAerialID,SerialNumber,IsAvailable,IsActive")] Boards m)
        {
            m.IsAvailable = true;
            if (ModelState.IsValid)
            {
                db.Boards.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Boards"));
            }


            ViewBag.SMIBAerialID = new SelectList(db.BoardAerials, "SMIBAerialID", "Name", m.SMIBAerialID);
            ViewBag.SMIBatchID   = new SelectList(db.BoardBatches, "SMIBatchID", "BatchNumber", m.SMIBatchID);
            return(View(m));
        }
        public ActionResult Add(SlotImages upload)
        {
            string fileName  = Path.GetFileNameWithoutExtension(upload.ImageFile.FileName);
            string extension = Path.GetExtension(upload.ImageFile.FileName);

            fileName         = fileName + DateTime.Now.ToString("yymmssfff") + extension;
            upload.ImagePath = "~/Images/Uploads/SlotMachines" + fileName;
            fileName         = Path.Combine(Server.MapPath("~/Images/Uploads/SlotMachines"), fileName);

            ViewBag.ImageTypeID = new SelectList(db.ImageTypes, "ImageTypeID", "Name", upload.ImageTypeID);
            ViewBag.VenueID     = new SelectList(db.OperatorVenues, "VenueID", "Name", upload.VenueID);
            ViewBag.SlotID      = new SelectList(db.Slots, "SlotID", "SerialNumber", upload.SlotID);

            db.SlotImages.Add(upload);
            db.SaveChanges();


            ModelState.Clear();
            return(View());
        }
예제 #21
0
        public ActionResult Create([Bind(Include = "SlotID,VenueID,SlotTypeID,SlotStatusID,SlotModelID,SlotNameID,ManufacturerID,ManufacturerModelID,IsOriginal,IsActive,DeviceCommissioned,DeviceDecommissioned,SerialNumber,AssetNumber,DeviceLocation")] Slots m)
        {
            // CHECK AGAINST CREATE AND EDIT FORMS
            m.IsAvailable = true;
            if (ModelState.IsValid)
            {
                db.Slots.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.ManufacturerModelID = new SelectList(db.ManufacturerModels, "ManufacturerModelID", "Name", m.ManufacturerModelID);
            ViewBag.ManufacturerID      = new SelectList(db.Manufacturers, "ManufacturerID", "Name", m.ManufacturerID);
            ViewBag.VenueID             = new SelectList(db.OperatorVenues, "VenueID", "Name", m.VenueID);
            ViewBag.SlotModelID         = new SelectList(db.SlotModels, "SlotModelID", "Name", m.SlotModelID);
            ViewBag.SlotNameID          = new SelectList(db.SlotNames, "SlotNameID", "Name", m.SlotNameID);
            ViewBag.SlotStatusID        = new SelectList(db.SlotStatus, "SlotStatusID", "Status", m.SlotStatusID);
            ViewBag.SlotTypeID          = new SelectList(db.SlotTypes, "SlotTypeID", "Name", m.SlotTypeID);

            return(View(m));
        }
        public ActionResult Create([Bind(Include = "ConfigurationID,SIMCardID,SIM_ActivatedOn,SIM_DeactivatedOn,SIMCardNowAssigned,SMIBID,SMIB_ActivatedOn,SMIB_DeactivatedOn,SMIBoardNowAssigned,SlotID")] Configuration m)
        {
            //// (1) I start off by looking up the dropdown list’s selected value for the sim card.
            var find_sim = db.SimCards.Find(m.SIMCardID);

            //// (2) Next, I want to remove the sim card’s future appearance within the global listing category, by changing its default value from TRUE to FALSE
            //// Within the respective table
            find_sim.SIMCardID       = m.SIMCardID;
            find_sim.IsAvailable     = false; // Remove Availability
            find_sim.IsActive        = true;  // Now show as being active
            db.Entry(find_sim).State = EntityState.Modified;
            db.SaveChanges();



            var find_board = db.Boards.Find(m.SMIBID);

            find_board.SMIBID          = m.SMIBID;
            find_board.IsAvailable     = false; // Made sure the selected board is no longer available in the global listings category
            find_board.IsActive        = true;  // Next set this board to being active
            db.Entry(find_board).State = EntityState.Modified;
            db.SaveChanges();



            //// Finally I want to take the selected sim card and board, assign it to a slot machine and then show the S.M as being configured


            var find_slot = db.Slots.Find(m.SlotID);

            find_slot.IsAvailable = false;
            find_slot.IsActive    = true;

            db.Entry(find_slot).State = EntityState.Modified;
            db.SaveChanges();


            if (ModelState.IsValid)
            {
                db.Configurations.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }
            return(View(m));
        }