예제 #1
0
        public async Task <IActionResult> ProductList(int id, string category = "")
        {
            if (id == 0)
            {
                return(PartialView("/Areas/ScanCenter/Views/Mother/_ProductList.cshtml"));
            }

            if (category.ToLower() == "all")
            {
                category = "";
            }


            ViewBag.Id             = id;
            ViewBag.IsFinalPreview = false;

            var categoryFilterList = await _scanCenterProductQuery.GetByScanCenterId(id, category, true);

            return(PartialView("/Areas/ScanCenter/Views/Mother/_ProductList.cshtml", categoryFilterList));
        }
예제 #2
0
        public async Task <IActionResult> Index(int id)
        {
            if (!await CheckAuth(id))
            {
                return(AccessDenied());
            }

            ViewData["Id"] = id;
            var products = await _scanCenterProductQuery.GetByScanCenterId(id);

            return(View(products));
        }
예제 #3
0
        public async Task <IActionResult> Index(string name, [FromQuery] string refer)
        {
            var profile = await _scanCenterProfileQuery.GetByUniqueName(name);

            ViewData["ProfileId"] = 0;
            if (profile != null)
            {
                var fields = await _scanCenterCustomFieldQuery.GetAllFields(profile.Id);

                ViewData["UniqueName"] = profile.UniqueName;
                ViewData["ProfileId"]  = profile.Id;

                int appid = 0;
                if (!string.IsNullOrEmpty(refer))
                {
                    try
                    {
                        refer = HttpUtility.UrlDecode(refer).Replace(" ", "+");
                        appid = int.Parse(await _cryptography.Decrypt(refer, _appSettings));
                    }
                    catch
                    {
                    }
                }
                ClientMotherModel appointment = await _scanCenterAppointmentQuery.GetById(appid);

                var list = await _scanCenterProductQuery.GetByScanCenterId(profile.Id);

                string[] allCat     = list.Select(s => s.Category).Distinct().ToArray();
                var      tupleModel = new Tuple <ScanCenterProfileModel, IList <ScanCenterCustomFieldModel>,
                                                 string[], ClientMotherModel>(profile, fields, allCat, appointment);
                return(View(tupleModel));
            }
            var tupleModel1 = new Tuple <ScanCenterProfileModel, IList <ScanCenterCustomFieldModel>,
                                         string[], ClientMotherModel>(profile, null, null, null);

            return(View(tupleModel1));
        }