Esempio n. 1
0
        public async Task <IHttpActionResult> PutInvestedHistory(int id, z_InvestedHistory investedHistory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != investedHistory.InvestedHistoryID)
            {
                return(BadRequest());
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InvestedHistoryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 2
0
        // GET: api/InvestorInvestedHistory/5
        //[ResponseType(typeof(z_InvestedHistory))]
        public async Task <IHttpActionResult> GetInvestedHistory(int id)
        {
            z_InvestedHistory investedHistory = await db.z_InvestedHistory.FindAsync(id);

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

            return(Ok(investedHistory));
        }
Esempio n. 3
0
        public async Task <IHttpActionResult> Postz_InvestedHistory(z_InvestedHistory investedHistory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.z_InvestedHistory.Add(investedHistory);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = investedHistory.InvestedHistoryID }, investedHistory));
        }
Esempio n. 4
0
        // DELETE: api/InvestorInvestedHistory/5
        //[ResponseType(typeof(z_InvestedHistory))]
        public async Task <IHttpActionResult> DeleteInvestedHistory(int id)
        {
            z_InvestedHistory investedHistory = await db.z_InvestedHistory.FindAsync(id);

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

            db.z_InvestedHistory.Remove(investedHistory);
            await db.SaveChangesAsync();

            return(Ok(investedHistory));
        }