コード例 #1
0
        public IActionResult PCBChangeItem(Int64 ParameterID)
        {
            ParameterService parameterService = new ParameterService(_context);


            List <SelectListItem> PCBItemList = parameterService.GetSelectList(ParameterID);

            return(Json(PCBItemList));
        }
コード例 #2
0
        //consume custom security service to get all roles
        public IActionResult Index()
        {
            m_ConfigurationPartial model            = new m_ConfigurationPartial();
            ParameterService       parameterService = new ParameterService(_context);
            FileService            FileService      = new FileService(_hostingEnvironment, _context);

            var user = _userManager.GetUserId(HttpContext.User);

            //組態設定-CNS範本
            if (_context.PDC_File.Where(x => x.FunctionName == "ConfigurationSample").Any())
            {
                model.CNS_Sample = _context.PDC_File.Where(x => x.FunctionName == "ConfigurationSample").OrderByDescending(x => x.CreatorDate).FirstOrDefault();
            }
            //組態設定-首頁連結
            model.HomeLinkList     = parameterService.GetParameterList("Configuration_HomeLink");
            model.HomeLinkFileList = _context.PDC_File.Where(x => x.FunctionName == "Configuration_HomeLink").ToList();

            //組態設定-圖文說明
            model.PCBTypeList = parameterService.GetSelectList("PCBLayoutConstraint");
            if (model.PCBTypeList.Any())
            {
                model.PCBTypeItemList = parameterService.GetSelectList(Convert.ToInt64(model.PCBTypeList.First().Value));
            }

            //組態設定-清單與罐頭
            model.PCBParameterList = parameterService.GetSelectList("PCBTypeList");
            //組態設定-其他
            model.Announcement    = parameterService.GetParameterOne("ConfigurationAnnouncement");
            model.Description     = parameterService.GetParameterOne("ConfigurationDescription");
            model.ApplyDraw       = parameterService.GetParameterOne("ConfigurationApplyDraw");
            model.SendReturn      = parameterService.GetParameterOne("ConfigurationSendReturn");
            model.Release         = parameterService.GetParameterOne("ConfigurationRelease");
            model.Reject          = parameterService.GetParameterOne("ConfigurationReject");
            model.FormApply       = parameterService.GetParameterOne("ConfigurationFormApply");
            model.WorkDetail      = parameterService.GetParameterOne("ConfigurationWorkDetail");
            model.WorkDetail_File = FileService.GetFileList("ConfigurationWorkDetail", model.WorkDetail.ParameterID).FirstOrDefault();

            model.SystemCategoryList = parameterService.GetSelectList("SystemCategory", false);

            return(View(model));
        }