示例#1
0
        public M_Design_AnsDetail GetModelFromReader(DbDataReader rdr)
        {
            M_Design_AnsDetail model = new M_Design_AnsDetail();

            model.ID     = ConvertToInt(rdr["ID"]);
            model.AskID  = ConvertToInt(rdr["AskID"]);
            model.AnsID  = ConvertToInt(rdr["AnsID"]);
            model.Qid    = ConvertToInt(rdr["Qid"]);
            model.Answer = ConverToStr(rdr["Answer"]);
            model.UserID = ConvertToInt(rdr["UserID"]);
            model.CDate  = ConvertToDate(rdr["CDate"]);
            rdr.Close();
            return(model);
        }
示例#2
0
        public override SqlParameter[] GetParameters()
        {
            M_Design_AnsDetail model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.AskID;
            sp[2].Value = model.AnsID;
            sp[3].Value = model.Qid;
            sp[4].Value = model.Answer;
            sp[5].Value = model.UserID;
            sp[6].Value = model.CDate;
            return(sp);
        }