Пример #1
0
        public override SqlParameter[] GetParameters()
        {
            M_AskCommon model = this;

            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.AskID;
            sp[2].Value = model.AswID;
            sp[3].Value = model.UserID;
            sp[4].Value = model.Content;
            sp[5].Value = model.AddTime;
            sp[6].Value = model.Type;
            return(sp);
        }
Пример #2
0
        public M_AskCommon GetModelFromReader(DbDataReader rdr)
        {
            M_AskCommon model = new M_AskCommon();

            model.ID      = Convert.ToInt32(rdr["ID"]);
            model.AskID   = ConvertToInt(rdr["AskID"]);
            model.AswID   = ConvertToInt(rdr["AswID"]);
            model.UserID  = ConvertToInt(rdr["UserID"]);
            model.Content = ConverToStr(rdr["Content"]);
            model.AddTime = ConvertToDate(rdr["AddTime"]);
            model.Type    = ConvertToInt(rdr["Type"]);
            rdr.Close();
            rdr.Dispose();
            return(model);
        }