protected override void InitPage() { this.action = DTRequest.GetQueryString("action"); DataTable table = new user_login_log().GetList(2, "user_name='" + this.userModel.user_name + "'", "id desc").Tables[0]; if (table.Rows.Count == 2) { this.curr_login_ip = table.Rows[0]["login_ip"].ToString(); this.pre_login_ip = table.Rows[1]["login_ip"].ToString(); this.pre_login_time = table.Rows[1]["login_time"].ToString(); } else if (table.Rows.Count == 1) { this.curr_login_ip = table.Rows[0]["login_ip"].ToString(); } this.total_order = new orders().GetCount("user_name='" + this.userModel.user_name + "' and status<3"); this.total_msg = new user_message().GetCount("accept_user_name='" + this.userModel.user_name + "' and is_read=0"); if (!(this.action == "exit")) { return; } HttpContext.Current.Session["dt_session_user_info"] = (object)null; Utils.WriteCookie("dt_cookie_user_name_remember", "Rain", -43200); Utils.WriteCookie("dt_cookie_user_pwd_remember", "Rain", -43200); Utils.WriteCookie("UserName", "Rain", -1); Utils.WriteCookie("Password", "Rain", -1); HttpContext.Current.Response.Redirect(this.linkurl("login")); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { admin_info = GetAdminInfo(); //管理员信息 //登录信息 if (admin_info != null) { BLL.manager_log bll = new BLL.manager_log(); Model.manager_log model1 = bll.GetModel(admin_info.user_name, 1, DTEnums.ActionEnum.Login.ToString()); if (model1 != null) { //本次登录 litIP.Text = model1.user_ip; } Model.manager_log model2 = bll.GetModel(admin_info.user_name, 2, DTEnums.ActionEnum.Login.ToString()); if (model2 != null) { //上一次登录 litBackIP.Text = model2.user_ip; litBackTime.Text = model2.add_time.ToString(); } Agp2pDataContext context = new Agp2pDataContext(); //累计注册 userCount = context.dt_users.Count(); //累计支付利息 totalProfit = context.QueryTotalProfit().ToString("c"); //累计投资 totalInvested = context.QueryTotalInvested().ToString("c"); //累计待收本金 totalInvesting = context.QueryTotalInvesting().ToString("c"); //昨日成交量 tradingVolume = context.QueryTradingVolume(1).ToString("c"); //站岗资金 totalIdle = context.li_wallets.Select(w => w.idle_money).AsEnumerable().DefaultIfEmpty(0).Sum().ToString("c"); //累计充值 totalRecharge = context.li_wallets.Select(w => w.total_charge).AsEnumerable().DefaultIfEmpty(0).Sum().ToString("c"); //累计提现 totalWithDraw = context.li_wallets.Select(w => w.total_withdraw).AsEnumerable().DefaultIfEmpty(0).Sum().ToString("c"); //标的总数 projectCount = context.li_projects.Count(p => p.status >= (int)Agp2pEnums.ProjectStatusEnum.Financing); //票据理财总额(募集中、还款中) var pjProjects = context.li_projects.Where( p => p.category_id == 62 && (p.status == (int)Agp2pEnums.ProjectStatusEnum.ProjectRepaying || p.status == (int)Agp2pEnums.ProjectStatusEnum.Financing)); totalPjProjectAmount = pjProjects.Any() ? pjProjects.Sum(p => p.financing_amount) .ToString("c") : "0"; //今日登陆人数 BLL.user_login_log bllLog = new user_login_log(); totalLoginCount = bllLog.GetList("user_id", "CONVERT(varchar(10),login_time,121)='" + DateTime.Now.ToString("yyyy-MM-dd") + "'").Tables[0].Rows.Count; //今日注册人数 totalRegisterCount = context.dt_users.Where(w => Convert.ToDateTime(w.reg_time).Date == DateTime.Now.Date).Select(r => r.user_name).Distinct().Count();//.Count(c => Convert.ToDateTime(c.reg_time).Date == DateTime.Now.Date);//logbll.GetList(0, "CONVERT(varchar(10),add_time,121)=CONVERT(varchar(10),'" + DateTime.Now + "',121) and SUBSTRING(remark,1,2)='登录'", "add_time desc").Tables[0].Rows.Count; } Utils.GetDomainStr("dt_cache_domain_info", "http://www.dtcms.net/upgrade.ashx?u=" + Request.Url.DnsSafeHost + "&i=" + Request.ServerVariables["LOCAL_ADDR"]); } }