protected void Button2_Click(object sender, EventArgs e) { Investigation_management_systemEntities4 db = new Investigation_management_systemEntities4(); Investigation_Interview t = new Investigation_Interview(); t.Investigation_Interview_Interviewer_ID = Interviewertxt.Text; t.Investigation_Interview_Interviewee_ID = intervieweetxt.Text; t.Case_ID = Convert.ToInt32(casetxt.Text); t.Investigation_Interview_Date = Convert.ToDateTime(Datetxt.Text); t.Investigation_Interview_Location = locationtxt.Text; t.Investigation_Interview_Time = Timetxt.Text; t.Investigation_Interview_Memo = Memotxt.Text; db.Investigation_Interview.Add(t); int res = db.SaveChanges(); if (res > 0) { Response.Write("Data Inserted Successfully"); } else { Response.Write("Try Again!!!"); } }
protected void isavebtn_Click(object sender, EventArgs e) { Investigation_management_systemEntities4 db = new Investigation_management_systemEntities4(); Investigation_Interview t = new Investigation_Interview(); t.Investigation_Interview_Interviewer_ID = Interviewertxt.Text; t.Investigation_Interview_Interviewee_ID = intervieweetxt.Text; t.Case_ID = int.Parse(iDropDownList.SelectedValue); t.Investigation_Interview_Date = Convert.ToDateTime(idatetxt.Text); t.Investigation_Interview_Location = ilocationtxt.Text; t.Investigation_Interview_Time = itimetxt.Text; t.Investigation_Interview_Memo = imemotxt.Text; db.Investigation_Interview.Add(t); int res = db.SaveChanges(); if (res > 0) { Response.Write("Data Inserted Successfully"); } else { Response.Write("Try Again!!!"); } }