Esempio n. 1
0
        public void LoadListOfThisBoard()
        {
            this.Controls.Clear();
            listDTOs.Clear();
            listUIs.Clear();

            //-------load menu bar---------------------
            //this.Controls.Add(lbNameProject);
            //this.Controls.Add(btnInvite);
            //this.Controls.Add(btnMode);
            //this.Controls.Add(btnPersonal);
            //this.Controls.Add(btnStar);
            this.Controls.Add(pnMenu);

            //-------load lits---------------------
            ListBLL listBLL = new ListBLL();

            listDTOs = listBLL.GetAllList(this.idBoard);

            foreach (ListDTO l in listDTOs)
            {
                ListUI lsUI = new ListUI(l.ListId, l.IndexList, l.Title, l.Color, this);
                listUIs.Add(lsUI);
                this.Controls.Add(lsUI);
            }

            ListUIButtonCreate btnNewList = new ListUIButtonCreate(listDTOs.Count, this.idBoard);

            this.Controls.Add(btnNewList);
        }
        public ListComponent(string name, int id, CardDTO card, MoveForm move)
        {
            InitializeComponent();

            cardBLL = new CardBLL();
            listBLL = new ListBLL();

            this.nameTxt.Text = name;
            _id           = id;
            cardDTO       = card;
            this.moveForm = move;
        }
Esempio n. 3
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            ActivityBLL activityBLL = new ActivityBLL();

            listBLL = new ListBLL();
            TimeSpan time = new TimeSpan(Convert.ToInt32(this.dueDateHour.Value), Convert.ToInt32(this.dueDateMin.Value), 0);

            cardDTO.DueDate = DateTime.MinValue;
            cardDTO.DueDate = datePicker.Value;
            cardDTO.DueDate = cardDTO.DueDate + time;
            cardBLL.UpdateDate(cardDTO);
            activityBLL.InsertActivity(Global.user.UserId, Global.id_Board, Global.user.Name + " Has change date of card " + cardDTO.Title, DateTime.Now);
            this.Close();
        }
Esempio n. 4
0
        public void UpdateList(ListBLL listBLL)
        {
            if (listBLL == null)
            {
                throw new Exception("error. update list bll");
            }

            List list = new List()
            {
                Id     = listBLL.Id,
                IdUser = listBLL.User,
                Title  = listBLL.Title
            };

            Database.Lists.Update(list);
            Database.Save();
        }
Esempio n. 5
0
        public IActionResult PostList([FromBody] ListBLL list, [FromRoute] int userId)
        {
            try
            {
                if (list.Title == null)
                {
                    return(BadRequest());
                }
                list.User = userId;
                list.Id   = listService.CreateList(list);

                return(Ok(list));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Esempio n. 6
0
        public int CreateList(ListBLL listBLL)
        {
            if (listBLL == null)
            {
                throw new Exception("Error. list == null");
            }

            List list = new List()
            {
                Title  = listBLL.Title,
                IdUser = listBLL.User
            };

            Database.Lists.Create(list);

            Database.Save();

            return(list.Id);
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            ListBLL listBLL = new ListBLL();

            if (string.IsNullOrEmpty(tbNameList.Text))
            {
                MessageBox.Show("Please enter title before save list", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ListDTO l = new ListDTO(this.idBoard, this.index, tbNameList.Text, 1);
            bool    r = listBLL.InsertList(l);

            ActivityBLL activityBLL = new ActivityBLL();

            activityBLL.InsertActivity(Global.user.UserId, this.idBoard, Global.user.Name + " Has create new list: " + this.tbNameList.Text, DateTime.Now);

            ((ListSpace)this.Parent).LoadListOfThisBoard();
        }
Esempio n. 8
0
        public List <ListBLL> GetLists(int userId)
        {
            var            lists    = Database.Lists.GetAll().Where(x => x.IdUser == userId).ToList();
            List <ListBLL> listsBLL = new List <ListBLL>();

            if (lists == null)
            {
                throw new Exception("Error create list of lists");
            }

            foreach (var l in lists)
            {
                ListBLL list = new ListBLL()
                {
                    Id = l.Id, Title = l.Title, User = l.IdUser
                };

                listsBLL.Add(list);
            }

            return(listsBLL);
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <MovieInfoModel> li = new ListBLL().SelectMovieInfo();

            this.Repeater1.DataSource = li;
            this.Repeater1.DataBind();

            List <MovieInfoModel> li2 = new ListBLL().SelectMovieInfo2();

            this.Repeater2.DataSource = li2;
            this.Repeater2.DataBind();

            List <MovieInfoModel> li3 = new ListBLL().SelectMovieInfo3();

            this.Repeater3.DataSource = li3;
            this.Repeater3.DataBind();

            List <MovieInfoModel> li4 = new ListBLL().SelectMovieInfo4();

            this.Repeater4.DataSource = li4;
            this.Repeater4.DataBind();
        }
Esempio n. 10
0
        public ListBLL GetList(int id)
        {
            if (id == 0)
            {
                throw new Exception("id == null");
            }

            var list = Database.Lists.Get(id);

            if (list == null)
            {
                throw new Exception("list don't find");
            }

            ListBLL listBLL = new ListBLL()
            {
                Id    = list.Id,
                Title = list.Title,
                User  = list.IdUser
            };

            return(listBLL);
        }
Esempio n. 11
0
        public IActionResult PutList([FromBody] ListBLL list)
        {
            try
            {
                if (list == null)
                {
                    throw new Exception("Error. List in request is null");
                }

                if (listService.GetList(list.Id) == null)
                {
                    throw new Exception("Error. List not found");
                }

                listService.UpdateList(list);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }