Beispiel #1
0
        public static MvcHtmlString CompCombo(this HtmlHelper helper, string id, T_COMPANY_COND Param = null, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            Param            = (Param == null) ? new T_COMPANY_COND {
            } : Param;
            Param.PAGE_COUNT = 10000;
            Param.SORT       = "A.COMPANY_NAME";

            if (SessionHelper.LoginInfo.COMPANY_CODE != 1)
            {
                Param.COMPANY_CODE = SessionHelper.LoginInfo.COMPANY_CODE;
                optionLabel        = null;
            }
            IList <T_COMPANY> list = Service.basicService.GetCompanyList(Param);



            var combo = list.Select(s => new SelectListItem {
                Value = s.COMPANY_CODE.ToString(), Text = s.COMPANY_NAME, Selected = (selectedValue == s.COMPANY_CODE.ToString()) ? true : false
            });

            var    arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);
            string shtml           = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            return(new MvcHtmlString(shtml));
        }
Beispiel #2
0
        public static MvcHtmlString CommonComboNormal(this HtmlHelper helper, string id, List <SelectListItem> list, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            var    arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);
            string shtml           = helper.DropDownList(id, list, optionLabel, arrHtmlAtribute).ToHtmlString();

            //shtml += "<script >$('document').ready(function () { try{ $('#" + id + "').prev().html($('#" + id + "  option:selected').text()); } catch(e){} }); </script>";

            return(new MvcHtmlString(shtml));
        }
Beispiel #3
0
        public static MvcHtmlString CompCombo(this HtmlHelper helper, string id, IList <T_COMPANY> list, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            var combo = list.Select(s => new SelectListItem {
                Value = s.COMPANY_CODE.ToString(), Text = s.COMPANY_NAME, Selected = (selectedValue == s.COMPANY_CODE.ToString()) ? true : false
            });

            var    arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);
            string shtml           = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            return(new MvcHtmlString(shtml));
        }
Beispiel #4
0
        /// <summary>
        /// 회원콤보
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="Param"></param>
        /// <param name="selectedValue"></param>
        /// <param name="optionLabel"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static MvcHtmlString MemberCombo(this HtmlHelper helper, string id, T_MEMBER_COND Param, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            IList <T_MEMBER> list = new AccountService().GetMemberList(Param);

            var combo = list.Select(s => new SelectListItem {
                Value = s.MEMBER_CODE.ToString(), Text = s.USER_NAME, Selected = (selectedValue == s.MEMBER_CODE.ToString()) ? true : false
            });

            var    arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);
            string shtml           = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            return(new MvcHtmlString(shtml));
        }
Beispiel #5
0
        /// <summary>
        /// 공통코드
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="Param"></param>
        /// <param name="selectedValue"></param>
        /// <param name="optionLabel"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static MvcHtmlString CommonCombo(this HtmlHelper helper, string id, T_COMMON_COND Param, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            Param.HIDE = (Param.HIDE == null) ? false : Param.HIDE;
            IList <T_COMMON> list = new BaseService().GetCommon(Param);

            var combo = list.Select(s => new SelectListItem {
                Value = s.SUB_CODE.ToString(), Text = s.NAME, Selected = (selectedValue == s.SUB_CODE.ToString()) ? true : false
            });
            var arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);

            string shtml = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            //shtml += "<script >$('document').ready(function () { try{ $('#" + id + "').prev().html($('#" + id + "  option:selected').text()); } catch(e){} }); </script>";

            return(new MvcHtmlString(shtml));
        }
