Exemplo n.º 1
0
        public void LoadExaminees(DateTime dt)
        {
            vExaminee.Clear();
            N_ExamineeGroupByLv[Level.A] = N_ExamineeGroupByLv[Level.B] = 0;
            MySqlDataReader reader = DBConnect.exeQrySelect("sqz_slot_room AS a,sqz_examinee AS b",
                                                            "lv,id,name,birdate,birthplace", "a.rid=" + ID +
                                                            " AND a.dt='" + dt.ToString(DT._) + "' AND a.t='" + dt.ToString(DT.hh) +
                                                            "' AND a.dt=b.dt AND a.t=b.t AND a.rid=b.rid");

            while (reader.Read())
            {
                ExamineeS0 e = new ExamineeS0();
                e.mDt = dt;
                if (!Enum.TryParse(reader.GetString(0), out e.Lv))
                {
                    continue;
                }
                e.uId         = reader.GetUInt16(1);
                e.tName       = reader.GetString(2);
                e.tBirdate    = reader.GetDateTime(3).ToString(DT.RR);
                e.tBirthplace = reader.GetString(4);
                vExaminee.Add(e.LvId, e);
                ++N_ExamineeGroupByLv[e.Lv];
            }
            reader.Close();

            foreach (ExamineeA e in vExaminee.Values)
            {
                reader = DBConnect.exeQrySelect("sqz_nee_qsheet",
                                                "t1,t2,grade,comp", "dt='" + e.mDt.ToString(DT._) + "' AND lv='" +
                                                e.Lv + "' AND neeid=" + e.uId);
                if (reader != null)
                {
                    if (reader.Read())
                    {
                        if (DT.Toh(reader.GetString(0), DT.hs, out e.dtTim1))
                        {
                            break;
                        }
                        if (DT.Toh(reader.GetString(1), DT.hs, out e.dtTim2))
                        {
                            break;
                        }
                        e.uGrade = reader.GetInt16(2);
                        e.tComp  = reader.GetString(3);
                        e.mPhase = ExamineePhase.Finished;
                    }
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public bool ReadByte0(byte[] buf, ref int offs)
        {
            if (buf == null)
            {
                return(true);
            }
            if (buf.Length - offs < 4)
            {
                return(true);
            }
            int n = BitConverter.ToInt32(buf, offs);

            offs += 4;
            while (0 < n)
            {
                --n;
                ExamineeS0 e = new ExamineeS0();
                //e.bFromC = false;
                if (e.ReadByte(buf, ref offs))
                {
                    return(true);
                }
                ExamineeA o;
                if (vExaminee.TryGetValue(e.LvId, out o))
                {
                    o.bFromC = false;
                    o.Merge(e);
                }
            }
            if (n == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }