private void createProjectToolStripMenuItem_Click(object sender, EventArgs e) { Project l = Project.getInstance(); l.Show(); this.Hide(); }
private void addProjectToolStripMenuItem_Click(object sender, EventArgs e) { Project p = new Project(); p.Show(); this.Hide(); }
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Project p = new Project(); this.Hide(); p.Show(); }
private void button2_Click(object sender, EventArgs e) { Project p = new Project(); this.Hide(); p.Show(); }
private void lblProject_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Project project = new Project(); this.Hide(); project.Show(); }
private void button1_Click(object sender, EventArgs e) { Project Pro = new Project(); panel2.Hide(); panel1.Show(); //disp_data(); Pro.Show(); }
public static Project getInstance() { if (l == null) { l = new Project(); l.Show(); return(l); } else { return(l); } }
private void Del_rec() { con.Open(); int index = ProjectGrid.CurrentCell.RowIndex; ProjectGrid.Rows[index].Selected = true; string id = ProjectGrid.SelectedCells[0].Value.ToString(); SqlCommand cmdchk = new SqlCommand("SELECT ProjectId From ProjectAdvisor WHERE ProjectId='" + id + "'", con); SqlDataReader reader = cmdchk.ExecuteReader(); try { if (reader.HasRows) { con.Close(); MessageBox.Show("Can not Delete as data exists in ProjectAdvisor."); } else { try { //SqlCommand con = new SqlCommand("SELECT Id FROM STUDENT WHERE id = ", con); //SqlDataReader reader = con.ExecuteReader(); SqlCommand cmd = new SqlCommand(" DELETE FROM Project WHERE Id = '" + id + "';", con); cmd.ExecuteNonQuery(); ProjectGrid.Rows.RemoveAt(index); ProjectGrid.DataSource = dt; MessageBox.Show("Record deleted."); } catch { MessageBox.Show("Can not delete data."); } } } catch { MessageBox.Show("someting went wrong."); } con.Close(); this.Hide(); Project obj = new Project(); obj.Show(); }
private void update_rec() { con.Close(); con.Open(); try { int index = ProjectGrid.CurrentCell.RowIndex; ProjectGrid.Rows[index].Selected = true; string id = ProjectGrid.SelectedCells[0].Value.ToString(); try { //SqlCommand con = new SqlCommand("SELECT Id FROM STUDENT WHERE id = ", con); //SqlDataReader reader = con.ExecuteReader(); SqlCommand cmd = new SqlCommand(" Update Project SET Description = '" + ProId.Text + "', Title = '" + Title.Text + "';", con); cmd.ExecuteNonQuery(); ProjectGrid.Rows.RemoveAt(index); ProjectGrid.DataSource = dt; MessageBox.Show("Done."); } catch { con.Close(); MessageBox.Show("Can not update data."); } con.Close(); } catch { con.Close(); MessageBox.Show("Something went wrong."); } con.Close(); this.Hide(); Project obj = new Project(); obj.Show(); }
private void button5_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(Title.Text)) { MessageBox.Show("Title is compulsory."); } else { con.Open(); SqlCommand check_User_Name = new SqlCommand("SELECT ID FROM Project WHERE ([ID] = @ID)", con); check_User_Name.Parameters.AddWithValue("ID", ProId.Text); SqlDataReader reader = check_User_Name.ExecuteReader(); if (reader.HasRows) { con.Close(); MessageBox.Show("Record exists against provided ID."); } else { con.Close(); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd = new SqlCommand("INSERT INTO Project(Description, Title) VALUES(@Description,@Title)", con); cmd.Parameters.AddWithValue("@Description", ProId.Text); cmd.Parameters.AddWithValue("@Title", Title.Text); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Data Inserted Successfully"); this.Hide(); Project profm = new Project(); profm.Show(); } } }
private void button11_Click(object sender, EventArgs e) { Project profm = new Project(); profm.Show(); }
private void button7_Click(object sender, EventArgs e) { Project fm2 = new Project(); fm2.Show(); }
private void button6_Click(object sender, EventArgs e) { Project Pro = new Project(); Pro.Show(); }
private void pro_Click(object sender, EventArgs e) { Project pro = new Project(); pro.Show(); }