Esempio n. 1
0
        private void CbSqlList_SelectedIndexChanged(object sender, EventArgs e)
        {
            _Sql = CbSqlList.SelectedItem as Dml;
            if (_Sql == null)
            {
                return;
            }

            TbSql.Text = _Sql.Text;
            TpInput.Controls.Clear();
            TpInput.RowStyles.Clear();
            _UcList.Clear();

            foreach (string key in _ArgInput.Keys)
            {
                _ArgIndex[key] = 0;
            }

            int i = 0;
            int h = 6;
            Label label;
            IInput input;
            foreach (Param param in _Sql.Params)
            {
                TpInput.RowStyles.Add(GetStyle(i));

                label = GetLabel(i);
                TpInput.Controls.Add(label, 0, i);
                label.Text = param.Text;

                input = GetInput(param.Type);
                TpInput.Controls.Add(input.Control, 1, i);
                input.Param = param;
                h += 27;

                _UcList.Add(input);
                i += 1;
            }

            TpInput.RowStyles.Add(_DefStyle);
            TpInput.Height = h;
        }
Esempio n. 2
0
        public void Init(IEngine engine)
        {
            _DefStyle = new RowStyle(SizeType.Percent, 100F);
            _UcList = new List<IInput>();

            string file = Path.Combine(_UserModel.Home, "ASql-Pdf.xml");
            if (!File.Exists(file))
            {
                return;
            }
            XmlDocument doc = new XmlDocument();
            doc.Load(file);

            Dml sql;
            foreach (XmlNode node in doc.SelectNodes("/Amon/Sqls/Sql"))
            {
                sql = new Dml();
                sql.Load(node);
                CbSqlList.Items.Add(sql);
            }
        }