コード例 #1
0
        private Helpers.PageInput getFlagboardDropdown(string CID, int MFB_Id = 0)
        {
            string selVal = (MFB_Id == 0) ? "" : MFB_Id.ToString();

            Helpers.PageInput fbInput = new Helpers.PageInput("select", "Flagboards", "MFB_Id", "MFB_Id", selVal);
            try
            {
                Helpers.CtxService       service = new Helpers.CtxService(null, CID);
                List <Models.pageInputs> fbs     = service.getFlagBoardsInput();

                if (fbs == null || fbs.Count == 0)
                {
                    fbInput.errorFlag    = true;
                    fbInput.errorMessage = "ERROR: No FlagBoards found in database.";
                    return(fbInput);
                }

                foreach (var item in fbs)
                {
                    fbInput.input.options.Add(new Helpers.InputObject.option {
                        text = "FB " + item.value, value = item.key
                    });
                }
            }
            catch (Exception ex)
            {
                fbInput.errorFlag    = true;
                fbInput.errorMessage = "ERROR CREATING FB SELECT LIST: " + ex.Message;
            }

            return(fbInput);
        }