Esempio n. 1
0
        public async Task <IActionResult> CustomField(int id)
        {
            if (!await CheckAuth(id))
            {
                return(AccessDenied());
            }

            ViewBag.Name = "Custom Fields";
            var profile = await _scanCenterProfileQuery.GetById(id);

            if (profile != null)
            {
                ViewBag.Name = profile.Name;
            }
            ViewData["Id"] = id;
            IList <ScanCenterCustomFieldModel> fields = await _scanCenterCustomFieldQuery.GetAllFields(id);

            return(View(fields));
        }
Esempio n. 2
0
        public async Task <IActionResult> EditAppointment(int id)
        {
            if (id == 0)
            {
                return(PartialView("/Areas/ScanCenter/Views/Mother/_EditAppointment.cshtml"));
            }


            ViewBag.Id = id;
            var app = await _scanCenterAppointmentQuery.GetById(id);

            if (!await CheckAuth(app.ScanCenterProfileId))
            {
                return(PartialView("/Areas/ScanCenter/Views/Mother/_EditAppointment.cshtml", new Tuple <ClientMotherModel, IList <ScanCenterCustomFieldModel> >(null, null)));
            }

            var fields = await _scanCenterCustomFieldQuery.GetAllFields(app.ScanCenterProfileId);

            ViewBag.ScanCenterProfileId = app.ScanCenterProfileId;

            return(PartialView("/Areas/ScanCenter/Views/Mother/_EditAppointment.cshtml", new Tuple <ClientMotherModel, IList <ScanCenterCustomFieldModel> >(app, fields)));
        }
Esempio n. 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));
        }