예제 #1
0
        public ActionResult Index(string pid, string moduleName, int isActive = -1, int isAdvert = -1, int pageIndex = 1)
        {
            List <ProductDescriptionModel> data = null;
            var totalCount = 0;

            if (!string.IsNullOrEmpty(pid))
            {
                pid = pid.Replace('/', '|');
            }

            data = ProductModuleConfigManager.SelectAllProductConfig(5, pageIndex, pid, isActive, isAdvert, moduleName, out totalCount).ToList();

            ProductDescriptionViewModel model = new ProductDescriptionViewModel()
            {
                productDescriptionList = ProductDescriptionViewModel.ConvertToList(data),
            };

            ViewBag.IsAdvert   = isAdvert;
            ViewBag.PID        = pid;
            ViewBag.IsActive   = isActive;
            ViewBag.ModuleName = moduleName;

            var list  = new OutData <List <ProductDescriptionViewModel>, int>(model.productDescriptionList, totalCount);
            var pager = new PagerModel(pageIndex, 5)
            {
                TotalItem = totalCount
            };

            if (model == null)
            {
                return(View());
            }
            return(this.View(new ListModel <ProductDescriptionViewModel>(list.ReturnValue, pager)));
        }
예제 #2
0
        public async Task <IActionResult> AddDescription(int id)
        {
            ProductDescriptionViewModel model = new ProductDescriptionViewModel();

            model.Description = _sqlProduct.GetProduct(id).Description;

            return(View(model));
        }
예제 #3
0
 public ProductDescription(object obj)
 {
     InitializeComponent();
     pm                = (ProductModel)obj;
     viewModel         = App.Locator.AdminProduct;
     viewModel.Product = pm;
     BindingContext    = viewModel;
 }
예제 #4
0
        public IActionResult AddDescription(ProductDescriptionViewModel model)
        {
            Product product = new Product();

            product.Id          = model.Id;
            product.Description = model.Description;

            _sqlProduct.UpdateDescription(product);

            return(RedirectToAction(nameof(GetAllProducts)));
        }
        public async Task <IActionResult> ProductPage(Guid ProductGUID)
        {
            var                 productDetailsViewModel = new ProductDescriptionViewModel();
            HttpClient          client = _api.Initial();
            HttpResponseMessage res    = await client.GetAsync($"product/{ProductGUID}");

            string results = "";

            if (res.IsSuccessStatusCode)
            {
                results = res.Content.ReadAsStringAsync().Result;
                productDetailsViewModel.Product = JsonConvert.DeserializeObject <ProductDetailsDTO>(results);
            }
            return(View(productDetailsViewModel));
        }
예제 #6
0
        public ActionResult AddProductDescModule(string id)
        {
            ProductDescriptionViewModel model = new ProductDescriptionViewModel();

            if (string.IsNullOrWhiteSpace(id))
            {
                return(View(new ProductDescriptionViewModel()));
            }
            var pkid   = Convert.ToInt32(id);
            var result = ProductModuleConfigManager.GetProductDescModuleDetail(pkid).ToList();

            model = ProductDescriptionViewModel.ConvertToList(result).FirstOrDefault();

            return(View(model));
        }