private void button3_Click(object sender, EventArgs e) { projects a = new projects(); this.Hide(); a.Show(); }
private void deladd_Click(object sender, EventArgs e) { if (dataGridadd.SelectedCells.Count != 0) { int rw = dataGridadd.SelectedCells[0].RowIndex; string cmd = string.Format("DELETE FROM Project where Id = '{0}'", dataGridadd.Rows[rw].Cells["Id"].Value.ToString()); SqlCommand del = new SqlCommand(cmd, DatabaseConnection.getInstance().getConnection()); int count = del.ExecuteNonQuery(); projects p = new projects(); this.Hide(); p.Show(); } }
private void saveupadd_Click(object sender, EventArgs e) { Project evl = new Project(); Regexp(@"^[a-zA-Z]{1,100}", nametext, addnme, "name"); Regexp(@"^[a-zA-Z]{1,100}", desctxt, desc, "name"); evl.title = nametext.Text; evl.description = desctxt.Text; String cmd = String.Format("UPDATE Project SET Title = '{0}' , Description = '{1}' WHERE Id ='{2}' ", evl.title, evl.description, ide); DatabaseConnection.getInstance().exectuteQuery(cmd); projects p = new projects(); this.Hide(); p.Show(); }
private void createbtn_Click(object sender, EventArgs e) { Project evl = new Project(); Regexp(@"^[a-zA-Z]{1,100}", nametext, addnme, "name"); Regexp(@"^[a-zA-Z]{1,100}", desctxt, desc, "name"); evl.title = nametext.Text; evl.description = desctxt.Text; String cmd = String.Format("INSERT INTO Project(Title,Description) values('{0}','{1}' )", evl.title, evl.description); DatabaseConnection.getInstance().exectuteQuery(cmd); projects s = new projects(); this.Hide(); s.Show(); }