예제 #1
0
        public async Task <ActionResult <SubCategoryType> > PostSubCategoryType(SubCategoryType subCategoryType)
        {
            _context.SubCategoryTypes.Add(subCategoryType);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSubCategoryType", new { id = subCategoryType.SubCategoryTypeId }, subCategoryType));
        }
예제 #2
0
        public async Task <IActionResult> PutSubCategoryType(int id, SubCategoryType subCategoryType)
        {
            if (id != subCategoryType.SubCategoryTypeId)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
                    Status = "Error", Message = "This subcategory type id does not exist!"
                }));
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SubCategoryTypeExists(id))
                {
                    return(StatusCode(StatusCodes.Status500InternalServerError, new Response {
                        Status = "Error", Message = "This subcategory type id does not exist!"
                    }));
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #3
0
        public void WhenISelectProductTypesSub_Category(SubCategoryType subCategoryType)
        {
            CreateNewProductPage createNewProduct = new CreateNewProductPage(Driver, _appSettings);

            createNewProduct.ClickAction(subCategoryType);
            Wait.Seconds(1);
        }
예제 #4
0
 internal void ClickAction(SubCategoryType subCategoryType)
 {
     ElementLocatorExtensions.GetElementXpath(productTypeTitle, "bags").ClickButton();
     Wait.Seconds(1);
     this.GetActionButton(subCategoryType).Click();
 }
예제 #5
0
 private By GetActionButton(SubCategoryType action)
 {
     return(By.XPath(string.Format(subCatImg, action.GetEnumDescription())));
 }