Exemple #1
0
        private void lblInsert_DragDrop(object sender, DragEventArgs e)
        {
            if (_draggingLabel != null)
            {
                FlowLayoutPanel flp     = sender as FlowLayoutPanel;
                TaskLogBusiness tlBuss  = new TaskLogBusiness();
                Entity.TaskLog  taskLog = new Entity.TaskLog();
                //e.Effect = DragDropEffects.Copy;
                taskLog.TaskID   = (int)_draggingLabel.Tag;
                taskLog.TaskDate = DateTime.Now;

                int flpId = int.Parse(flp.Tag.ToString());

                if (flpId == 1)
                {
                    taskLog.TaskStatusID = 2;
                }
                else if (flpId == 2 && _user.RoleID == 5)
                {
                    taskLog.TaskStatusID = 3;
                }
                else if (flpId == 2 && _user.RoleID == 4)
                {
                    taskLog.TaskStatusID = 5;
                }
                else if (flpId == 3 && _user.RoleID == 5)
                {
                    taskLog.TaskStatusID = 4;
                }
                else if (flpId == 3 && _user.RoleID == 4)
                {
                    taskLog.TaskStatusID = 6;
                }

                bool result = false;

                try
                {
                    result = tlBuss.Add(taskLog);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                if (result == true)
                {
                    ((FlowLayoutPanel)(_draggingLabel.Parent)).Controls.Remove(_draggingLabel);
                    flp.Controls.Add(_draggingLabel);
                }
                _draggingLabel = null;
            }
        }
Exemple #2
0
        public void RefreshDGV()
        {
            TaskLogBusiness taskLogBussiness = new TaskLogBusiness();

            dgvTask.DataSource = null;
            try
            {
                dgvTask.DataSource = taskLogBussiness.GetAll();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string filter = txtSearch.Text.Trim();

            if (!string.IsNullOrEmpty(filter))
            {
                TaskLogBusiness taskLogBussiness = new TaskLogBusiness();
                dgvTask.DataSource = null;
                try
                {
                    dgvTask.DataSource = taskLogBussiness.GetAllFiltered(filter);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemple #4
0
        private void FillContainers()
        {
            TaskLogBusiness taskLogBuss = new TaskLogBusiness();
            List <TaskLog>  tlList      = taskLogBuss.GetAllByEmployeeId(_user.ID);

            foreach (TaskLog item in tlList)
            {
                string lblText = string.Format("Görev: {0}\nOluşturulma tarihi: {1}\nDurum tarihi: {2}", item.Task.Description, item.TaskDate, item.Task.CreatedDate);
                Label  lbl     = CreateLabel(lblText, (int)item.TaskID);
                if (item.TaskStatusID == 2)
                {
                    flpAssigned.Controls.Add(lbl);
                }
                if (item.TaskStatusID == 3 || item.TaskStatusID == 5)
                {
                    flpInProgress.Controls.Add(lbl);
                }
                if (item.TaskStatusID == 4 || item.TaskStatusID == 6)
                {
                    flpDone.Controls.Add(lbl);
                }
            }
        }