public void AddRowToDataGridUsingEvent(DataGridView grid, UiEvent uiEvent) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(grid); row.DefaultCellStyle.Font = new Font("Tahoma", 9); BllEvent Event = uiEvent.EventData; row.Cells[ColumnIndicies[COL_SENDER]].Value = Event.Sender.Fullname; row.Cells[ColumnIndicies[COL_TITLE]].Value = Event.Name; row.Cells[ColumnIndicies[COL_DATE]].Value = Event.Date.ToString(DATE_FORMAT); row.Cells[ColumnIndicies[COL_TIME]].Value = Event.Date.ToString(TIME_FORMAT); row.Cells[ColumnIndicies[COL_DESCTIPTION]].Value = Event.Description; row.Cells[ColumnIndicies[COL_NOTE]].Value = uiEvent.Note; SetStatusInRow(row, Event); SetAttributeInRow(row, Event); SetFileCountInRow(row, Event); uiEvent.SetRowStyle(row); grid.Rows.Add(row); if (uiEvent.MissedStatus) { RowStyleManager.MakeCellBoldFont(row.Cells[ColumnIndicies[COL_STATUS]]); } }
public void AdmitEventAsAcquainted() { IEventCRUD crud = new EventCRUD(client.GetServerInstance().server); SelectedEvent.EventData = crud.UpdateAcceptedUsersAndSendOutEvent(SelectedEvent.EventData, ownerForm.GetCurrentUser()); SelectedEvent = new RegularEvent(SelectedEvent); Events[SelectedEventNum] = SelectedEvent; SelectedEvent.SetRowStyle(dataGridView.Rows[SelectedEventNum]); ownerForm.indication.DecNewEventsCount(); SerializeEvents(); }
public void AddStatusToSelectedEvent(BllStatus status) { SelectedEvent = AddStatusToUiEvent(SelectedEvent, status); Events[SelectedEventNum] = SelectedEvent; IEventCRUD eventCrud = new EventCRUD(client.GetServerInstance().server); SelectedEvent.EventData = eventCrud.UpdateStatusAndSendOutEvent(SelectedEvent.EventData, ownerForm.GetCurrentUser()); var newStatus = SelectedEvent.EventData.StatusLib.SelectedEntities.Last(); ownerForm.AddStatusToDataGrid(newStatus.Entity.Name, newStatus.Date); dataGridManager.SetStatusInRow(dataGridView.Rows[SelectedEventNum], SelectedEvent.EventData); SelectedEvent.SetRowStyle(dataGridView.Rows[SelectedEventNum]); ownerForm.SelectBlankStatus(); SerializeEvents(); }