Esempio n. 1
0
        /// <summary>
        /// Debt tracing result
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString DebtTracingPostponeReasonCombo(this HtmlHelper helper, string id, object attribute = null)
        {
            ICommonHandler comh = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <string>  lst  = new List <string>();

            lst.Add(MiscType.C_DEBT_TRACING_POSTPONE_REASON);
            List <doMiscTypeCode> dtTransportType = comh.GetMiscTypeCodeListByFieldName(lst);

            CommonUtil.eFirstElementType idx0_type = CommonUtil.eFirstElementType.Select;
            return(CommonUtil.CommonComboBox <doMiscTypeCode>(id, dtTransportType, "ValueCodeDisplay", "ValueCode", attribute, true, idx0_type));
        }
Esempio n. 2
0
        /// <summary>
        /// Debt tracing result
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <returns></returns>
        public static MvcHtmlString DebtTracingResultCombo(this HtmlHelper helper, string id, object attribute = null)
        {
            ICommonHandler comh = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <string>  lst  = new List <string>();

            lst.Add(MiscType.C_DEBT_TRACING_RESULT);
            List <doMiscTypeCode> dtMisc = comh.GetMiscTypeCodeListByFieldName(lst);

            if (CommonUtil.dsTransData != null)
            {
                if (!CommonUtil.dsTransData.ContainsPermission(ScreenID.C_SCREEN_ID_DEBT_TRACING, FunctionID.C_FUNC_ID_TRANSFER_TO_BRANCH))
                {
                    dtMisc = dtMisc.Where(d =>
                                          d.ValueCode != DebtTracingResult.C_DEBT_TRACE_RESULT_TRANSFER_TO_BRANCH &&
                                          d.ValueCode != DebtTracingResult.C_DEBT_TRACE_RESULT_TRANSFER_TO_HQ
                                          ).ToList();
                }
            }

            CommonUtil.eFirstElementType idx0_type = CommonUtil.eFirstElementType.Select;
            return(CommonUtil.CommonComboBox <doMiscTypeCode>(id, dtMisc, "ValueCodeDisplay", "ValueCode", attribute, true, idx0_type));
        }
Esempio n. 3
0
        public void SetList <T>(List <T> lst, string display, string value, bool include_idx0 = true, CommonUtil.eFirstElementType idx0_type = CommonUtil.eFirstElementType.Select) where T : class
        {
            if (lst == null)
            {
                this.objLst = null;
            }
            else
            {
                this.objLst = new List <ComboBoxOptionModel>();
                if (include_idx0)
                {
                    //MessageModel select = MessageUtil.GetMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0113);
                    string strFirstElemText = string.Empty;

                    if (idx0_type == CommonUtil.eFirstElementType.Select)
                    {
                        strFirstElemText = CommonUtil.GetLabelFromResource("Common", "CommonResources", "lblComboboxSelect");
                    }
                    if (idx0_type == CommonUtil.eFirstElementType.Short)
                    {
                        strFirstElemText = CommonUtil.GetLabelFromResource("Common", "CommonResources", "lblComboboxCUSTOM_SELECT");
                    }
                    else if (idx0_type == CommonUtil.eFirstElementType.All)
                    {
                        strFirstElemText = CommonUtil.GetLabelFromResource("Common", "CommonResources", "lblComboboxAll");
                    }

                    ComboBoxOptionModel foModel = new ComboBoxOptionModel()
                    {
                        Display = strFirstElemText,    //select.Message,
                        Value   = ""
                    };
                    objLst.Add(foModel);
                }

                foreach (T et in lst)
                {
                    PropertyInfo propD = et.GetType().GetProperty(display);
                    PropertyInfo propV = et.GetType().GetProperty(value);
                    if (propD != null && propV != null)
                    {
                        if (propD.GetValue(et, null) != null &&
                            propV.GetValue(et, null) != null)
                        {
                            ComboBoxOptionModel oModel = new ComboBoxOptionModel()
                            {
                                Display = propD.GetValue(et, null).ToString(),
                                Value   = propV.GetValue(et, null).ToString()
                            };
                            objLst.Add(oModel);
                        }
                    }
                }
            }
        }