public IHttpActionResult PostLicenseeType(LicenseeType licenseeType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.LicenseeTypes.Add(licenseeType);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (LicenseeTypeExists(licenseeType.LicenseeType1))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = licenseeType.LicenseeType1 }, licenseeType));
        }
        public IHttpActionResult PutLicenseeType(string id, LicenseeType licenseeType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != licenseeType.LicenseeType1)
            {
                return(BadRequest());
            }

            db.Entry(licenseeType).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LicenseeTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetLicenseeType(string id)
        {
            LicenseeType licenseeType = db.LicenseeTypes.Find(id);

            if (licenseeType == null)
            {
                return(NotFound());
            }

            return(Ok(licenseeType));
        }
        public IHttpActionResult DeleteLicenseeType(string id)
        {
            LicenseeType licenseeType = db.LicenseeTypes.Find(id);

            if (licenseeType == null)
            {
                return(NotFound());
            }

            db.LicenseeTypes.Remove(licenseeType);
            db.SaveChanges();

            return(Ok(licenseeType));
        }
Example #5
0
 public CartridgeInfo(string ROMName, LicenseeType LicenseeType, byte LicenseeNew, bool Japanese, int MaskROMVersion, bool GameBoyColor,
                      bool SuperGameBoy, CartridgeType CartridgeType,
                      int RAMSize, int RAMBanks, int ROMSize, int ROMBanks, int Complement, int Checksum)
 {
     this.ROMName        = ROMName;
     this.LicenseeType   = LicenseeType;
     this.LicenseeNew    = LicenseeNew;
     this.Japanese       = Japanese;
     this.MaskROMVersion = MaskROMVersion;
     this.GameBoyColor   = GameBoyColor;
     this.SuperGameBoy   = SuperGameBoy;
     this.CartridgeType  = CartridgeType;
     this.RAMSize        = RAMSize;
     this.RAMBanks       = RAMBanks;
     this.ROMSize        = ROMSize;
     this.ROMBanks       = ROMBanks;
     this.Complement     = Complement;
     this.CheckSum       = Checksum;
 }