コード例 #1
0
ファイル: MotherController.cs プロジェクト: TechnoHeap/4dscan
        public async Task <IActionResult> GetAppointment(int id)
        {
            if (id == 0)
            {
                return(PartialView("/Areas/ScanCenter/Views/Mother/_AppointmentDetail.cshtml"));
            }

            ViewBag.Id = id;

            var app = await _scanCenterAppointmentQuery.GetById(id);

            if (!await CheckAuth(app.ScanCenterProfileId))
            {
                return(PartialView("/Areas/ScanCenter/Views/Mother/_AppointmentDetail.cshtml", null));
            }

            ViewBag.ScanCenterProfileId = app.ScanCenterProfileId;
            return(PartialView("/Areas/ScanCenter/Views/Mother/_AppointmentDetail.cshtml", app));
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: TechnoHeap/4dscan
        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));
        }