Exemplo n.º 1
0
        public M_ClassRoom GetModelFromReader(DbDataReader rdr)
        {
            M_ClassRoom model = new M_ClassRoom();

            model.RoomID     = Convert.ToInt32(rdr["RoomID"]);
            model.RoomName   = ConverToStr(rdr["RoomName"]);
            model.SchoolID   = ConvertToInt(rdr["SchoolID"]);
            model.ClassName  = ConverToStr(rdr["ClassName"]);
            model.Room       = ConverToStr(rdr["Room"]);
            model.Teacher    = ConverToStr(rdr["Teacher"]);
            model.Adviser    = ConverToStr(rdr["Adviser"]);
            model.Monitor    = ConverToStr(rdr["Monitor"]);
            model.Creation   = ConvertToDate(rdr["Creation"]);
            model.CreateUser = ConvertToInt(rdr["CreateUser"]);
            model.Integral   = ConvertToInt(rdr["Integral"]);
            model.Classinfo  = ConverToStr(rdr["Classinfo"]);
            model.Grade      = ConvertToInt(rdr["Grade"]);
            model.IsTrue     = ConvertToInt(rdr["IsTrue"]);
            model.ClassStar  = ConvertToInt(rdr["ClassStar"]);
            model.IsDone     = ConvertToInt(rdr["IsDone"]);
            rdr.Dispose();
            return(model);
        }
Exemplo n.º 2
0
        public override SqlParameter[] GetParameters()
        {
            M_ClassRoom model = this;

            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.RoomID;
            sp[1].Value  = model.RoomName;
            sp[2].Value  = model.SchoolID;
            sp[3].Value  = model.ClassName;
            sp[4].Value  = model.Room;
            sp[5].Value  = model.Teacher;
            sp[6].Value  = model.Adviser;
            sp[7].Value  = model.Monitor;
            sp[8].Value  = model.Creation;
            sp[9].Value  = model.CreateUser;
            sp[10].Value = model.Integral;
            sp[11].Value = model.Classinfo;
            sp[12].Value = model.Grade;
            sp[13].Value = model.IsTrue;
            sp[14].Value = model.ClassStar;
            sp[15].Value = model.IsDone;
            return(sp);
        }