private void btnUpdateR_Click(object sender, EventArgs e) { modelsub.Year = comboBoxyear.Text.Trim(); modelsub.Semester = semesterReadio; modelsub.Subject_Name = textSubName.Text.Trim(); modelsub.Subject_Code = textcode.Text.Trim(); modelsub.Lecture_Hours = numericUpDown1.Value.ToString(); modelsub.Tute_Hours = numericUpDown2.Value.ToString(); modelsub.Lab_Hours = numericUpDown3.Value.ToString(); modelsub.Evaluation_Hours = numericUpDown4.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelsub.SID == 0) { } else { db.Entry(modelsub).State = EntityState.Modified; db.SaveChanges(); } clear(); LoadData(); MessageBox.Show("Lecture Updated Successfully"); } }
private void ATS_update_Click(object sender, EventArgs e) { model.Batch_id = combo_batchID.SelectedItem.ToString(); model.date = guna2DateTimePicker1.Value; model.time_slot = combo_timeslots.SelectedItem.ToString(); model.start_time_hrs = combo_start_hrs.SelectedItem.ToString(); model.end_time_hrs = combo_end_hrs.SelectedItem.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (model.Lec_id == 0) { } else { db.Entry(model).State = EntityState.Modified; db.SaveChanges(); } clear(); loadData(); MessageBox.Show("Room Updated Successfully"); } }
private void btn_Update_addlocation_Click(object sender, EventArgs e) { modeladdLocation11.SessionID = combo_sessionID.Text.Trim();//trim is use to remove sapases modeladdLocation11.Date = guna2DateTimePicker1.Text.Trim(); modeladdLocation11.StartTime = combo_strtTime.Text.Trim(); modeladdLocation11.EndTime = Combo_endTime.Text.Trim(); modeladdLocation11.RoomID = combo_roomID.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modeladdLocation11.Id == 0) { } else { db.Entry(modeladdLocation11).State = EntityState.Modified; db.SaveChanges(); } clear(); loadData(); MessageBox.Show("Location Updated Successfully"); } }
private void btnUpdateR_Click(object sender, EventArgs e) { modelLect.LectureName = tboxName.Text.Trim(); modelLect.EmpID = tboxID.Text.Trim(); modelLect.Faculty = cboxFaculty.Text.Trim(); modelLect.Department = cboxDepart.Text.Trim(); modelLect.Center = cboxCenter.Text.Trim(); modelLect.Building = cboxBuilding.Text.Trim(); modelLect.Level = cboxLevel.Text.Trim(); modelLect.Rank = tboxrank.Text.Trim(); modelLect.Day = cboxDate.Text.Trim(); modelLect.Time = tboxATime.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelLect.LecID == 0) { } else { db.Entry(modelLect).State = EntityState.Modified; db.SaveChanges(); } clear(); loadData(); MessageBox.Show("Lecture Updated Successfully"); } }
private void btnUpdateMS_Click(object sender, EventArgs e) { modelAca.AcademicYrSemester = txtAcYear.Text.Trim(); modelAca.Program1 = txtProgram.Text.Trim(); modelAca.GroupNumber = txtGroupNum.Value.ToString(); modelAca.SubGroupNo11 = txtSubGroupNum.Value.ToString(); modelAca.GroupId11 = txtGruopId.Text.Trim(); modelAca.SubGroupId11 = txtSubGroupId.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelAca.Studid == 0) { } else { db.Entry(modelAca).State = EntityState.Modified; db.SaveChanges(); } clear(); Sho_data_gridView(); MessageBox.Show(" Updated Successfully"); } }
private void btnUpdate_Click(object sender, EventArgs e) { modelsession.Lecture1 = txtLect1.Text.Trim(); modelsession.Lecture2 = txtlect2.Text.Trim(); modelsession.Tag = txtTag.Text.Trim(); modelsession.Subject = txtSub.Text.Trim(); modelsession.GroupId = txtGroup.Text.Trim(); modelsession.NoOfStudents = txtNoStd.Text.Trim(); modelsession.Duraction = txtDuratio.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelsession.SessionId == 0) { } else { db.Entry(modelsession).State = EntityState.Modified; db.SaveChanges(); } show_data_GridView(); MessageBox.Show(" Updated Successfully"); } }
private void btnUpdateR_Click(object sender, EventArgs e) { //trim is use to remove sapases modelRoom.BuildingName = ComboBoxbName.Text.Trim(); modelRoom.RoomName = txtRoomName.Text.Trim(); modelRoom.RoomType = RoomtypeM; modelRoom.Capacity = txtCapacity.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelRoom.RoomID == 0) { } else { db.Entry(modelRoom).State = EntityState.Modified; db.SaveChanges(); } clear(); loadData(); MessageBox.Show("Room Updated Successfully"); } }
private void btndelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to delete this record", "OPtion", MessageBoxButtons.YesNo) == DialogResult.Yes) { using (EFDBEntities1 db = new EFDBEntities1()) { var entry = db.Entry(modelsession); if (entry.State == EntityState.Detached) { db.SessionNs.Attach(modelsession); db.SessionNs.Remove(modelsession); db.SaveChanges(); show_data_GridView(); MessageBox.Show(" Deleted Successfully"); } } } }
private void update_mangenotAV_time_Click(object sender, EventArgs e) { notAvailableTimeAlc.Selected_Lecturer = combo_select_Lec.Text.Trim();//trim is use to remove sapases notAvailableTimeAlc.Selected_group = combo_select_group.Text.Trim(); notAvailableTimeAlc.Selected_subgroup = combo_select_subgroup.Text.Trim(); notAvailableTimeAlc.Selected_sessionId = Combo_seect_sessionID.Text.Trim(); notAvailableTimeAlc.Time = combo_time.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (notAvailableTimeAlc.SessionID == 0) { } else { db.Entry(notAvailableTimeAlc).State = EntityState.Modified; db.SaveChanges(); } } }
private void btnRemovee_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to delete this record", "OPtion", MessageBoxButtons.YesNo) == DialogResult.Yes) { using (EFDBEntities1 db = new EFDBEntities1()) { var entry = db.Entry(modelroomForS); if (entry.State == EntityState.Detached) { db.RoomForSes.Attach(modelroomForS); db.RoomForSes.Remove(modelroomForS); db.SaveChanges(); loadData(); clear(); MessageBox.Show("Room Deleted Successfully"); } } } }
private void btnUpdateTag_Click(object sender, EventArgs e) { modelTag1.TagName = txtTagName.Text.Trim(); modelTag1.TagCode = txtTagCode.Text.Trim(); modelTag1.RelatedTag = txtRelatedTag.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelTag1.TagID == 0) { } else { db.Entry(modelTag1).State = EntityState.Modified; db.SaveChanges(); } clear(); show_data_Gridview(); MessageBox.Show("Submitted Successfully"); } }
private void Delete_notAV_time_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to delete this record", "OPtion", MessageBoxButtons.YesNo) == DialogResult.Yes) { using (EFDBEntities1 db = new EFDBEntities1()) { var entry = db.Entry(notAvailableTimeAlc); if (entry.State == EntityState.Detached) { db.NotAvTimes.Attach(notAvailableTimeAlc); db.NotAvTimes.Remove(notAvailableTimeAlc); db.SaveChanges(); loadData(); clear(); MessageBox.Show("Location Deleted Successfully"); } } } }
private void btnUpdate_Click(object sender, EventArgs e) { Modelbuil.BuildingName = txtMbuildingName.Text.Trim();//trim is use to remove sapases Modelbuil.Num_of_Floors = txtMnumFloor.Text.Trim(); Modelbuil.Num_of_Lectu = txtMnumLect.Text.Trim(); Modelbuil.Num_of_lab = txtMnumLab.Text.Trim(); using (EFDBEntities1 db = new EFDBEntities1()) { if (Modelbuil.BuildingID == 0) { } else { db.Entry(Modelbuil).State = EntityState.Modified; db.SaveChanges(); } clear(); show_data_GridView(); MessageBox.Show("Building Updated Successfully"); } }
private void btn_up_Click(object sender, EventArgs e) { if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked && CheckBoxWedneday1.Checked && CheckBoxThursday1.Checked && CheckBoxFriday1.Checked && CheckBoxSaturday1.Checked && CheckBoxSunday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = Numeric_Wed_H1.Value.ToString(); modelWorking.wednesdayM = Numeric_Wed_M1.Value.ToString(); modelWorking.thursdayH = Numeric_Thur_H1.Value.ToString(); modelWorking.thursdayM = Numeric_Thur_M1.Value.ToString(); modelWorking.fridayH = Numeric_Friday_H1.Value.ToString(); modelWorking.fridayM = Numeric_Friday_M1.Value.ToString(); modelWorking.saturdayH = Numeric_Satur_H1.Value.ToString(); modelWorking.saturdayM = Numeric_Satur_M1.Value.ToString(); modelWorking.sundayH = Numeric_Sun_H1.Value.ToString(); modelWorking.sundayM = Numeric_Sun_M1.Value.ToString(); modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked && CheckBoxWedneday1.Checked && CheckBoxThursday1.Checked && CheckBoxFriday1.Checked && CheckBoxSaturday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = Numeric_Wed_H1.Value.ToString(); modelWorking.wednesdayM = Numeric_Wed_M1.Value.ToString(); modelWorking.thursdayH = Numeric_Thur_H1.Value.ToString(); modelWorking.thursdayM = Numeric_Thur_M1.Value.ToString(); modelWorking.fridayH = Numeric_Friday_H1.Value.ToString(); modelWorking.fridayM = Numeric_Friday_M1.Value.ToString(); modelWorking.saturdayH = Numeric_Satur_H1.Value.ToString(); modelWorking.saturdayM = Numeric_Satur_M1.Value.ToString(); // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked && CheckBoxWedneday1.Checked && CheckBoxThursday1.Checked && CheckBoxFriday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = Numeric_Wed_H1.Value.ToString(); modelWorking.wednesdayM = Numeric_Wed_M1.Value.ToString(); modelWorking.thursdayH = Numeric_Thur_H1.Value.ToString(); modelWorking.thursdayM = Numeric_Thur_M1.Value.ToString(); modelWorking.fridayH = Numeric_Friday_H1.Value.ToString(); modelWorking.fridayM = Numeric_Friday_M1.Value.ToString(); modelWorking.saturdayH = NotWorking111; modelWorking.saturdayM = NotWorking111; // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked && CheckBoxWedneday1.Checked && CheckBoxThursday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = Numeric_Wed_H1.Value.ToString(); modelWorking.wednesdayM = Numeric_Wed_M1.Value.ToString(); modelWorking.thursdayH = Numeric_Thur_H1.Value.ToString(); modelWorking.thursdayM = Numeric_Thur_M1.Value.ToString(); modelWorking.fridayH = NotWorking111; modelWorking.fridayM = NotWorking111; modelWorking.saturdayH = NotWorking111; modelWorking.saturdayM = NotWorking111; // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); }; } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked && CheckBoxWedneday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = Numeric_Wed_H1.Value.ToString(); modelWorking.wednesdayM = Numeric_Wed_M1.Value.ToString(); modelWorking.thursdayH = NotWorking111; modelWorking.thursdayM = NotWorking111; modelWorking.fridayH = NotWorking111; modelWorking.fridayM = NotWorking111; modelWorking.saturdayH = NotWorking111; modelWorking.saturdayM = NotWorking111; // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked && CheckBoxTeusday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = Numeric_Teus_H1.Value.ToString(); modelWorking.tusedayM = Numeric_Teus_M1.Value.ToString(); modelWorking.wednesdayH = NotWorking111; modelWorking.wednesdayM = NotWorking111; modelWorking.thursdayH = NotWorking111; modelWorking.thursdayM = NotWorking111; modelWorking.fridayH = NotWorking111; modelWorking.fridayM = NotWorking111; modelWorking.saturdayH = NotWorking111; modelWorking.saturdayM = NotWorking111; // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else if (CheckBoxMonday1.Checked) { modelWorking.MondayH = Numeric_mon_H1.Value.ToString(); modelWorking.MondayM = Numeric_mon_M1.Value.ToString(); modelWorking.tusedayH = NotWorking111; modelWorking.tusedayM = NotWorking111; modelWorking.wednesdayH = NotWorking111; modelWorking.wednesdayM = NotWorking111; modelWorking.thursdayH = NotWorking111; modelWorking.thursdayM = NotWorking111; modelWorking.fridayH = NotWorking111; modelWorking.fridayM = NotWorking111; modelWorking.saturdayH = NotWorking111; modelWorking.saturdayM = NotWorking111; // modelWorking.sundayH = NotWorking111; modelWorking.sundayM = NotWorking111; modelWorking.num_of_working_days = Nume_Total1.Value.ToString(); using (EFDBEntities1 db = new EFDBEntities1()) { if (modelWorking.weekID == 0) { } else { db.Entry(modelWorking).State = EntityState.Modified; db.SaveChanges(); } } clear(); show_data_GridView(); MessageBox.Show(" updated Successfully"); } else { MessageBox.Show(" Error"); } }