Exemplo n.º 1
0
        public M_Log GetModelFromReader(SqlDataReader rdr)
        {
            M_Log model = new M_Log();

            model.ID      = Convert.ToInt32(rdr["id"]);
            model.UName   = ConverToStr(rdr["UName"]);
            model.IP      = ConverToStr(rdr["IP"]);
            model.AName   = ConverToStr(rdr["AName"]);
            model.CDate   = ConvertToDate(rdr["CDate"]);
            model.Source  = ConverToStr(rdr["Source"]);
            model.Action  = ConverToStr(rdr["Action"]);
            model.Message = ConverToStr(rdr["Message"]);
            model.Level   = ConverToStr(rdr["Level"]);
            rdr.Close();
            return(model);
        }
Exemplo n.º 2
0
        //FOR SQL
        public override SqlParameter[] GetParameters()
        {
            M_Log model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value = model.ID;
            sp[1].Value = model.UName;
            sp[2].Value = model.IP;
            sp[3].Value = model.AName;
            sp[4].Value = model.CDate;
            sp[5].Value = model.Source;
            sp[6].Value = model.Action;
            sp[7].Value = model.Message;
            sp[8].Value = model.Level;
            return(sp);
        }