internal AddParameterForm GetAddParameterForm()
 {
     if (_addParameterForm == null)
     {
         _addParameterForm = new AddParameterForm();
         _topMostForms.Add(_addParameterForm);
     }
     return(_addParameterForm);
 }
예제 #2
0
        private object DetermineTypeAndGetValue(string val, AddParameterForm field)
        {
            object o        = null;
            var    isparsed = false;

            if (string.IsNullOrEmpty(val))
            {
                return(val);
            }

            switch (field.typeInModel)
            {
            case PropertyType.Boolean:
                bool d;
                isparsed = bool.TryParse(val, out d);
                o        = d;
                break;

            case PropertyType.Byte:
                byte d1;
                isparsed = byte.TryParse(val, out d1);
                o        = d1;
                break;

            case PropertyType.Char:
                char d2;
                isparsed = char.TryParse(val, out d2);
                o        = d2;
                break;

            case PropertyType.Decimal:
                decimal d3;
                isparsed = decimal.TryParse(val, out d3);
                o        = d3;
                break;

            case PropertyType.Double:
                double d4;
                isparsed = double.TryParse(val, out d4);
                o        = d4;
                break;

            case PropertyType.Int:
                int d6;
                isparsed = int.TryParse(val, out d6);
                o        = d6;
                break;

            case PropertyType.Int16:
                Int16 d7;
                isparsed = Int16.TryParse(val, out d7);
                o        = d7;
                break;

            case PropertyType.Int64:
                Int64 d8;
                isparsed = Int64.TryParse(val, out d8);
                o        = d8;
                break;

            case PropertyType.Single:
                Single d9;
                isparsed = Single.TryParse(val, out d9);
                o        = d9;
                break;

            case PropertyType.String:
                o = val;
                break;

            case PropertyType.ByteArray:
                throw new NotImplementedException();
                break;

            case PropertyType.TimeSpan:
                TimeSpan d10;
                isparsed = TimeSpan.TryParse(val, out d10);
                o        = d10;
                break;

            case PropertyType.DateTime:
                DateTime d11;
                isparsed = DateTime.TryParse(val, out d11);
                o        = d11;
                break;

            case PropertyType.Long:
                long d12;
                isparsed = long.TryParse(val, out d12);
                o        = d12;
                break;
            }

            if (!isparsed)
            {
                throw new Exception("isparesed is false " + field.nameInMethod);
            }

            return(o);
        }
예제 #3
0
        private void btnAddParameter_Click(object sender, EventArgs e)
        {
            AddParameterForm addParameterForm = new AddParameterForm(this);

            addParameterForm.Show();
        }