Exemple #1
0
        public M_Site_SiteList GetModelFromReader(DbDataReader rdr)
        {
            M_Site_SiteList model = new M_Site_SiteList();

            model.ID          = Convert.ToInt32(rdr["ID"]);
            model.SiteID      = ConvertToInt(rdr["SiteID"]);
            model.SiteName    = ConverToStr(rdr["SiteName"]);
            model.SiteManager = ConverToStr(rdr["SiteManager"]);
            model.Remind      = ConverToStr(rdr["Remind"]);
            model.CreateDate  = ConvertToDate(rdr["CreateDate"]);
            model.EndDate     = ConvertToDate(rdr["EndDate"]);
            model.CreateMan   = ConverToStr(rdr["CreateMan"]);
            model.OrderNum    = ConverToStr(rdr["OrderNum"]);
            rdr.Close();
            return(model);
        }
Exemple #2
0
        public override SqlParameter[] GetParameters()
        {
            M_Site_SiteList model = this;

            if (model.CreateDate <= DateTime.MinValue)
            {
                model.CreateDate = DateTime.Now;
            }
            if (model.EndDate <= DateTime.MinValue)
            {
                model.EndDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.SiteID;
            sp[2].Value = model.SiteName;
            sp[3].Value = model.SiteManager;
            sp[4].Value = model.Remind;
            sp[5].Value = model.CreateDate;
            sp[6].Value = model.EndDate;
            sp[7].Value = model.CreateMan;
            sp[8].Value = model.OrderNum;
            return(sp);
        }