public async Task <IHttpActionResult> PutM_MatchTopicMaster(int id, M_MatchTopicMaster m_MatchTopicMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != m_MatchTopicMaster.MatchTopicID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            M_MatchTopicMaster m_MatchTopicMaster = await db.M_MatchTopicMaster.FindAsync(id);

            db.M_MatchTopicMaster.Remove(m_MatchTopicMaster);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <IHttpActionResult> GetM_MatchTopicMaster(int id)
        {
            M_MatchTopicMaster m_MatchTopicMaster = await db.M_MatchTopicMaster.FindAsync(id);

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

            return(Ok(m_MatchTopicMaster));
        }
        public async Task <IHttpActionResult> PostM_MatchTopicMaster(M_MatchTopicMaster m_MatchTopicMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.M_MatchTopicMaster.Add(m_MatchTopicMaster);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = m_MatchTopicMaster.MatchTopicID }, m_MatchTopicMaster));
        }
Пример #5
0
        public async Task <ActionResult> Edit([Bind(Include = "MatchTopicID,Topic,Description,CreatedBy,CreatedDate,Active")] M_MatchTopicMaster m_MatchTopicMaster)
        {
            if (ModelState.IsValid)
            {
                m_MatchTopicMaster.ModifiedBy      = "System";
                m_MatchTopicMaster.ModifiedDate    = DateTime.Now;
                db.Entry(m_MatchTopicMaster).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(m_MatchTopicMaster));
        }
        public async Task <IHttpActionResult> DeleteM_MatchTopicMaster(int id)
        {
            M_MatchTopicMaster m_MatchTopicMaster = await db.M_MatchTopicMaster.FindAsync(id);

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

            db.M_MatchTopicMaster.Remove(m_MatchTopicMaster);
            await db.SaveChangesAsync();

            return(Ok(m_MatchTopicMaster));
        }
Пример #7
0
        // GET: M_MatchTopicMaster/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            M_MatchTopicMaster m_MatchTopicMaster = await db.M_MatchTopicMaster.FindAsync(id);

            if (m_MatchTopicMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(m_MatchTopicMaster));
        }
Пример #8
0
        public async Task <ActionResult> Create([Bind(Include = "MatchTopicID,Topic,Description")] M_MatchTopicMaster m_MatchTopicMaster)
        {
            if (ModelState.IsValid)
            {
                m_MatchTopicMaster.CreatedBy    = "System";
                m_MatchTopicMaster.CreatedDate  = DateTime.Now;
                m_MatchTopicMaster.ModifiedBy   = "System";
                m_MatchTopicMaster.ModifiedDate = DateTime.Now;
                m_MatchTopicMaster.Active       = true;
                db.M_MatchTopicMaster.Add(m_MatchTopicMaster);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(m_MatchTopicMaster));
        }