Example #1
0
 public SqlParameter[] GetParameters(M_School model)
 {
     string[,] strArr = FieldList();
     SqlParameter[] sp = GetSP();
     sp[0].Value = model.ID;
     sp[1].Value = model.SchoolName;
     sp[2].Value = model.Country;
     sp[3].Value = model.Province;
     sp[4].Value = model.SchoolType;
     sp[5].Value = model.Visage;
     sp[6].Value = model.Addtime;
     sp[7].Value = model.SchoolInfo;
     sp[8].Value = model.City;
     sp[9].Value = model.County;
     return(sp);
 }
Example #2
0
        public M_School GetModelFromReader(DbDataReader rdr)
        {
            M_School model = new M_School();

            model.ID         = Convert.ToInt32(rdr["ID"]);
            model.SchoolName = ConverToStr(rdr["SchoolName"]);
            model.Country    = ConverToStr(rdr["Country"]);
            model.Province   = ConverToStr(rdr["Province"]);
            model.SchoolType = ConvertToInt(rdr["SchoolType"]);
            model.Visage     = ConvertToInt(rdr["Visage"]);
            model.Addtime    = ConvertToDate(rdr["Addtime"]);
            model.SchoolInfo = ConverToStr(rdr["SchoolInfo"]);
            model.City       = ConverToStr(rdr["City"]);
            model.County     = ConverToStr(rdr["County"]);
            rdr.Close();
            return(model);
        }