Exemplo n.º 1
0
        private void save()
        {
            STORAGE storage = new STORAGE();


            if (STORAGEcontroller.checkName(tbxSave.Text))
            {
                storage.NAME_S        = tbxSave.Text;
                storage.ID_BOARD      = BOARDcontroller.getID();
                storage.DATE_MODIFIED = DateTime.Now;
                saveBoard(storage.ID_BOARD);//, false);
                if (STORAGEcontroller.addStorage(storage))
                {
                    MessageBox.Show("saved successfully",
                                    "Information",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
            else
            {
                DialogResult dr = MessageBox.Show("This name already exists !",
                                                  "Warning",
                                                  MessageBoxButtons.OK,
                                                  MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        public void update()
        {
            //storage
            STORAGE storage = new STORAGE();

            storage.ID_BOARD      = mindmap.board.id;
            storage.NAME_S        = STORAGEcontroller.getNameStorage(storage.ID_BOARD);
            storage.DATE_MODIFIED = DateTime.Now;

            //board
            BOARD board = new BOARD();

            board.ID     = storage.ID_BOARD;
            board.WIDTH  = mindmap.board.picbox.Width;
            board.HEIGHT = mindmap.board.picbox.Height;
            board.COLOR  = HexConverter(mindmap.board.picbox.BackColor);

            //node
            TOPICcontroller.removeNode(convertNodeToTopic(board, mindmap.listDelete));
            mindmap.listDelete.Clear();
            List <TOPIC> existTopics = new List <TOPIC>()
            {
            };

            existTopics = TOPICcontroller.getListTopic(board.ID);
            List <TOPIC> updateTopics = new List <TOPIC>();
            List <TOPIC> newTopics    = new List <TOPIC>();

            newTopics = convertNodeToTopic(board, this.listNode);
            foreach (TOPIC topic in newTopics.ToList())
            {
                foreach (TOPIC etopic in existTopics.ToList())
                {
                    if (topic.ID == etopic.ID)
                    {
                        updateTopics.Add(topic);
                        newTopics.Remove(topic);
                    }
                }
            }
            TOPICcontroller.updateListTopic(updateTopics);
            TOPICcontroller.addListTopic(newTopics, board.ID);

            BOARDcontroller.updateBoard(board);

            if (STORAGEcontroller.updateStorage(storage))
            {
                MessageBox.Show("saved successfully",
                                "Information",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
        }
Exemplo n.º 3
0
 public static bool updateStorage(STORAGE storage)
 {
     try
     {
         using (var _context = new MINDMAPEntities())
         {
             _context.STORAGEs.AddOrUpdate(storage);
             _context.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public String obtainStorage(STORAGE store)
 {
     return(this.storageValue[store].ToString());
 }
Exemplo n.º 5
0
 public String obtainStorage(STORAGE store)
 {
     return this.storageValue[store].ToString();
 }