Example #1
0
        //获取候诊人数
        public List <WaitingPatientQuanty> GetWaitingQuanty()
        {
            List <WaitingPatientQuanty> list_WaitingQuanty = new List <WaitingPatientQuanty>();

            string[] Specialist = { "0", "肿瘤科", "内分泌科", "妇科", "骨科", "放射科" };
            Random   random     = new Random();

            for (int i = 1; i < 6; i++)
            {
                WaitingPatientQuanty waitingQuanty = new WaitingPatientQuanty();
                waitingQuanty.CompletedTreatQuanty = random.Next(300, 400) - 30 * i;
                waitingQuanty.WaitingQuanty        = random.Next(600, 700) - 50 * i;
                waitingQuanty.Specialist           = Specialist[i];
                list_WaitingQuanty.Add(waitingQuanty);
            }
            return(list_WaitingQuanty);
        }
Example #2
0
        //2.2获取候诊人数
        public List <WaitingPatientQuanty> GetWaitingQuanty()
        {
            List <WaitingPatientQuanty> list_WaitingQuanty = new List <WaitingPatientQuanty>();
            String    command      = GetCommandForWaitingQuanty();
            DbCommand queryCommand = db.GetSqlStringCommand(command);

            using (IDataReader reader = db.ExecuteReader(queryCommand))
            {
                while (reader.Read())
                {
                    WaitingPatientQuanty waitingQuanty = new WaitingPatientQuanty();
                    waitingQuanty.CompletedTreatQuanty = reader["CompletedTreatQuanty"] is DBNull ? 0 : Convert.ToInt32(reader["CompletedTreatQuanty"]);
                    waitingQuanty.WaitingQuanty        = reader["WaitingQuanty"] is DBNull ? 0 : Convert.ToInt32(reader["WaitingQuanty"]);
                    waitingQuanty.Specialist           = reader["Specialist"] is DBNull ? "" : (reader["Specialist"]).ToString();
                    list_WaitingQuanty.Add(waitingQuanty);
                }
            }
            return(list_WaitingQuanty);
        }