public List <DoctorRegisterMainInformaton> GetDoctorRegisterMainInformaton(string time) { List <DoctorRegisterMainInformaton> list_model = new List <DoctorRegisterMainInformaton>(); #region 测试数据 string[] TimeSpan = { "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" }; int[] RegisteredDoctorQuanty = { 2, 82, 244, 290, 387, 439, 462, 577, 648, 703, 748, 762, 770, 777, 777, 777, 777, 777, 777, 777 }; int hour = DateTime.Now.Hour; for (int i = 0; i < hour - 5; i++) { DoctorRegisterMainInformaton modelTemp = new DoctorRegisterMainInformaton(); modelTemp.TimeSpan = TimeSpan[i]; modelTemp.RegisteredDoctorQuanty = RegisteredDoctorQuanty[i]; list_model.Add(modelTemp); } return(list_model); #endregion }
//1医生签到的主增量图 public List <DoctorRegisterMainInformaton> GetDoctorRegisterMainInformaton(string time) { List <DoctorRegisterMainInformaton> list_model = new List <DoctorRegisterMainInformaton>(); String command = GetCommandForDetailedDoctorRegistered(); DbCommand queryCommand = db.GetSqlStringCommand(command); using (IDataReader reader = db.ExecuteReader(queryCommand)) { int tempNumber = 0; while (reader.Read()) { DoctorRegisterMainInformaton model = new DoctorRegisterMainInformaton(); tempNumber += reader["RegisteredDoctorQuanty"] is DBNull ? 0 : Convert.ToInt32(reader["RegisteredDoctorQuanty"]); model.RegisteredDoctorQuanty = tempNumber; model.TimeSpan = reader["SpanTime"] is DBNull ? string.Empty : (reader["SpanTime"].ToString()); list_model.Add(model); } } return(list_model); }