Beispiel #1
0
        public void SaveNewObject(IMS_Object myNewObject)
        {
            SqlCommand save = new SqlCommand();

            save.Connection  = con;
            save.CommandType = CommandType.StoredProcedure;
            save.CommandText = "IMS_ADD_OBJECT";

            string temp;

            if (myNewObject.OBJECT_ID == null)
            {
                temp = "-1";
            }
            else
            {
                temp = myNewObject.OBJECT_ID;
            }

            save.Parameters.AddWithValue("inID", temp);
            save.Parameters.AddWithValue("inOBJECT_TYPE", MainForm.selected_Object_Type);
            save.Parameters.Add("@outOBJECT_ID", SqlDbType.Int).Direction = ParameterDirection.Output;

            save.Connection.Open();
            reader       = save.ExecuteReader();
            lastObjectID = (int)save.Parameters["@outOBJECT_ID"].Value;

            reader.Close();
            save.Connection.Close();
        }
Beispiel #2
0
 public AddObjectControl()
 {
     InitializeComponent();
     myNewObject = new IMS_Object();
 }