Beispiel #6
0
        /// <summary>
        /// 공통코드
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="Param"></param>
        /// <param name="selectedValue"></param>
        /// <param name="optionLabel"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static MvcHtmlString CommonCombo(this HtmlHelper helper, string id, T_COMMON_COND Param, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null, enComboDisType enComboDisType = enComboDisType.NAME)
        {
            /***ID가 STATUS인경우 selected에 문제가 발생함(PartialView을 Ajax호출할 경우 발생함)  ****/
            optionLabel = optionLabel ?? "-선택-";
            if (optionLabel == "-1*")
            {
                optionLabel = null;
            }
            Param.HIDE = (Param.HIDE == null) ? false : Param.HIDE;
            IList <T_COMMON> list = new CommonService().GetCommon(Param);
            var arrHtmlAtribute   = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);


            IEnumerable <SelectListItem> combo = new List <SelectListItem>();

            switch (enComboDisType)
            {
            case enComboDisType.REF_DATA1:
                combo = list.Select(s => new SelectListItem {
                    Value = s.SUB_CODE.ToString(), Text = s.REF_DATA1, Selected = (selectedValue == s.SUB_CODE.ToString()) ? true : false
                }).ToList();
                break;

            case enComboDisType.REF_DATA2:
                combo = list.Select(s => new SelectListItem {
                    Value = s.SUB_CODE.ToString(), Text = s.REF_DATA2, Selected = (selectedValue == s.SUB_CODE.ToString()) ? true : false
                }).ToList();
                break;

            case enComboDisType.REF_DATA3:
                combo = list.Select(s => new SelectListItem {
                    Value = s.SUB_CODE.ToString(), Text = s.REF_DATA3, Selected = (selectedValue == s.SUB_CODE.ToString()) ? true : false
                }).ToList();
                break;

            default:
                combo = list.Select(s => new SelectListItem {
                    Value = s.SUB_CODE.ToString(), Text = s.NAME, Selected = (selectedValue == s.SUB_CODE.ToString()) ? true : false
                }).ToList();
                break;
            }
            string shtml = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            //shtml += "<script >$('document').ready(function () { try{ $('#" + id + "').prev().html($('#" + id + "  option:selected').text()); } catch(e){} }); </script>";

            return(new MvcHtmlString(shtml));
        }
Beispiel #7
0
        /// <summary>
        /// 매장콤보
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="Param"></param>
        /// <param name="selectedValue"></param>
        /// <param name="optionLabel"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static MvcHtmlString StoreCombo(this HtmlHelper helper, string id, T_STORE_COND Param = null, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null)
        {
            Param = (Param == null) ? new T_STORE_COND {
                DISPLAY_MODE = "Normal"
            } : Param;
            if (Param.DISPLAY_MODE != "Total")
            {
                if (SessionHelper.LoginInfo.STORE.STORE_CODE != 1)
                {
                    Param.COMPANY_CODE = SessionHelper.LoginInfo.STORE.COMPANY_CODE;
                }

                if (!(SessionHelper.LoginInfo.STORE.STORE_TYPE == 1 || SessionHelper.LoginInfo.STORE.STORE_TYPE == 4))
                {
                    Param.STORE_CODE = SessionHelper.LoginInfo.STORE.STORE_CODE;
                    selectedValue    = null;
                }
            }
            if (Param.COMPANY_CODE == null)
            {
                Param.COMBO_DISPLAY = 1;
            }
            if (Param.PAGE_COUNT == null)
            {
                Param.PAGE_COUNT = 999999999;
            }
            IList <T_STORE> list = Service.basicService.GetStoreList(new T_STORE_COND());

            if (list.Count() == 1)
            {
                optionLabel = null;
            }
            var combo = list.Select(s => new SelectListItem {
                Value = s.STORE_CODE.ToString(), Text = ((Param.COMBO_DISPLAY == 1 && s.COMPANY_NAME != s.STORE_NAME) ? (s.COMPANY_NAME + ">") : "") + s.STORE_NAME, Selected = (selectedValue == s.STORE_CODE.ToString()) ? true : false
            });

            var    arrHtmlAtribute = SemanticUIHelper.SetDefaultSemanticSize(htmlAttributes, semaintic_size);
            string shtml           = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString();

            return(new MvcHtmlString(shtml));
        }