Esempio n. 1
0
        public M_WX_MsgTlp GetModelFromReader(DbDataReader rdr)
        {
            M_WX_MsgTlp model = new M_WX_MsgTlp();

            model.ID         = ConvertToInt(rdr["ID"]);
            model.Alias      = ConverToStr(rdr["Alias"]);
            model.MsgType    = ConverToStr(rdr["MsgType"]);
            model.MsgContent = ConverToStr(rdr["MsgContent"]);
            model.AllowLabel = ConvertToInt(rdr["AllowLabel"]);
            model.AdminID    = ConvertToInt(rdr["AdminID"]);
            model.CDate      = ConvertToDate(rdr["CDate"]);
            rdr.Close();
            return(model);
        }
Esempio n. 2
0
        public override SqlParameter[] GetParameters()
        {
            M_WX_MsgTlp model = this;

            if (model.CDate <= DateTime.Now)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.Alias;
            sp[2].Value = model.MsgType;
            sp[3].Value = model.MsgContent;
            sp[4].Value = model.AllowLabel;
            sp[5].Value = model.AdminID;
            sp[6].Value = model.CDate;
            return(sp);
        }