public Venue(
            int ukPrn,
            string venueName,
            string address1,
            string address2,
            string town,
            string county,
            string postcode,
            decimal?latitude,
            decimal?longitude,
            VenueStatus status,
            string updatedBy,
            DateTime dateUpdated)
        {
            //Throw.IfNullOrWhiteSpace(id, nameof(id));
            Throw.IfLessThan(0, ukPrn, nameof(ukPrn));
            Throw.IfNullOrWhiteSpace(venueName, nameof(VenueName));
            Throw.IfNullOrWhiteSpace(address1, nameof(address1));
            Throw.IfNullOrWhiteSpace(town, nameof(town));
            Throw.IfNullOrWhiteSpace(postcode, nameof(postcode));

            UKPRN       = ukPrn;
            VenueName   = venueName;
            Address1    = address1;
            Address2    = address2;
            Town        = town;
            County      = county;
            PostCode    = postcode;
            Latitude    = latitude;
            Longitude   = longitude;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateUpdated = dateUpdated;
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            VenueStatus venueStatus = db.VenuesStatus.Find(id);

            db.VenuesStatus.Remove(venueStatus);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public Venue(
            string id,
            int ukPrn,
            string venueName,
            string address1,
            string address2,
            string address3,
            string town,
            string county,
            string postcode,
            decimal latitude,
            decimal longitude,
            VenueStatus status,
            string updatedBy,
            DateTime dateAdded,
            DateTime dateUpdated)
        {
            if (ukPrn < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(ukPrn), $"{nameof(ukPrn)} cannot be less than 0.");
            }

            if (string.IsNullOrWhiteSpace(venueName))
            {
                throw new ArgumentException("message", nameof(venueName));
            }

            if (string.IsNullOrWhiteSpace(address1))
            {
                throw new ArgumentException("message", nameof(address1));
            }

            if (string.IsNullOrWhiteSpace(town))
            {
                throw new ArgumentException("message", nameof(town));
            }

            if (string.IsNullOrWhiteSpace(postcode))
            {
                throw new ArgumentException("message", nameof(postcode));
            }

            ID          = id;
            UKPRN       = ukPrn;
            VenueName   = venueName;
            Address1    = address1;
            Address2    = address2;
            Address3    = address3;
            Town        = town;
            County      = county;
            PostCode    = postcode;
            Latitude    = latitude;
            Longitude   = longitude;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateAdded   = dateAdded;
            DateUpdated = dateUpdated;
        }
        public Venue(
            string id,
            int ukPrn,
            int providerID,
            int venueID,
            string venueName,
            string provVenueID,
            string address1,
            string address2,
            string address3,
            string town,
            string county,
            string postcode,
            string phone,
            string email,
            string website,
            decimal latitude,
            decimal longitude,
            VenueStatus status,
            string updatedBy,
            DateTime dateAdded,
            DateTime dateUpdated)
        {
            Throw.IfNullOrWhiteSpace(id, nameof(id));
            Throw.IfLessThan(0, ukPrn, nameof(ukPrn));
            //Throw.IfLessThan(0, providerID, nameof(providerID));
            //Throw.IfLessThan(0, venueID, nameof(venueID));
            //Throw.IfNullOrWhiteSpace(venueName, nameof(venueName));
            //Throw.IfNullOrWhiteSpace(provVenueID, nameof(provVenueID));
            ////Throw.IfNullOrWhiteSpace(address1, nameof(address1));
            //Throw.IfNullOrWhiteSpace(postcode, nameof(postcode));
            //Throw.IfNullOrWhiteSpace(updatedBy, nameof(updatedBy));

            ID          = id;
            UKPRN       = ukPrn;
            ProviderID  = providerID;
            VenueID     = venueID;
            VenueName   = venueName;
            ProvVenueID = provVenueID;
            Address1    = address1;
            Address2    = address2;
            Address3    = address3;
            Town        = town;
            County      = county;
            PostCode    = postcode;
            Telephone   = phone;
            Email       = email;
            Website     = website;
            Latitude    = latitude;
            Longitude   = longitude;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateAdded   = dateAdded;
            DateUpdated = dateUpdated;
        }
