This repository has been archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserIndex.aspx.cs
94 lines (92 loc) · 2.93 KB
/
UserIndex.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WXShare
{
public partial class UserIndex : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// 不是微信内置浏览器
if (!WXManage.IsWXBrowser(Request))
{
Response.Redirect("/RequireWX.aspx?url=" + Request.Url);
return;
}
// 没有登录
if (Session["phone"] == null)
{
Response.Redirect("/UserLogin.aspx");
return;
}
// 没有设置密码
var user = DataBase.User.Get(new Objects.User()
{
phone = Session["phone"].ToString(),
identity=Session["iden"].ToString()
});
if(user.password == "")
{
Response.Redirect("/UserSetPassword.aspx");
return;
}
if(Session["iden"].ToString() == "2")
{
// 新的派单订单
var list = DataBase.Order.Gets(user);
int count = 0;
foreach(var order in list)
{
if(order.status == 0)
{
count++;
}
}
if(count!=0)
{
newOrderCountYWY.Style["display"] = "";
newOrderCountYWY.InnerText = count.ToString();
}
}
else if (Session["iden"].ToString() == "4")
{
// 新的派工订单
var team = DataBase.Team.Get(user);
var list = DataBase.Order.Gets(team);
int count = 0;
foreach (var order in list)
{
if (order.status == 8)
{
count++;
}
}
if (count != 0)
{
newOrderCountSGD.Style["display"] = "";
newOrderCountSGD.InnerText = count.ToString();
}
}
else if(Session["iden"].ToString() == "5")
{
// 新的活动报名
var asign = DataBase.ActivitySign.Gets();
if(asign.Count!=0)
{
newActivitySign.Style["display"] = "";
newActivitySign.InnerText = asign.Count.ToString();
}
// 新的注册
var userAuth = DataBase.UserUnAuth.Gets();
if(userAuth.Count != 0 )
{
newRegister.Style["display"] = "";
newRegister.InnerText = userAuth.Count.ToString();
}
}
}
}
}