private void button5_Click(object sender, EventArgs e) { try { using (StudentLinqDataContext supdate = new StudentLinqDataContext()) { StudentLinqDataContext sup = new StudentLinqDataContext(); int id = int.Parse(label6.Text); studentinfo sobj = supdate.studentinfos.Single(Student_Info => Student_Info.id == id); sobj.StudentName = textBox1.Text; sobj.Email = textBox2.Text; sobj.Mobile = textBox3.Text; sobj.AdmissionYear = textBox4.Text; sobj.Department = textBox5.Text; supdate.SubmitChanges(); MessageBox.Show("Data Updated"); } } catch (Exception ex) { MessageBox.Show(ex.Message); /// textBox1.Text = null; } }
private void button4_Click(object sender, EventArgs e) { try { using (StudentLinqDataContext data = new StudentLinqDataContext()) { studentinfo lg = data.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text); Password = lg.CreatePassword; name = lg.StudentName; path = @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\studentpropic\" + name + ".jpg"; } if (Password == textBox2.Text) { MessageBox.Show("login successfull "); textBox1.Text = null; textBox2.Text = null; } StudentHomepage st = new StudentHomepage(name, path); st.Show(); this.Hide(); } catch { MessageBox.Show("Invalid username or password"); textBox1.Text = null; textBox2.Text = null; } }
private void button7_Click(object sender, EventArgs e) { { StudentLinqDataContext sdelete = new StudentLinqDataContext(); studentinfo sinfo = sdelete.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text); sdelete.studentinfos.DeleteOnSubmit(sinfo); sdelete.SubmitChanges(); MessageBox.Show("Data ddeleted"); } }
private void button1_Click(object sender, EventArgs e) { try { StudentLinqDataContext dbc = new StudentLinqDataContext(); studentinfo st = new studentinfo(); st.StudentName = textBox1.Text; st.FatherName = textBox2.Text; st.Email = textBox3.Text; st.Mobile = textBox4.Text; st.Age = textBox5.Text; st.Sex = textBox6.Text; st.Religion = textBox7.Text; st.AdmissionYear = textBox8.Text; st.CreatePassword = textBox10.Text; st.Department = textBox11.Text; dbc.studentinfos.InsertOnSubmit(st); dbc.SubmitChanges(); File.Copy(temp1, @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\studentpropic\" + textBox1.Text + ".jpg"); MessageBox.Show("Data Inserted"); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox4.Text = null; textBox5.Text = null; textBox6.Text = null; textBox7.Text = null; textBox8.Text = null; textBox9.Text = null; textBox10.Text = null; } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } }
private void button1_Click(object sender, EventArgs e) { try { using (StudentLinqDataContext Ssearch = new StudentLinqDataContext()) { studentinfo sinfo = Ssearch.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text); textBox1.Text = sinfo.StudentName; textBox2.Text = sinfo.Email; textBox3.Text = sinfo.Mobile; textBox4.Text = sinfo.AdmissionYear; textBox5.Text = sinfo.Department; MessageBox.Show("Data Found"); } } catch { MessageBox.Show("Data Not Found "); textBox1.Text = null; } }
private void button9_Click(object sender, EventArgs e) { try { using (StudentLinqDataContext Ssearch = new StudentLinqDataContext()) { studentinfo sinfo = Ssearch.studentinfos.Single(Student_Info => Student_Info.StudentName == textBox1.Text); label3.Text = sinfo.StudentName; label4.Text = sinfo.Email; label12.Text = sinfo.Mobile; label6.Text = sinfo.AdmissionYear; label8.Text = sinfo.Department; MessageBox.Show("Data Found"); label3.Show(); label4.Show(); label5.Show(); label6.Show(); label7.Show(); label8.Show(); label9.Show(); label10.Show(); label11.Show(); label12.Show(); label13.Show(); textBox1.Text = null; } } catch { MessageBox.Show("Data Not Found "); textBox1.Text = null; } }
partial void Deletestudentinfo(studentinfo instance);
partial void Updatestudentinfo(studentinfo instance);
partial void Insertstudentinfo(studentinfo instance);