Ejemplo n.º 1
0
        /// <summary>
        /// dgvTrackWorker_CellClick - track worker data grid view cell click to update record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvTrackWorker_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                TrackWorkerModel trackWorker = new TrackWorkerModel();

                trackWorker.TrackWorkerID = int.Parse(dgvTrackWorker.Rows[e.RowIndex].Cells["TrackWorkerID"].Value.ToString());
                trackWorker.FirstName     = dgvTrackWorker.Rows[e.RowIndex].Cells["FirstName"].Value.ToString();
                trackWorker.LastName      = dgvTrackWorker.Rows[e.RowIndex].Cells["LastName"].Value.ToString();
                trackWorker.Cell          = dgvTrackWorker.Rows[e.RowIndex].Cells["Cell"].Value.ToString();
                trackWorker.Email         = dgvTrackWorker.Rows[e.RowIndex].Cells["Email"].Value.ToString();

                if (dgvTrackWorker.Rows[e.RowIndex].Cells["IsCapableCaptain"].Value.ToString() == "True")
                {
                    trackWorker.IsCapableCaptain = true;
                }
                else
                {
                    trackWorker.IsCapableCaptain = false;
                }
                if (dgvTrackWorker.Rows[e.RowIndex].Cells["IsDeleted"].Value.ToString() == "True")
                {
                    trackWorker.IsDeleted = true;
                }
                else
                {
                    trackWorker.IsDeleted = false;
                }
                TrackWorkerForm trackWorkerForm = new TrackWorkerForm(this, trackWorker);
                trackWorkerForm.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// btnTrackWorkerAddNew_Click - add new track worker record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTrackWorkerAddNew_Click(object sender, EventArgs e)
        {
            TrackWorkerForm trackWorkerForm = new TrackWorkerForm(this);

            trackWorkerForm.ShowDialog();
        }