-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewControl.aspx.cs
29 lines (28 loc) · 1.02 KB
/
ViewControl.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Darili_api;
public partial class ViewControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int eid=int.Parse(Request.QueryString["id"]);
Darili_LinqDataContext ctx = new Darili_LinqDataContext();
short viewflag = ctx.EventMain.Where(p => p.Id == eid).Select(p => p.ViewFlag).First();
if (Event_RoleControl.OwnerOrAdmin(eid))
{
if (viewflag == (short)Event_ViewControl.ViewLevel.Closed || viewflag == (short)Event_ViewControl.ViewLevel.InternalClosed)
{
Darili_EventManuever.OpenEvent(eid);
}
else if (viewflag == (short)Event_ViewControl.ViewLevel.PublicViewable || viewflag == (short)Event_ViewControl.ViewLevel.Internal)
{
Darili_EventManuever.CloseEvent(eid);
}
Response.Write(1);
}
}
}