Esempio n. 1
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            if (dgwEmployeeTasks.SelectedRows.Count == 0)
            {
                MessageBox.Show("Please select any task to edit", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (dgwEmployeeTasks.SelectedRows.Count > 1)
                {
                    MessageBox.Show("Please select only one row to edit", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    //if (dgwEmployeeTasks.SelectedRows[0].Cells[0].Value.ToString() == "Y" && dgwEmployeeTasks.SelectedRows[0].Cells[11].Value.ToString() != Program.currentUserId)
                    if (isManager)// dgwEmployeeTasks.SelectedRows[0].Cells[10].Value.ToString() == Program.currentUserId)
                    {
                        //MasterTasks mt = new MasterTasks(this, Convert.ToInt32(dgwMasterTasks.SelectedRows[0].Cells[0].Value));
                        //mt.ShowDialog();

                        currentSelectedRowIndex = dgwEmployeeTasks.CurrentCell.RowIndex;
                        MasterTasks mt = new MasterTasks(this, Convert.ToInt32(dgwEmployeeTasks.SelectedRows[0].Cells[0].Value));
                        mt.ShowDialog();
                        //MessageBox.Show("Can't open task for edit", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        currentSelectedRowIndex = dgwEmployeeTasks.CurrentCell.RowIndex;
                        EmployeeTasks mt = new EmployeeTasks(this, Convert.ToInt32(dgwEmployeeTasks.SelectedRows[0].Cells[1].Value));
                        mt.ShowDialog();
                    }
                }
            }
        }
Esempio n. 2
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     if (dgwMasterTasks.SelectedRows.Count == 0)
     {
         MessageBox.Show("Please select any task to edit", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         if (dgwMasterTasks.SelectedRows.Count > 1)
         {
             MessageBox.Show("Please select only one row to edit", "Warning Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             MasterTasks mt = new MasterTasks(this, Convert.ToInt32(dgwMasterTasks.SelectedRows[0].Cells[0].Value));
             mt.ShowDialog();
         }
     }
 }