private void button2_Click(object sender, EventArgs e) { Disease_List a = new Disease_List(); if (textBox2.Text != string.Empty) { a.Name = textBox2.Text; h.Disease_Lists.InsertOnSubmit(a); h.SubmitChanges(); GridViewUpdate(); } else { MessageBox.Show("Please insert Name of Disease !!!"); } }
private void button2_Click(object sender, EventArgs e) { Medicine_List a = new Medicine_List(); if (textBox2.Text != string.Empty && textBox1.Text != string.Empty && textBox4.Text != string.Empty) { a.Name = textBox2.Text; a.Manufacturer = textBox1.Text; a.Retail_Price_Tk__ = float.Parse(textBox4.Text); h.Medicine_Lists.InsertOnSubmit(a); h.SubmitChanges(); GridViewUpdate(); } else { MessageBox.Show("Please insert all necessary Information !!!"); } }
private void button2_Click(object sender, EventArgs e) { if (textBox2.Text != string.Empty && textBox3.Text != string.Empty && textBox4.Text != string.Empty && textBox5.Text != string.Empty && textBox6.Text != string.Empty && textBox7.Text != string.Empty && textBox8.Text != string.Empty && textBox9.Text != string.Empty && textBox10.Text != string.Empty) { if (radioButton1.Checked || radioButton2.Checked) { Doctor_s_List a = new Doctor_s_List(); a.Id = int.Parse(textBox1.Text); a.Name = textBox2.Text; a.Date_Of_Birth = Convert.ToDateTime(textBox3.Text); a.Date_Joined = Convert.ToDateTime(textBox4.Text); a.Designation = textBox5.Text; a.Specialty = textBox6.Text; a.Mobile_No_ = textBox7.Text; a.Address = textBox8.Text; a.Username = textBox9.Text; a.Password = textBox10.Text; if (radioButton1.Checked) { a.Gender = "Male"; } else { a.Gender = "Female"; } try { using (MemoryStream ms = new MemoryStream()) { pictureBox1.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); var binary = new System.Data.Linq.Binary(ms.GetBuffer()); a.Image = binary; } h.Doctor_s_Lists.InsertOnSubmit(a); h.SubmitChanges(); MessageBox.Show("Registration Completed Successfully"); } catch (Exception) { MessageBox.Show("Registration error !! Please insert your information in proper way !!!"); } } else { MessageBox.Show("Please select your Gender"); } } else { MessageBox.Show("Please provide all Information"); } }
private void button2_Click(object sender, EventArgs e) { if (textBox1.Text != string.Empty) { int parsedValue; if (!int.TryParse(textBox1.Text, out parsedValue)) { MessageBox.Show("Please insert only numeric value for Dr. ID !!"); } else { var x = from a in h.Doctor_s_Lists where a.Id == int.Parse(textBox1.Text) select a; if (!x.Any()) { MessageBox.Show("Nothing Found !!!"); } else { foreach (Doctor_s_List m in x) { h.Doctor_s_Lists.DeleteOnSubmit(m); } h.SubmitChanges(); GridViewUpdate(); } } } else { MessageBox.Show("Please insert an ID to Delete a Record."); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text != string.Empty && textBox2.Text != string.Empty && textBox3.Text != string.Empty && textBox3.Text != string.Empty) { try { Patient_Info p = new Patient_Info(); p.Name = textBox1.Text; p.Age = int.Parse(textBox2.Text); p.Blood_Group = textBox3.Text; p.Contact = textBox5.Text; h.Patient_Infos.InsertOnSubmit(p); h.SubmitChanges(); var x = from a in h.Patient_Infos where a.Contact == textBox5.Text select a; // label19 // this.label19.Text = "Patient\'s Id :"; // // label20 // this.label20.Text = "Patient\'s Name :"; // // label21 // this.label21.Text = "Age :"; // // label23 // this.label23.Text = "Blood Group :"; // // label24 // this.label24.Text = (x.First().Id).ToString(); // // label25 // this.label25.Text = textBox1.Text; // // label26 // this.label26.Text = textBox3.Text; // // label27 // this.label27.Text = textBox2.Text; panel3.Dispose(); panel4.Dispose(); panel5.Show(); flowLayoutPanel2.Show(); label28.Show(); textBox6.Show(); button3.Show(); flowLayoutPanel3.Show(); label29.Show(); textBox7.Show(); button4.Show(); flowLayoutPanel4.Show(); label30.Show(); textBox8.Show(); button5.Show(); panel6.Show(); } catch (Exception ex) { MessageBox.Show("Error !! Probably Wrong Format Data Inserted !!"); } } else { MessageBox.Show("Please Fill Up Required Information !"); } }