Пример #1
0
        public void Save(bool New)
        {
            if (m_FileHeader == null || New)
            {
                m_FileHeader            = new DesignData(m_Name, m_Category, m_SubSection);
                m_FileHeader.Width      = m_Width;
                m_FileHeader.Height     = m_Height;
                m_FileHeader.UserWidth  = m_UserWidth;
                m_FileHeader.UserHeight = m_UserHeight;

                ExportDesignItems(ref m_FileHeader);

                HouseDesignData.SaveNewDesign(m_FileHeader);
            }
            else
            {
                m_FileHeader.Items.Clear();
                m_FileHeader.Width      = m_Width;
                m_FileHeader.Height     = m_Height;
                m_FileHeader.UserWidth  = m_UserWidth;
                m_FileHeader.UserHeight = m_UserHeight;
                ExportDesignItems(ref m_FileHeader);

                HouseDesignData.UpdateDesign(m_FileHeader);
            }
        }
Пример #2
0
 public void Save(bool newRecord)
 {
     if (newRecord)
     {
         HouseDesignData.SaveNewDesign(this);
     }
     else
     {
         HouseDesignData.UpdateDesign(this);
     }
 }
Пример #3
0
        private void mnuImportMultiCache_Click(object sender, System.EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            MultiCacheDataImporter adapter = new MultiCacheDataImporter();

            ArrayList designs = adapter.ImportDesigns();

            HouseDesignData.BatchSaveNewDesigns(designs);

            Cursor.Current = Cursors.Default;

            if (designs.Count > 0)
            {
                string msg = string.Format("Successfully imported {0} designs.", designs.Count);

                MessageBox.Show(msg);
            }
        }
Пример #4
0
        private void DeleteDesignsFromNode(TreeNode node)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete this?", "UO Architect", MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }

            try
            {
                ArrayList designs = new ArrayList();

                if (node is CategoryNode)
                {
                    GetDesignsFromCategoryNode((CategoryNode)node, ref designs);
                }
                else if (node is SubsectionNode)
                {
                    GetDesignsFromSubsectionNode((SubsectionNode)node, ref designs);
                }
                else if (node is DesignNode)
                {
                    ((DesignNode)node).Delete();
                }

                if (designs.Count > 0)
                {
                    foreach (DesignData design in designs)
                    {
                        HouseDesignData.DeleteDesign(design);
                    }

                    tvwDesigns.Populate(HouseDesignData.DesignHeaders);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Export failed: \n" + ex.Message);
            }
        }
Пример #5
0
        public void Save(bool newRecord)
        {
            if (!IsLoaded)
            {
                Load();
            }

            if (newRecord)
            {
                HouseDesignData.SaveNewDesign(this);
            }
            else
            {
                HouseDesignData.UpdateDesign(this);
            }

            if (OnSaved != null)
            {
                OnSaved();
            }
        }
Пример #6
0
        private void ImportUOARDesign_Click(object sender, System.EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            UOARBatchDataAdapter adapter = new UOARBatchDataAdapter();

            DateTime start = DateTime.Now;

            ArrayList designs = adapter.ImportDesigns();

            HouseDesignData.BatchSaveNewDesigns(designs);

            Cursor.Current = Cursors.Default;

            if (designs.Count > 0)
            {
                DateTime end = DateTime.Now;

                string msg = string.Format("Successfully imported {0} designs for a total of {1:#,##0} items.", designs.Count, adapter.Count);

                MessageBox.Show(msg);
            }
        }
Пример #7
0
 public void Delete()
 {
     HouseDesignData.DeleteDesign(_design);
     (this.Parent as SubsectionNode).RemoveNode(this.Index);
 }
Пример #8
0
 public void Load()
 {
     Unload();
     HouseDesignData.LoadDesign(this);
 }