Exemplo n.º 1
0
        public override SqlParameter[] GetParameters()
        {
            M_Mail_BookRead model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            if (model.EndTime <= DateTime.MinValue)
            {
                model.EndTime = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Title;
            sp[2].Value  = model.UserID;
            sp[3].Value  = model.CDate;
            sp[4].Value  = model.EndTime;
            sp[5].Value  = model.IsNotRead;
            sp[6].Value  = model.IsAudit;
            sp[7].Value  = model.Reserve;
            sp[8].Value  = model.Gid;
            sp[9].Value  = model.UserType;
            sp[10].Value = model.IP;
            sp[11].Value = model.Source;
            sp[12].Value = model.Browser;
            sp[13].Value = model.EMail;
            sp[14].Value = model.AuthCode;
            return(sp);
        }
Exemplo n.º 2
0
        public M_Mail_BookRead GetModelFromReader(DbDataReader rdr)
        {
            M_Mail_BookRead model = new M_Mail_BookRead();

            model.ID        = Convert.ToInt32(rdr["ID"]);
            model.Title     = rdr["Title"].ToString();
            model.UserID    = ConvertToInt(rdr["UserId"]);
            model.CDate     = ConvertToDate(rdr["CDate"]);
            model.EndTime   = ConvertToDate(rdr["EndTime"]);
            model.IsNotRead = ConvertToInt(rdr["IsNotRead"].ToString());
            model.IsAudit   = ConvertToInt(rdr["IsAudit"]);
            model.Reserve   = rdr["Reserve"].ToString();
            model.Gid       = ConvertToInt(rdr["Gid"]);
            model.UserType  = ConvertToInt(rdr["UserType"]);
            model.IP        = ConverToStr(rdr["IP"]);
            model.Source    = ConverToStr(rdr["Source"]);
            model.Browser   = ConverToStr(rdr["Browser"]);
            model.EMail     = ConverToStr(rdr["EMail"]);
            model.AuthCode  = ConverToStr(rdr["AuthCode"]);
            rdr.Close();
            return(model);
        }