protected void updateSubmitBtn_Click(object sender, EventArgs e) { int projID = 0; foreach (ProjectInfo info in ProjectInfo.getProjects(false)) { if (info.Name == projNameDrpList.SelectedItem.ToString()) { projID = info.ProjectID; } } BusinessLogicLayer.ProjectInfo editProj = BusinessLogicLayer.ProjectInfo.getProject(projID); if (carNameTxtBx.Text != "") { editProj.Name = carNameTxtBx.Text; } if (yearMadeTxtBx.Text != "") { editProj.YearMade = Convert.ToInt32(yearMadeTxtBx.Text); } if (carDescTxtBx.Text != "") { editProj.Description = carDescTxtBx.Text; } editProj.IsActive = activeChkBx.Checked; editProj.Status = projStatusDrpList.SelectedItem.ToString(); editProj.updateDatabase(); lblProjSubmit.Text = "Project updated."; submitProj.Visible = true; createProjFrm.Controls.Clear(); submitProjBtn.Visible = false; updateProjBtn.Visible = false; Response.Redirect("/projectmanagement.aspx?update=" + "true"); }
public void fillData() { int projID = 0; foreach (ProjectInfo info in ProjectInfo.getProjects(false)) { if (info.Name == projNameDrpList.SelectedItem.ToString()) { projID = info.ProjectID; } } BusinessLogicLayer.ProjectInfo editProj = BusinessLogicLayer.ProjectInfo.getProject(projID); carNameTxtBx.Text = editProj.Name; yearMadeTxtBx.Text = editProj.YearMade.HasValue ? Convert.ToString(editProj.YearMade.Value) : ""; carDescTxtBx.Text = editProj.Description; activeChkBx.Checked = editProj.IsActive; projStatusDrpList.SelectedValue = editProj.Status; }