Esempio n. 1
0
 /// <summary>
 /// 添加本地管理员日志公用方法
 /// </summary>
 /// <param name="l_user_id">用户ID</param>
 /// <param name="l_logtype_id">日志类别:1 注册 2 登录 3 操作</param>
 /// <param name="l_ip">IP地址</param>
 /// <param name="l_sms">简短说明</param>
 /// <param name="l_info">附加信息</param>
 public static void AddLog(int l_user_id, int l_logtype_id, string l_ip, string l_sms, string l_info)
 {
     JMP.MDL.jmp_locuserlog m_locuserlog   = new JMP.MDL.jmp_locuserlog();
     JMP.BLL.jmp_locuserlog bll_locuserlog = new JMP.BLL.jmp_locuserlog();
     m_locuserlog.l_user_id    = l_user_id;
     m_locuserlog.l_logtype_id = l_logtype_id;
     m_locuserlog.l_ip         = l_ip;
     //m_locuserlog.l_location = IPAddress.GetAddressByIp(l_ip);
     m_locuserlog.l_location = "";
     m_locuserlog.l_info     = l_info;
     m_locuserlog.l_sms      = l_sms;
     m_locuserlog.l_time     = DateTime.Now;
     bll_locuserlog.Add(m_locuserlog);
 }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <JMP.MDL.jmp_locuserlog> DataTableToList(DataTable dt)
        {
            List <JMP.MDL.jmp_locuserlog> modelList = new List <JMP.MDL.jmp_locuserlog>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_locuserlog model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_locuserlog();
                    if (dt.Rows[n]["l_id"].ToString() != "")
                    {
                        model.l_id = int.Parse(dt.Rows[n]["l_id"].ToString());
                    }
                    if (dt.Rows[n]["l_user_id"].ToString() != "")
                    {
                        model.l_user_id = int.Parse(dt.Rows[n]["l_user_id"].ToString());
                    }
                    if (dt.Rows[n]["l_logtype_id"].ToString() != "")
                    {
                        model.l_logtype_id = int.Parse(dt.Rows[n]["l_logtype_id"].ToString());
                    }
                    model.l_ip       = dt.Rows[n]["l_ip"].ToString();
                    model.l_location = dt.Rows[n]["l_location"].ToString();
                    model.l_info     = dt.Rows[n]["l_info"].ToString();
                    model.l_sms      = dt.Rows[n]["l_sms"].ToString();
                    if (dt.Rows[n]["l_time"].ToString() != "")
                    {
                        model.l_time = DateTime.Parse(dt.Rows[n]["l_time"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(JMP.MDL.jmp_locuserlog model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JMP.MDL.jmp_locuserlog model)
 {
     return(dal.Add(model));
 }