public void InsertDoc() { DocDocDoctors = new DocDoc.Doctors(); DocDocDoctors.Doctor = new List <DocDoc.Doctor>(); doctorsList = new List <Doctors>(); sheduleCollect = new SheduleCollect(); doct_shedule = new Doct_shedule(); foreach (DataRow data in personalDTWithChek.Rows) { if (data["Selected"].ToString() == "true") { { Doctors tmp = new Doctors(); doctorsList.Add(tmp.InsertDoctor(data, clinic)); DocDocDoctors.Doctor.Add(new DocDoc.Doctor(data, DocDocClinics.Clinic[0])); } } } sheduleCollect.InsertShedule(dutyDT, personalDTWithChek); DocDocSlots = new DocDoc.Slots(); DocDocSlots.Slot = new List <DocDoc.Slot>(); foreach (DataRow sh in dutyDT.Rows) { if (bool.Parse(sh["BusyTime"].ToString()) != true) { DocDocSlots.Slot.Add(new DocDoc.Slot(sh)); } } }