Beispiel #1
0
        // Add new build
        private void button1_Click(object sender, EventArgs e)
        {
            EditForms.BuildEditForm childForm = new EditForms.BuildEditForm(EditForms.BuildEditForm.EditMode.ADD);

            childForm.CreatorID           = LoginData.GetUserID();
            childForm.txbCreatorName.Text = LoginData.GetUserName();
            childForm.changeStatus(false);

            childForm.Owner = this;
            childForm.ShowDialog();
        }
Beispiel #2
0
        // Edit build
        private void btnEdit_Click(object sender, EventArgs e)
        {
            EditForms.BuildEditForm childForm = new EditForms.BuildEditForm(EditForms.BuildEditForm.EditMode.EDIT);

            // Fill data in BuildEditForm
            childForm.txbID.Text          = dgvBuilds.SelectedRows[0].Cells["bldID"].Value.ToString();
            childForm.txbCreatorName.Text = dgvBuilds.SelectedRows[0].Cells["bldCreatorName"].Value.ToString();
            childForm.txbTesterName.Text  = dgvBuilds.SelectedRows[0].Cells["bldTesterName"].Value.ToString();
            childForm.txbName.Text        = dgvBuilds.SelectedRows[0].Cells["bldName"].Value.ToString();

            try
            {
                bool tmpBool = Boolean.Parse(dgvBuilds.SelectedRows[0].Cells["bldAccepted"].Value.ToString());

                childForm.changeStatus(tmpBool);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            int tmpTesterID;

            if (Int32.TryParse(dgvBuilds.SelectedRows[0].Cells["bldTesterID"].Value.ToString(), out tmpTesterID))
            {
                childForm.TesterID = tmpTesterID;
                childForm.isTester = true;
            }
            else
            {
                childForm.isTester = false;
            }

            childForm.CreatorID = (int)(dgvBuilds.SelectedRows[0].Cells["bldCreatorID"].Value);

            // Show window
            childForm.Owner = this;
            childForm.ShowDialog();
        }