コード例 #1
0
 private void ClientDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         try
         {
             if (isAdmin)
             {
                 String contractNumber = ClientDataGrid.Rows[e.RowIndex].Cells[3].Value.ToString();
                 EditByContract(contractNumber);
             }
             else
             {
                 var PassCheckForm = new PassCheck();
                 if (PassCheckForm.ShowDialog() == DialogResult.OK)
                 {
                     isAdmin = true;
                     ClientDataGrid_CellDoubleClick(sender, e);
                 }
             }
         }
         catch (Exception exc)
         {
             System.Windows.MessageBox.Show(exc.Message);
         }
     }
 }
コード例 #2
0
        private void DeleteTool_Click(object sender, EventArgs e)
        {
            if (isAdmin)
            {
                var SearchForm = new SearchForm("delete");
                if (SearchForm.ShowDialog() == DialogResult.OK)
                {
                    switch (SearchForm.SearchOption)
                    {
                    case "Last Name":
                        DeleteByLastName(SearchForm.SearchValue);
                        break;

                    case "Contract number":
                        DeleteByContract(SearchForm.SearchValue);
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                var PassCheckForm = new PassCheck();
                if (PassCheckForm.ShowDialog() == DialogResult.OK)
                {
                    isAdmin = true;
                    DeleteTool_Click(sender, e);
                }
            }
        }
コード例 #3
0
 private void EditTool_Click(object sender, EventArgs e)
 {
     if (isAdmin)
     {
         var SearchForm = new SearchForm("edit");
         if (SearchForm.ShowDialog() == DialogResult.OK)
         {
             EditByContract(SearchForm.SearchValue);
         }
     }
     else
     {
         var PassCheckForm = new PassCheck();
         if (PassCheckForm.ShowDialog() == DialogResult.OK)
         {
             isAdmin = true;
             EditTool_Click(sender, e);
         }
     }
 }