コード例 #5
0
        public Venue(
            string id,
            int ukPrn,
            int providerID,
            int venueID,
            string venueName,
            string provVenueID,
            string address1,
            string address2,
            string address3,
            string town,
            string county,
            string postcode,
            string phone,
            string email,
            string website,
            decimal latitude,
            decimal longitude,
            VenueStatus status,
            string updatedBy,
            DateTime dateAdded,
            DateTime dateUpdated)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException("message", nameof(id));
            }

            if (ukPrn < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(ukPrn), $"{nameof(ukPrn)} cannot be less than 0.");
            }

            ID          = id;
            UKPRN       = ukPrn;
            ProviderID  = providerID;
            VenueID     = venueID;
            VenueName   = venueName;
            ProvVenueID = provVenueID;
            Address1    = address1;
            Address2    = address2;
            Address3    = address3;
            Town        = town;
            County      = county;
            PostCode    = postcode;
            Telephone   = phone;
            Email       = email;
            Website     = website;
            Latitude    = latitude;
            Longitude   = longitude;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateAdded   = dateAdded;
            DateUpdated = dateUpdated;
        }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "VenueStatusID,VenueStatusName,StartDate,EndDate,VenueID")] VenueStatus venueStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(venueStatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.VenueID = new SelectList(db.Venues, "VenueID", "VenueName", venueStatus.VenueID);
     return(View(venueStatus));
 }
コード例 #7
0
        // GET: VenueStatus/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VenueStatus venueStatus = db.VenuesStatus.Find(id);

            if (venueStatus == null)
            {
                return(HttpNotFound());
            }
            return(View(venueStatus));
        }
コード例 #8
0
        // GET: VenueStatus/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VenueStatus venueStatus = db.VenuesStatus.Find(id);

            if (venueStatus == null)
            {
                return(HttpNotFound());
            }
            ViewBag.VenueID = new SelectList(db.Venues, "VenueID", "VenueName", venueStatus.VenueID);
            return(View(venueStatus));
        }
        public Venue(
            string id,
            int ukPrn,
            string venueName,
            string address1,
            string address2,
            string address3,
            string town,
            string county,
            string postcode,
            //string telephone,
            //string email,
            //string website,
            decimal latitude,
            decimal longitude,
            VenueStatus status,
            string updatedBy,
            DateTime dateAdded,
            DateTime dateUpdated)
        {
            //Throw.IfNullOrWhiteSpace(id, nameof(id));
            Throw.IfLessThan(0, ukPrn, nameof(ukPrn));
            Throw.IfNullOrWhiteSpace(venueName, nameof(VenueName));
            Throw.IfNullOrWhiteSpace(address1, nameof(address1));
            Throw.IfNullOrWhiteSpace(town, nameof(town));
            Throw.IfNullOrWhiteSpace(postcode, nameof(postcode));

            ID        = id;
            UKPRN     = ukPrn;
            VenueName = venueName;
            Address1  = address1;
            Address2  = address2;
            Address3  = address3;
            Town      = town;
            County    = county;
            PostCode  = postcode;
            //Telephone = telephone;
            //Email = email;
            //Website = website;
            Latitude    = latitude;
            Longitude   = longitude;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateAdded   = dateAdded;
            DateUpdated = dateUpdated;
        }
コード例 #10
0
        public Venue(
            string id,
            int ukPrn,
            string venueName,
            string address1,
            string address2,
            string address3,
            string town,
            string county,
            string postcode,
            VenueStatus status,
            string updatedBy,
            DateTime dateUpdated)
        {
            Throw.IfNullOrWhiteSpace(id, nameof(id));
            Throw.IfLessThan(0, ukPrn, nameof(ukPrn));
            //Throw.IfLessThan(0, providerID, nameof(providerID));
            //Throw.IfLessThan(0, venueID, nameof(venueID));
            //Throw.IfNullOrWhiteSpace(venueName, nameof(venueName));
            //Throw.IfNullOrWhiteSpace(provVenueID, nameof(provVenueID));
            //Throw.IfNullOrWhiteSpace(address1, nameof(address1));
            //Throw.IfNullOrWhiteSpace(address1, nameof(address2));
            //Throw.IfNullOrWhiteSpace(address1, nameof(address3));
            //Throw.IfNullOrWhiteSpace(town, nameof(town));
            //Throw.IfNullOrWhiteSpace(postcode, nameof(postcode));
            //Throw.IfNullOrWhiteSpace(updatedBy, nameof(updatedBy));


            ID          = id;
            UKPRN       = ukPrn;
            VenueName   = venueName;
            Address1    = address1;
            Address2    = address2;
            Address3    = address3;
            Town        = town;
            County      = county;
            PostCode    = postcode;
            Status      = status;
            UpdatedBy   = updatedBy;
            DateUpdated = dateUpdated;
        }