/// <summary> /// 用户认证ip管理 详情查询 /// </summary> public object Get(int id) { base_user_ip info = user_ipBLL.GetInfo(id, out errmsg) ; if (!string.IsNullOrEmpty(errmsg)) { return(new { Rcode = -1, Rmsg = "获取数据失败" }); } return(new { Rcode = 1, Rdata = info }); }
/// <summary> /// 用户认证ip管理 添加数据 /// </summary> /// <param name="base_user_ip">要添加的用户认证ip管理对象</param> /// <param name="errmsg">错误信息</param> /// <returns>返回对象</returns> public static bool Add(base_user_ip info, out string errmsg) { List <DataParameter> pars = new List <DataParameter>(); pars.Add(new DataParameter("userid", info.userid)); pars.Add(new DataParameter("ip_start", info.ip_start)); pars.Add(new DataParameter("ip_end", info.ip_end)); string sqlstr = "insert into base_user_ip (userid,ip_start,ip_end) values (@userid,@ip_start,@ip_end) "; return(MySqlHelper.ExecuteCommand(sqlstr, out errmsg, pars) > 0); }
/// <summary> /// 用户认证ip管理 添加数据 /// </summary> public object Post([FromBody] base_user_ip info) { bool success = user_ipBLL.Add(info, out errmsg); if (!success || !string.IsNullOrEmpty(errmsg)) { return new { Rcode = -1, Rmsg = "添加失败" } } ; return(new { Rcode = 1, Rmsg = "添加成功" }); }
/// <summary> /// 用户认证ip管理 更新数据 /// </summary> /// <param name="base_user_ip">要更新的用户认证ip管理对象</param> /// <param name="errmsg">错误信息</param> /// <returns>返回对象</returns> public static bool Update(base_user_ip info, out string errmsg) { List <DataParameter> pars = new List <DataParameter>(); pars.Add(new DataParameter("userid", info.userid)); pars.Add(new DataParameter("ip_start", info.ip_start)); pars.Add(new DataParameter("ip_end", info.ip_end)); string sqlstr = "update base_user_ip set userid=@userid,ip_start=@ip_start,ip_end=@ip_end where seqid=@seqid "; pars.Add(new DataParameter("seqid", info.seqid)); return(MySqlHelper.ExecuteCommand(sqlstr, out errmsg, pars) > 0); }
/// <summary> /// 用户认证ip管理 更新数据 /// </summary> public object Put(int id, [FromBody] base_user_ip info) { info.seqid = id; bool success = user_ipBLL.Update(info, out errmsg); WriteSysLog(1, string.Format("更新用户认证ip管理 id为 {0},返回{1} {2}", id, success, errmsg)); if (!success || !string.IsNullOrEmpty(errmsg)) { return new { Rcode = -1, Rmsg = "更新失败" } } ; return(new { Rcode = 1, Rmsg = "更新成功" }); }
/// <summary> /// 用户认证ip管理 更新数据 /// </summary> /// <param name="base_user_ip">要更新的用户认证ip管理对象</param> /// <param name="errmsg">错误信息</param> /// <returns>返回对象</returns> public static bool Update(base_user_ip info, out string errmsg) { return(user_ipDAL.Update(info, out errmsg)); }
/// <summary> /// 用户认证ip管理 添加数据 /// </summary> /// <param name="base_user_ip">要添加的用户认证ip管理对象</param> /// <param name="errmsg">错误信息</param> /// <returns>返回对象</returns> public static bool Add(base_user_ip info, out string errmsg) { return(user_ipDAL.Add(info, out errmsg)); }
/// <summary> /// 用户认证ip管理 详情查询 /// </summary> public static base_user_ip GetInfo(int seqid, out string errmsg) { base_user_ip info = user_ipDAL.GetInfo(seqid, out errmsg); return(info); }