public bool CreateTask(task task1)
        {
            try
            {
                mydbEntities ent = new mydbEntities();

                task task = new task
                {
                    idTask      = 1,
                    title       = "Lala",
                    startTime   = DateTime.Now,
                    endTime     = DateTime.Now,
                    comment     = "We love u",
                    label       = 2,
                    ownerList   = 1,
                    taskCreator = 1
                };

                ent.task.Add(task);
                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
        public bool CreateBoard(board projekat_u)
        {
            try
            {
                mydbEntities ent = new mydbEntities();

                board projekat = new board
                {
                    idBoard      = 1,
                    title        = "TO-DO",
                    boardOwner   = 1,
                    creationDate = DateTime.Now
                };

                ent.board.Add(projekat);
                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
        public bool DeleteList(int idListe)
        {
            try
            {
                mydbEntities ent = new mydbEntities();



                list lista = ent.list.Find(idListe);

                ent.list.Remove(lista);


                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
        public bool DeleteTask(int idTask)
        {
            try
            {
                mydbEntities ent = new mydbEntities();



                task task = ent.task.Find(idTask);

                ent.task.Remove(task);


                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
        public bool DeleteBoard(int idBoarda)
        {
            try
            {
                mydbEntities ent = new mydbEntities();



                board projekat = ent.board.Find(idBoarda);

                ent.board.Remove(projekat);


                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
Example #6
0
        public bool DeleteUser(int idUsera)
        {
            try
            {
                mydbEntities ent = new mydbEntities();



                user kor = ent.user.Find(idUsera);

                ent.user.Remove(kor);


                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
        public bool CreateList(list Nlista)
        {
            try
            {
                mydbEntities ent = new mydbEntities();

                list lista = new list
                {
                    idList     = 1,
                    title      = "NovaLista",
                    ownerBoard = 1,
                };

                ent.list.Add(lista);
                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }
Example #8
0
        public bool CreateUser(User korisnik)
        {
            try
            {
                mydbEntities ent = new mydbEntities();

                user kor = new user
                {
                    idUser   = 1,
                    username = "******",
                    password = "******"
                };

                ent.user.Add(kor);
                ent.SaveChanges();

                return(true);
            }

            catch (Exception exc)
            {
                return(false);
            }
        }