예제 #1
0
 public virtual void OkButtonClick(object sender, EventArgs e)
 {
     BaseObject = new BaseObject
     {
         Name = NameTextBox.Text,
         DbLocation = databasesComboBox.SelectedItem.ToString()
     };
     DialogResult = DialogResult.OK;
 }
        public void AddBaseObject(BaseObject objectToAdd, string dataBaseName)
        {
            UniversityContext context;

            switch (dataBaseName)
            {
                case "MsSqlFirstDatabase":
                    context = m_firstUniversityContext;
                    break;
                case "MsSqlSecondDatabse":
                    context = m_thirdUniversityContext;
                    break;
                default:
                    return;
            }
            context.BaseObjects.Add(objectToAdd);
            context.SaveChanges();
        }
예제 #3
0
 private void UpdateTreeView(BaseObject baseObject)
 {
     m_selectedNode.Nodes.Add(new TreeNode
     {
         Text = baseObject.Name,
         Tag = baseObject
     });
 }
예제 #4
0
 public void AddBaseObject(BaseObject baseObject)
 {
     m_client.AddBaseObject(baseObject, baseObject.DbLocation);
 }