Beispiel #1
0
        public async Task <IActionResult> PutProductTypePage(int id, ProductTypePage productTypePage)
        {
            if (id != productTypePage.ProductTypePageId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <ProductTypePage> > PostProductTypePage(ProductTypePage productTypePage)
        {
            _context.productTypePages.Add(productTypePage);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProductTypePage", new { id = productTypePage.ProductTypePageId }, productTypePage));
        }
Beispiel #3
0
 public ProductLabel(ProductResponse product, string typeName, ProductTypePage page)
 {
     _product  = product;
     _typeName = typeName;
     _page     = page;
     InitializeComponent();
 }
Beispiel #4
0
 public AddProductForm(string typeId, string typeName, ProductTypePage page)
 {
     _typeId   = typeId;
     _typeName = typeName;
     _page     = page;
     InitializeComponent();
 }
Beispiel #5
0
        public ActionResult CategoryMenu()
        {
            CreateRepos();
            try
            {
                List <ProductTypePage> CategoryPages = new List <ProductTypePage>();
                List <ProductType>     catetorys     = ProductRepos.getProductTypeParent();

                if (catetorys.Count() > 0)
                {
                    foreach (ProductType cate in catetorys)
                    {
                        ProductTypePage categoryPage = new ProductTypePage();
                        categoryPage.Id          = cate.ID;
                        categoryPage.Image       = cate.ImageBanner;
                        categoryPage.Name        = cate.Name;
                        categoryPage.Icon        = cate.Icon;
                        categoryPage.CategorySub = ProductRepos.getProductTypeByParent(cate.ID);

                        CategoryPages.Add(categoryPage);
                    }
                }

                string view = "~/Views/themes/" + Theme.domain + "/Menu/CategoryMenu.cshtml";
                return(View(view, CategoryPages));
            }
            catch (Exception ex)
            {
                return(Content(ex.InnerException.ToString()));
            }
            finally
            {
                DisposeRepos();
            }
        }
Beispiel #6
0
 public TypeRow(string typeName, string typeId, ProductTypePage page)
 {
     _typeName = typeName;
     _typeId   = typeId;
     _page     = page;
     InitializeComponent();
 }
Beispiel #7
0
 public DeleteAlert(string content, string image, ProductTypePage page, ProductResponse product)
 {
     _content = content;
     _image   = image;
     _page    = page;
     _product = product;
     InitializeComponent();
 }
Beispiel #8
0
        public ActionResult Menu()
        {
            V308CMSEntities        mEntities          = new V308CMSEntities();
            ProductRepository      productRepository  = new ProductRepository(mEntities);
            NewsRepository         newsRepository     = new NewsRepository(mEntities);
            List <ProductType>     mProductTypeParent = null;
            List <ProductTypePage> mProductTypePage   = new List <ProductTypePage>();
            News mNews;
            ProductTypePageContainer mProductTypePageContainer = new ProductTypePageContainer();
            ImagesRepository         imagesRepository          = new ImagesRepository(mEntities);
            List <Image>             mListImage;

            try
            {
                //lay danh sach nhom tin
                mProductTypeParent = productRepository.getProductTypeParent();
                //lay danh sach cac tin theo nhom
                foreach (ProductType it in mProductTypeParent)
                {
                    ProductTypePage vProductTypePage = new ProductTypePage();
                    vProductTypePage.Id    = it.ID;
                    vProductTypePage.Image = it.ImageBanner;
                    vProductTypePage.Name  = it.Name;
                    //lay danh sach cac nhom con
                    List <ProductType> mProductTypeChild = productRepository.LayNhomSanPhamTheoTrangVaSeri(1, 10, it.ID);
                    vProductTypePage.List = mProductTypeChild;
                    mProductTypePage.Add(vProductTypePage);
                    //
                    mProductTypePageContainer.List = mProductTypePage;
                    mNews = newsRepository.getFirstNewsWithType(16);
                    mProductTypePageContainer.mNews = mNews;
                    //lay danh sach
                    mListImage = imagesRepository.GetImageByTypeId(1, 4);
                    mProductTypePageContainer.ImageList = mListImage;
                }
                return(View(mProductTypePageContainer));
            }
            catch (Exception ex)
            {
                Console.Write(ex);
                return(Content("<dx></dx>"));
            }
            finally
            {
                mEntities.Dispose();
                productRepository.Dispose();
            }
        }
        public async void OnWidgetTapped(object sender, EventArgs e)
        {
            if (_processingTag)
            {
                return;
            }

            _processingTag = true;

            try{
                await AnimateItem(this, animationDuration);

                await ProductTypePage.NavigateToCategory((SampleCategory)BindingContext, Navigation);
            }finally{
                _processingTag = false;
            }
        }
Beispiel #10
0
        private async void confirmDe_Click(object sender, EventArgs e)
        {
            confirmDe.Enabled = false;
            this.Close();
            if (_product != null)
            {
                var storageApi = RestService.For <IStorageApi>("https://localhost:5001?pagenumber", new RefitSettings
                {
                    AuthorizationHeaderValueGetter = () => Task.FromResult(LoginForm.cachedToken)
                });

                var deleted = await storageApi.DeleteProductAsync(_product.Id);

                _page.Controls.Clear();
                ProductTypePage productTypePage = new ProductTypePage();
                _page.Controls.Add(productTypePage);
            }
        }
Beispiel #11
0
        void BtnRedirectEvent(int thisIndex, int lastIndex)
        {
            if (optionBtn[thisIndex].Normalcolor != Color.FromArgb(65, 62, 83))
            {
                List <string> pageName = new List <string>
                {
                    "DashboardPg",
                    "productTypePg",
                    "BillMngPg",
                    "StatisticPg"
                };

                optionBtn[thisIndex].Active      = true;
                optionBtn[thisIndex].Normalcolor = Color.FromArgb(65, 62, 83);

                optionBtn[lastIndex].Active      = false;
                optionBtn[lastIndex].Normalcolor = Color.FromArgb(11, 7, 17);

                activeBar.Top = optionBtn[thisIndex].Top;
                activeBar.BringToFront();

                bunifuPages1.PageName = pageName[thisIndex];

                switch (thisIndex)
                {
                case 0:
                    dasboardTemplate = new DashboardPage();
                    DashboardPg.Controls.Add(dasboardTemplate);
                    break;

                case 1:
                    productTypeTemplate = new ProductTypePage();
                    productTypePg.Controls.Add(productTypeTemplate);
                    break;

                case 2:
                    billTemplate = new BillPage();
                    BillMngPg.Controls.Add(billTemplate);
                    break;

                case 3:
                    statisticTemplate = new StatisticPage();
                    StatisticPg.Controls.Add(statisticTemplate);
                    break;
                }

                switch (lastIndex)
                {
                case 0:
                    DashboardPg.Controls.Remove(dasboardTemplate);
                    dasboardTemplate.Dispose();
                    break;

                case 1:
                    productTypePg.Controls.Remove(productTypeTemplate);
                    productTypeTemplate.Dispose();
                    break;

                case 2:
                    BillMngPg.Controls.Remove(billTemplate);
                    billTemplate.Dispose();
                    break;

                case 3:
                    StatisticPg.Controls.Remove(statisticTemplate);
                    statisticTemplate.Dispose();
                    break;
                }
            }
        }