void ReleaseDesignerOutlets() { if (Addbutton != null) { Addbutton.Dispose(); Addbutton = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } if (EditButton != null) { EditButton.Dispose(); EditButton = null; } if (Search != null) { Search.Dispose(); Search = null; } }
private void Addbutton_Click(object sender, EventArgs e) { string connString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=E:\\ITS245\\STEFPROJ\\Database11.accdb"; OleDbConnection connection = new OleDbConnection(connString); OleDbCommand cmd = connection.CreateCommand(); connection.Open(); cmd.CommandText = "Insert into illnesshistorytable (Illness,PatientID,IllnessDate, Resolution) VALUES" + "(" + "'" + illy.Text + "'" + "," + "'" + PatientID.Text + "'" + "," + "'" + DOI.Text + "'" + "," + "'" + Resolve.Text + "'" + ")"; cmd.Connection = connection; OleDbDataReader reader = cmd.ExecuteReader(); connection.Close(); this.BackColor = Color.LightBlue; illy.ReadOnly = true; DOI.ReadOnly = true; Resolve.ReadOnly = true; listBox1.Update(); save.Hide(); Addbutton.Hide(); }
private void save_Click(object sender, EventArgs e) { string connString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=E:\\ITS245\\STEFPROJ\\Database11.accdb"; OleDbConnection connection = new OleDbConnection(connString); OleDbCommand cmd = connection.CreateCommand(); connection.Open(); cmd.Connection = connection; cmd.CommandText = "Update illnesshistorytable set Illness =" + "'" + illy.Text + "'" + ",IllnessDate =" + "'" + DOI.Text + "'" + ",Resolution=" + "'" + Resolve.Text + "'" + " where IllnessID=" + listBox1.SelectedItem.ToString(); OleDbDataReader reader2 = cmd.ExecuteReader(); reader2.Read(); reader2.Close(); this.BackColor = Color.LightBlue; illy.ReadOnly = true; DOI.ReadOnly = true; Resolve.ReadOnly = true; save.Hide(); Addbutton.Hide(); }
private void modifybutton_Click(object sender, EventArgs e) { this.BackColor = Color.Blue; illy.ReadOnly = false; DOI.ReadOnly = false; Resolve.ReadOnly = false; save.Show(); Addbutton.Show(); }
internal void New_Language() { Commondriver.Excellib.PopulateInCollection(Base.Excelpath, "Language"); Langtab.Click(); Addnewbutton.Click(); AddLanguage.SendKeys(Commondriver.Excellib.ReadData(2, "Language")); SelectElement Levelsel = new SelectElement(AddLevel); Levelsel.SelectByText(Commondriver.Excellib.ReadData(2, "Level")); Addbutton.Click(); }
internal void Addskill() { Commondriver.Excellib.PopulateInCollection(Base.Excelpath, "Skills"); Skilltab.Click(); Addnewbutton.Click(); Skillname.SendKeys(Commondriver.Excellib.ReadData(2, "Skill")); SelectElement Levelskill = new SelectElement(Skilllevel); Levelskill.SelectByText(Commondriver.Excellib.ReadData(2, "Level")); Commondriver.Wait(10); Addbutton.Click(); Commondriver.Wait(20); }