Exemplo n.º 1
0
        // PUT: odata/mdSPanels(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <mdSPanel> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            mdSPanel mdSPanel = await db.mdSPanels.FindAsync(key);

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

            patch.Put(mdSPanel);

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

            return(Updated(mdSPanel));
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Patch([FromODataUri] int key, Delta <hotjas_group> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            hotjas_group hotjas_group = await db.hotjas_group.FindAsync(key);

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

            patch.Patch(hotjas_group);

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

            return(Updated(hotjas_group));
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> Patch([FromODataUri] int key, Delta <Contratos> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Contratos contratos = await db.Contratos.FindAsync(key);

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

            patch.Patch(contratos);

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

            return(Updated(contratos));
        }
Exemplo n.º 4
0
        public IHttpActionResult Patch([FromODataUri] int key, Delta <Transaction> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Transaction transaction = db.Transactions.Find(key);

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

            patch.Patch(transaction);

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

            return(Updated(transaction));
        }
        public IHttpActionResult Patch([FromODataUri] int key, Delta <Customer> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Customer customer = db.Customers.Find(key);

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

            patch.Patch(customer);

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

            return(Updated(customer));
        }
Exemplo n.º 6
0
        // PUT: odata/userCompany(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <userCompany> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            userCompany userCompany = await db.userCompany.FindAsync(key);

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

            patch.Put(userCompany);

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

            return(Updated(userCompany));
        }
Exemplo n.º 7
0
        public async Task <IHttpActionResult> Patch([FromODataUri] int key, Delta <DelaveryService> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DelaveryService delaveryService = await db.DelaveryServices.FindAsync(key);

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

            patch.Patch(delaveryService);

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

            return(Updated(delaveryService));
        }
Exemplo n.º 8
0
        // PUT: odata/LabTables(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <LabTable> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            LabTable labTable = db.LabTables.Find(key);

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

            patch.Put(labTable);

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

            return(Updated(labTable));
        }
Exemplo n.º 9
0
        public async Task <IHttpActionResult> Patch([FromODataUri] Guid key, Delta <PUR010> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            PUR010 pUR010 = await db.PUR010.FindAsync(key);

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

            patch.Patch(pUR010);

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

            return(Updated(pUR010));
        }
Exemplo n.º 10
0
        // PUT: odata/T_RTRPT_PUMP_KTMXBWSO2(5)
        public IHttpActionResult Put([FromODataUri] decimal key, Delta <T_RTRPT_PUMP_KTMXBWSO2> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            T_RTRPT_PUMP_KTMXBWSO2 T_RTRPT_PUMP_KTMXBWSO2 = db.T_RTRPT_PUMP_KTMXBWSO2.Find(key);

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

            patch.Put(T_RTRPT_PUMP_KTMXBWSO2);

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

            return(Updated(T_RTRPT_PUMP_KTMXBWSO2));
        }
        // PUT: odata/OnlinepaymentFromWebhooks(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <OnlinepaymentFromWebhook> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            OnlinepaymentFromWebhook onlinepaymentFromWebhook = await db.OnlinepaymentFromWebhooks.FindAsync(key);

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

            patch.Put(onlinepaymentFromWebhook);

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

            return(Updated(onlinepaymentFromWebhook));
        }
        public IHttpActionResult Patch([FromODataUri] string key, Delta <APP_CAROUSEL> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            APP_CAROUSEL APP_CAROUSEL = db.APP_CAROUSEL.Find(key);

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

            patch.Patch(APP_CAROUSEL);

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

            return(Updated(APP_CAROUSEL));
        }
Exemplo n.º 13
0
        // PUT: odata/ThongKeCongViecTrongNgays(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <ThongKeCongViecTrongNgay> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ThongKeCongViecTrongNgay thongKeCongViecTrongNgay = db.ThongKeCongViecTrongNgays.Find(key);

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

            patch.Put(thongKeCongViecTrongNgay);

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

            return(Updated(thongKeCongViecTrongNgay));
        }
        public IHttpActionResult Patch([FromODataUri] int key, Delta <users_details> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            users_details users_details = db.users_details.Find(key);

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

            patch.Patch(users_details);

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

            return(Updated(users_details));
        }
Exemplo n.º 15
0
        public async Task <IHttpActionResult> Patch([FromODataUri] int key, Delta <SubCategory> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            SubCategory subCategory = await db.SubCategories.FindAsync(key);

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

            patch.Patch(subCategory);

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

            return(Updated(subCategory));
        }
