Beispiel #1
0
        public override SqlParameter[] GetParameters()
        {
            M_Design_Ask model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Title;
            sp[2].Value  = model.CUser;
            sp[3].Value  = model.Remind;
            sp[4].Value  = model.ZType;
            sp[5].Value  = model.ZStatus;
            sp[6].Value  = model.CDate;
            sp[7].Value  = model.PreViewImg;
            sp[8].Value  = model.EndDate;
            sp[9].Value  = model.AdminID;
            sp[10].Value = model.StartDate;
            sp[11].Value = model.IsShowResult;
            sp[12].Value = model.IsIPLimit;
            sp[13].Value = model.IsNeedLogin;
            sp[14].Value = model.IsEnableVCode;
            sp[15].Value = model.IPInterval;
            return(sp);
        }
Beispiel #2
0
        public M_Design_Ask GetModelFromReader(DbDataReader rdr)
        {
            M_Design_Ask model = new M_Design_Ask();

            model.ID            = ConvertToInt(rdr["ID"]);
            model.Title         = ConverToStr(rdr["Title"]);
            model.CUser         = ConvertToInt(rdr["CUser"]);
            model.Remind        = ConverToStr(rdr["Remind"]);
            model.ZType         = ConvertToInt(rdr["ZType"]);
            model.ZStatus       = ConvertToInt(rdr["ZStatus"]);
            model.CDate         = ConvertToDate(rdr["CDate"]);
            model.PreViewImg    = ConverToStr(rdr["PreViewImg"]);
            model.EndDate       = ConvertToDate(rdr["EndDate"]);
            model.AdminID       = ConvertToInt(rdr["AdminID"]);
            model.StartDate     = ConvertToDate(rdr["StartDate"]);
            model.IsShowResult  = ConvertToInt(rdr["IsShowResult"]);
            model.IsIPLimit     = ConvertToInt(rdr["IsIPLimit"]);
            model.IsNeedLogin   = ConvertToInt(rdr["IsNeedLogin"]);
            model.IsEnableVCode = ConvertToInt(rdr["IsEnableVCode"]);
            model.IPInterval    = ConvertToInt(rdr["IPInterval"]);
            rdr.Close();
            return(model);
        }