示例#1
0
 public ActionResult Edit([Bind(Include = "CourierID,Name")] CourierService m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "CourierServices"));
     }
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "SlotStatusID,Status")] SlotStatus m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "SlotStatus"));
     }
     return(View(m));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "OperatorTypeID,Name")] OperatorTypes m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "OperatorTypes"));
     }
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "SMIBAerialID,Name")] BoardAerials m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "BoardAerials"));
     }
     return(View(m));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "ManufacturerID,ManufacturedDate,Name")] Manufacturers m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Manufacturers"));
     }
     return(View(m));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "ReportID,CreatedOn,CreatedBy,Comments,DeviceType,DeviceSerialNumber")] Reports m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Reports"));
     }
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "SIMCardID,SIMBatchID,SerialNumber,MobileNumber,ActivatedOn,IsAvailable,IsActive")] SimCards m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "SimCards"));
     }
     ViewBag.SIMBatchID = new SelectList(db.SimCardBatches, "SimBatchID", "BatchReference", m.SIMBatchID);
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "ManufacturerModelID,ManufacturerID,Name")] ManufacturerModels m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "ManufacturerModels"));
     }
     ViewBag.ManufacturerID = new SelectList(db.Manufacturers, "ManufacturerID", "Name", m.ManufacturerID);
     return(View(m));
 }
示例#9
0
 public ActionResult Edit([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.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Companies"));
     }
     ViewBag.SlotID = new SelectList(db.Slots, "SlotID", "SerialNumber", m.SlotID);
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "SMIB_CardManufacturerID,SMIBoardTypeID,Name")] BoardManufacturers m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "BoardManufacturers"));
     }
     ViewBag.BoardType = new SelectList(db.BoardTypes, "SMIBoardTypeID", "Name", m.SMIBoardTypeID);
     return(View(m));
 }
 public ActionResult Edit([Bind(Include = "CompanyID,CreatedBy, CreatedOn, IsActive,Name,Number,Phone,Email,Website,AddressOne,AddressTwo,Town,PostCode,CountryID")] Company m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "Name", m.CountryID);
     return(View(m));
 }
示例#12
0
 public ActionResult Edit([Bind(Include = "ReturnID,ReportID,CourierID,ReturnDate,ReturnedBy,TrackingNumber,Dispatched")] Returns m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         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));
 }
示例#13
0
 public ActionResult Edit([Bind(Include = "SMIBatchID,SMIB_ManufacturerID,SMIBoardTypeID,ReceivedOn,BatchNumber,UnitsReceived,BoardLocation")] BoardBatches m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         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));
 }
示例#14
0
 public ActionResult Edit([Bind(Include = "SimBatchID,SIM_ManufacturerID,SIM_CardTypeID,ReceivedOn,BatchReference,UnitsReceived,CardLocation")] SimCardBatches m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         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 Edit([Bind(Include = "ContactID,VenueID,TitleID,CreatedOn,IsActive,FName,LName,Company,Position,Email,Phone,Mobile,CountryID")] Contacts contacts)
 {
     if (ModelState.IsValid)
     {
         db.Entry(contacts).State = EntityState.Modified;
         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));
 }
示例#16
0
        public ActionResult Edit([Bind(Include = "SMIBID,SMIBatchID,SMIBAerialID,SerialNumber,IsAvailable,IsActive")] Boards m)
        {
            if (ModelState.IsValid)
            {
                db.Entry(m).State = EntityState.Modified;
                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 Edit([Bind(Include = "VenueID,OperatorID,OperatorTypeID,IsActive,Permit,Manager,Name,Phone,Email,AddressOne,AddressTwo,PostCode,Town,CountryID")] OperatorVenues m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         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 Edit([Bind(Include = "SlotID,VenueID,SlotTypeID,SlotStatusID,SlotModelID,SlotNameID,ManufacturerID,ManufacturerModelID,IsOriginal,IsActive,IsAvailable,DeviceCommissioned,DeviceDecommissioned,SerialNumber,AssetNumber,DeviceLocation")] Slots m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         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));
        }