private void btnSave_Click(object sender, EventArgs e) { BoardBLL boardBLL = new BoardBLL(); ActivityBLL activityBLL = new ActivityBLL(); String title = tbTitle.Text; int mode = cbMode.SelectedIndex; bool star = false; if (string.IsNullOrEmpty(tbTitle.Text)) { MessageBox.Show("Tiêu đề không được để trống!", "Lỗi!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (this.background == "NULL") { DialogResult r = MessageBox.Show("Bạn có muốn lưu ảnh nền mặc định?", "Cảnh báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (r == DialogResult.OK) { if (cbTeam.SelectedIndex == 0) { //----no team--------- boardBLL.InsertBoard(this.index, title, mode, star, this.background); //add board for this user in user_board int boardID = boardBLL.GetMaxID(); boardBLL.AddUser(Global.user.UserId, boardID); activityBLL.InsertActivity(Global.user.UserId, boardID, Global.user.Name + " Has create new board: " + title, DateTime.Now); } this.DialogResult = DialogResult.OK; this.Close(); } } else { if (cbTeam.SelectedIndex == 0) { //----no team--------- boardBLL.InsertBoard(this.index, title, mode, star, this.background); //add board for this user in user_board int boardID = boardBLL.GetMaxID(); boardBLL.AddUser(Global.user.UserId, boardID); activityBLL.InsertActivity(Global.user.UserId, boardID, Global.user.Name + " Has create new board: " + title, DateTime.Now); } this.DialogResult = DialogResult.OK; this.Close(); } }
private void SaveBtn_Click(object sender, EventArgs e) { checklistBLL.InsertChecklist(_cardId, checklistDTOs.Count(), ChecklistTitle.Text, 0); ActivityBLL activityBLL = new ActivityBLL(); //listBLL = new ListBLL(); activityBLL.InsertActivity(Global.user.UserId, Global.id_Board, Global.user.Name + " Has create new checklist " + ChecklistTitle.Text, DateTime.Now); this.Close(); }
private void ListComponent_MouseClick(object sender, MouseEventArgs e) { ActivityBLL activityBLL = new ActivityBLL(); cardDTO.ListId = _id; cardBLL.UpdateCard(cardDTO); activityBLL.InsertActivity(Global.user.UserId, listBLL.GetList(cardDTO.ListId).BoardId, Global.user.Name + " Has move card to list: " + listBLL.GetList(cardDTO.ListId).Title, DateTime.Now); moveForm.Close(); }
private void RedButton_Click(object sender, EventArgs e) { cardDTO.Label = 1; cardBLL.UpdateCard(cardDTO); activityBLL.InsertActivity(Global.user.UserId, _boardId, Global.user.Name + " Has change card " + cardDTO.Title + " label to red", DateTime.Now); this.Close(); }
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(); }
private void commentButton_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(commentText.Text)) { activityBLL = new ActivityBLL(); commentDTO = new CommentDTO(_cardId, Global.user.UserId, commentText.Text, DateTime.Now, 1); try { commentBLL.InsertComment(commentDTO); } catch { MessageBox.Show("Mỗi user chỉ comment 1 lần", "Waring!!!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } UserComment userComment = new UserComment(userBLL.GetUser(Global.user.UserId).Name.Substring(0, 1), commentText.Text); cmtPanel.Controls.Add(userComment); activityBLL.InsertActivity(Global.user.UserId, Global.id_Board, Global.user.Name + " Has comment to card " + cardDTO.Title, DateTime.Now); } }
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(); }
private void cbListUser_SelectedIndexChanged(object sender, EventArgs e) { if (cbListUser.SelectedIndex != 0) { BoardBLL boardBLL = new BoardBLL(); ActivityBLL activityBLL = new ActivityBLL(); try { boardBLL.AddUser(userDTOs[cbListUser.SelectedIndex - 1].UserId, this.idBoard); activityBLL.InsertActivity(Global.user.UserId, this.idBoard, Global.user.Name + " Add " + userDTOs[cbListUser.SelectedIndex - 1].Name + " to " + this.title, DateTime.Now); MessageBox.Show("Add succedd" + userDTOs[cbListUser.SelectedIndex - 1].Name + " to " + this.title, "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show(cbListUser.SelectedText + "already exist in this board!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { this.cbListUser.Visible = false; } }
protected void SaveButton_Click(object sender, EventArgs e) { Activity theClass = new Activity(); theClass.Name = ActivityNameTextBox.Text; theClass.OrganizationID = AddDataControl.OrganizationId; theClass.AreaID = AddDataControl.AreaId; theClass.ProjectID = AddDataControl.ProjectId; if (ActivityId == 0) { //Insert try { ActivityBLL.InsertActivity(theClass); } catch (Exception ex) { SystemMessages.DisplaySystemErrorMessage(ex.Message); return; } SystemMessages.DisplaySystemMessage(Resources.Activity.MessageCreateOk); } else { // Update theClass.ActivityID = ActivityId; try { ActivityBLL.UpdateActivity(theClass); } catch (Exception ex) { SystemMessages.DisplaySystemErrorMessage(ex.Message); return; } SystemMessages.DisplaySystemMessage(Resources.Activity.MessageUpdateOk); } Response.Redirect(ParentPage); }