Example #1
0
        /// <summary>
        /// 获取模板信息
        /// </summary>
        /// <param name="template">模板信息</param>
        public void GetTemplate(ref SecurityFilterTemplate template)
        {
            TextBoxA  txtName        = GetTextBox("txtName");
            TextBoxA  txtIndicator   = GetTextBox("txtIndicator");
            TextBoxA  txtParameters  = GetTextBox("txtParameters");
            ComboBoxA cbCycle        = GetComboBox("cbCycle");
            ComboBoxA cbSubscription = GetComboBox("cbSubscription");
            TextBoxA  txtFilter      = GetTextBox("txtFilter");

            if (m_template.m_templateID != null && m_template.m_templateID.Length > 0)
            {
                template.m_templateID = m_template.m_templateID;
            }
            template.m_name       = txtName.Text;
            template.m_indicator  = txtIndicator.Text;
            template.m_parameters = txtParameters.Text;
            if (cbCycle.SelectedValue != null)
            {
                template.m_cycle = CStrA.ConvertStrToInt(cbCycle.SelectedValue);
            }
            else
            {
                template.m_cycle = 1440;
            }
            template.m_subscription = cbSubscription.SelectedIndex;
            template.m_filter       = txtFilter.Text;
            template.m_codes        = m_codes;
            template.m_userID       = DataCenter.UserID;
        }
Example #2
0
        /// <summary>
        /// 由字符串转化为对象
        /// </summary>
        /// <param name="str">字符串</param>
        public void CodesFromString(String str)
        {
            m_codes.Clear();
            String[] strs     = str.Split(new String[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            int      strsSize = strs.Length;

            for (int i = 0; i < strsSize; i++)
            {
                String[] subStrs = strs[i].Split(new String[] { ":" }, StringSplitOptions.RemoveEmptyEntries);
                m_codes[subStrs[0]] = CStrA.ConvertStrToInt(subStrs[1]);
            }
        }