Example #1
0
        public async Task <IActionResult> PutCategory(int id, Category category)
        {
            if (id != category.Id)
            {
                return(BadRequest());
            }

            _context.Entry(category).State = EntityState.Modified;

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

            return(NoContent());
        }
        public async Task <IActionResult> PutPurchaseMaster(int id, PurchaseMaster purchaseMaster)
        {
            if (id != purchaseMaster.ID)
            {
                return(BadRequest());
            }

            _context.Entry(purchaseMaster).State = EntityState.Modified;

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

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> PutPrdImage(int id, PrdImage prdImage)
        {
            if (id != prdImage.Id)
            {
                return(BadRequest());
            }

            _context.Entry(prdImage).State = EntityState.Modified;

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

            return(NoContent());
        }
Example #4
0
        public int DeleteUserById(int Id)
        {
            var        db = new EModel();
            userdetail ud = new userdetail();

            ud.UserID          = Id;
            db.Entry(ud).State = EntityState.Deleted;
            int retVal = db.SaveChanges();

            return(retVal);
        }
Example #5
0
        public int UpdateUser(int id, string name, string email)
        {
            var db = new EModel();
            var ud = new userdetail();

            ud.UserID          = id;
            ud.email           = email;
            ud.Name            = name;
            db.Entry(ud).State = EntityState.Modified;

            int retVal = db.SaveChanges();

            return(retVal);
        }