Exemplo n.º 16
0
        // PUT: odata/EmployeeAccounts(5)
        public async Task <IHttpActionResult> Put([FromODataUri] short key, Delta <EmployeeAccount> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            EmployeeAccount employeeAccount = await db.EmployeeAccounts.FindAsync(key);

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

            patch.Put(employeeAccount);

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

            return(Updated(employeeAccount));
        }
Exemplo n.º 17
0
        public IHttpActionResult Patch([FromODataUri] int key, Delta <Pessoa> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Pessoa pessoa = db.Pessoas.Find(key);

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

            patch.Patch(pessoa);

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

            return(Updated(pessoa));
        }
        // PUT: odata/Admin_Employee(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Admin_Employee> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Admin_Employee admin_Employee = db.Admin_Employee.Find(key);

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

            patch.Put(admin_Employee);

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

            return(Updated(admin_Employee));
        }
Exemplo n.º 19
0
        // PUT: odata/rolesByActions(5)
        public async Task <IHttpActionResult> Put([FromODataUri] long key, Delta <role_by_action> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            role_by_action role_by_action = await db.role_by_action.FindAsync(key);

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

            patch.Put(role_by_action);

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

            return(Updated(role_by_action));
        }
Exemplo n.º 20
0
        // PUT: odata/WishLists(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <WishList> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            WishList wishList = db.WishLists.Find(key);

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

            patch.Put(wishList);

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

            return(Updated(wishList));
        }
        // PUT: odata/BuyerInfoes(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <BuyerInfo> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            BuyerInfo buyerInfo = db.BuyerInfos.Find(key);

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

            patch.Put(buyerInfo);

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

            return(Updated(buyerInfo));
        }
Exemplo n.º 22
0
        // PUT: odata/PaymentTypes(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <PaymentType> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            PaymentType paymentType = await db.PaymentTypes.FindAsync(key);

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

            patch.Put(paymentType);

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

            return(Updated(paymentType));
        }
        public async Task <IHttpActionResult> Patch([FromODataUri] int key, Delta <Account> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var user = await _db.Accounts.SingleOrDefaultAsync(u => u.Id == key);

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

            patch.Patch(user);

            try
            {
                await _db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ApplicationUserExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(user));
        }
Exemplo n.º 24
0
        public IHttpActionResult Patch([FromODataUri] Guid applicationId, [FromODataUri] string name, Delta <tblApplicationVariable> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            tblApplicationVariable tblApplicationVariable = db.tblApplicationVariable.Find(new object[] { applicationId, name });

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

            patch.Patch(tblApplicationVariable);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tblApplicationVariableExists(applicationId, name))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(tblApplicationVariable));
        }
Exemplo n.º 25
0
        // PUT: odata/Orders(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Orders> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Orders orders = db.Orders.Find(key);

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

            patch.Put(orders);

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

            return(Updated(orders));
        }
        // PUT: odata/FieldConfigurations(5)
        public async Task <IHttpActionResult> Put([FromODataUri] Guid key, Delta <FieldConfiguration> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            FieldConfiguration fieldConfiguration = await db.FieldConfigurations.FindAsync(key);

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

            patch.Put(fieldConfiguration);

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

            return(Updated(fieldConfiguration));
        }
Exemplo n.º 27
0
        // PUT: odata/Items(5)
        public IHttpActionResult Put([FromODataUri] decimal key, Delta <Item> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Item item = db.Items.Find(key);

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

            patch.Put(item);

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

            return(Updated(item));
        }
Exemplo n.º 28
0
        public IHttpActionResult Patch([FromODataUri] decimal key, Delta <T_PSJ_1> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            T_PSJ_1 T_PSJ_1 = db.T_PSJ_1.Find(key);

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

            patch.Patch(T_PSJ_1);

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

            return(Updated(T_PSJ_1));
        }
Exemplo n.º 29
0
        // PUT: odata/Categories(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Category> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Category category = db.Categories.Find(key);

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

            patch.Put(category);

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

            return(Updated(category));
        }
        // PUT: odata/ReorderRequireds(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <ReorderRequired> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ReorderRequired reorderRequired = db.ReorderRequireds.Find(key);

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

            patch.Put(reorderRequired);

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

            return(Updated(reorderRequired));
        }
Exemplo n.º 31
0
 public Vehicle PatchMotorcycle_When_Expecting_Vehicle(Delta<Vehicle> patch)
 {
     Assert.IsType<Motorcycle>(patch.GetEntity());
     patch.Patch(motorcycle);
     return motorcycle;
 }