Exemplo n.º 1
0
        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));
                }
            }
        }
Exemplo n.º 2
0
        private void DutyCheked()
        {
            doctors = new List <Doctors>();

            DataTable dutyChekList = new DataTable();

            dutyChekList = dutyDT.Clone();
            var personalDTclone = personalDT.Clone();

            personalDTclone = (DataTable)dataGridView1.DataSource;
            foreach (DataRow data in personalDTclone.Rows)
            {
                if (data["Selected"].ToString() == "True")
                {
                    DataRow[] foundRows = dutyDT.Select("FIRST_LAST_NAME = '" + data["FIRST_LAST_NAME"].ToString() + "'");
                    if (foundRows.Length != 0)
                    {
                        Doctors tmp = new Doctors();
                        doctors.Add(tmp.InsertDoctor(data, clinic));

                        for (int i = 0; i < foundRows.Length; i++)
                        {
                            dutyChekList.ImportRow(foundRows[i]);
                        }
                    }
                }
            }


            personalDT = personalDTclone.Copy();


            dataGridView1.DataSource = dutyChekList;
        }