Esempio n. 1
0
        public DTO4Arrangement getarrangment(int row, int cell, DataGridView dataGridView1, DateTimePicker dateTimePicker1, ComboBox comboBox1)
        {
            DTO4Arrangement arrangement = new DTO4Arrangement();
            DAO4DoctorInfo  dDAO        = new DAO4DoctorInfo();

            try
            {
                arrangement.DoctorName = dataGridView1.Rows[row].Cells[cell].Value.ToString();
                arrangement.Office     = comboBox1.SelectedValue.ToString();
                DTO4DoctorInfo doctor = dDAO.selectAllByNameAndOffice(arrangement.DoctorName, arrangement.Office);

                //根据排班表的行数来判断该医生是早班还是中班还是晚班

                if (row < 7)
                {
                    arrangement.BeginTime  = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 08:00:00");
                    arrangement.FinishTime = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 14:00:00");
                }
                else if (row < 13)
                {
                    arrangement.BeginTime  = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 14:00:00");
                    arrangement.FinishTime = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 20:00:00");
                }
                else
                {
                    arrangement.BeginTime  = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 20:00:00");
                    arrangement.FinishTime = Convert.ToDateTime(dataGridView1.Rows[0].Cells[cell].Value.ToString() + " 23:59:59");
                }
                arrangement.DoctorId       = doctor.Id;
                arrangement.DoctorJobTitle = doctor.JobTitle;

                return(arrangement);
            }
            catch {
                return(null);
            }
        }
Esempio n. 2
0
 public DTO4DoctorInfo QuaryDoctorinfoByNameAndOffice(string name, string office)
 {
     return(doctorinfo.selectAllByNameAndOffice(name, office));
 }