Ejemplo n.º 1
0
 private void DelParameter()
 {
     if (this.gridView1.RowCount > 0 && this.gridView1.FocusedRowHandle >= 0)
     {
         MD_InputModel_ChildParam _p = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as MD_InputModel_ChildParam;
         this.gridView1.BeginUpdate();
         this.inputModelChild.Parameters.Remove(_p);
         this.gridView1.EndUpdate();
     }
     RaiseMenuChanged();
 }
Ejemplo n.º 2
0
        public static List <MD_InputModel_Child> GetChildInputModel(MD_InputModel _model)
        {
            List <MD_InputModel_Child> _ret = new List <MD_InputModel_Child>();

            using (SqlConnection cn = SqlHelper.OpenConnection())
            {
                SqlCommand _cmd = new SqlCommand(SQL_GetChildInputModel, cn);
                _cmd.Parameters.Add("@IVID", _model.ID);
                SqlDataReader _dr = _cmd.ExecuteReader();
                while (_dr.Read())
                {
                    string _cns                = _dr.IsDBNull(4) ? "" : _dr.GetString(4);
                    string _cname              = _dr.IsDBNull(5) ? "" : _dr.GetString(5);
                    string _paramstring        = _dr.IsDBNull(3) ? "" : _dr.GetString(3);
                    MD_InputModel_Child _child = new MD_InputModel_Child(
                        _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString(),
                        string.Format("{0}.{1}", _model.NameSpace, _model.ModelName),
                        string.Format("{0}.{1}", _cns, _cname),
                        _dr.IsDBNull(6) ? 0 : Convert.ToInt32(_dr.GetDecimal(6))
                        );
                    _child.ShowCondition = _dr.IsDBNull(7) ? "" : _dr.GetString(7);
                    _child.SelectMode    = _dr.IsDBNull(8) ? 0 : Convert.ToInt16(_dr.GetDecimal(8));
                    _child.ChildModel    = GetInputModel(_cns, _cname);
                    if (_child.Parameters == null)
                    {
                        _child.Parameters = new List <MD_InputModel_ChildParam>();
                    }
                    foreach (string _pstr in StrUtils.GetMetasByName2("PARAM", _paramstring))
                    {
                        string[] _s = _pstr.Split(':');
                        MD_InputModel_ChildParam _p = new MD_InputModel_ChildParam(_s[0], _s[1], _s[2]);
                        _child.Parameters.Add(_p);
                    }
                    _ret.Add(_child);
                }
                _dr.Close();
            }
            return(_ret);
        }