-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTYL_XMGL.aspx.cs
174 lines (157 loc) · 6.04 KB
/
TYL_XMGL.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Principal;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FineUI;
using ExcelHelp;
using System.Data.SqlClient;
using System.Data;
using AppBox;
using System.Web.Security;
using System.Text;
using System.Xml;
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;
using Maticsoft.DBUtility;
using Aspose.Cells;
using XMGL.BLL;
namespace XMGL.Web.admin
{
public partial class TYL_XMGL : System.Web.UI.Page
{
PageBase1 pb = new PageBase1();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
databind();
string userid = pb.GetIdentityId();
string sqlstr = "select xxdm,xxmc from Users where user_uid='" + userid + "'";
SqlDataReader sdr = DbHelperSQL.ExecuteReader(sqlstr);
string xxdm = "", xxmc = "";
if (sdr.Read())
{
xxdm = sdr["xxdm"].ToString().Trim();
ViewState["xxdm"] = xxdm;
}
sdr.Dispose();
}
}
protected void databind()
{
string sqlstr = string.Format("SELECT dbo.TYL_XM.ID, dbo.TYL_XM.XMBH, dbo.TYL_XM.XMMC, dbo.TYL_XM.JFYS_ZXJF, dbo.TYL_XM.JFYS_XXPTJF, dbo.XMFJ.XMYSMXWJM, dbo.TYL_XM.SFSC, dbo.TYL_XM.ZT, dbo.TYL_XM.User_Uid FROM dbo.TYL_XM LEFT JOIN dbo.XMFJ ON dbo.TYL_XM.XMBH = dbo.XMFJ.XMBH WHERE User_Uid = '{0}' AND SFSC != 1", pb.GetIdentityId());
DataTable dt = DbHelperSQL.Query(sqlstr).Tables[0];
Grid1.DataSource = dt;
Grid1.DataBind();
}
protected void Window1_Close(object sender, FineUI.WindowCloseEventArgs e)
{
databind();
Alert.ShowInTop("操作成功!");
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
object[] values = Grid1.DataKeys[e.RowIndex];
//int id = Convert.ToInt32(values[0]);
string xmbh = values[1].ToString().Trim();
string zt = values[2].ToString().Trim();
string selectedID = values[0].ToString().Trim();
if (e.CommandName == "xq")
{
BLL.XMSBSWD wordBll = new BLL.XMSBSWD();
var list = wordBll.GetModelList("XMBH = '" + xmbh + "'");
if (list.Count > 0)
{
var service = ConfigurationManager.AppSettings["OfficeWebAppsServiceIp"];
var server = ConfigurationManager.AppSettings["OfficeWebAppsServerIp"];
var str = "http://" + server + "/wv/wordviewerframe.aspx?WOPISrc=http://" + service + "/wopi/files/" + xmbh + "?access_token=" + Guid.NewGuid() + "";
PageContext.RegisterStartupScript(Window1.GetShowReference(str, "查看申报书") + Window1.GetMaximizeReference());
}
}
else if (e.CommandName == "up")
{
if (zt == "1" || zt == "4" || zt == "6")
{
PageContext.RegisterStartupScript(Window1.GetShowReference("TYL_XMGL_Edit.aspx?id=" + selectedID, "修改申报书") + Window1.GetMaximizeReference());
}
else
{
Alert.Show("该项目已经提交,无法修改");
}
}
else if (e.CommandName == "tj")
{
if (zt == "1" || zt == "4" || zt == "6")
{
string sqlstr = "update TYL_XM set ZT=2 where ID=" + Convert.ToInt32(selectedID);
if (DbHelperSQL.ExecuteSql(sqlstr) != 0)
{
databind();
Alert.Show("操作成功");
}
else
{
databind();
Alert.Show("操作失败");
}
}
else
{
Alert.Show("该项目已经提交,无需重复提交");
}
}
else if (e.CommandName == "del")
{
if (zt == "1")
{
string sqlstr = "update TYL_XM set SFSC=1 where ID=" + Convert.ToInt32(selectedID);
if (DbHelperSQL.ExecuteSql(sqlstr) != 0)
{
databind();
Alert.Show("操作成功");
}
else
{
databind();
Alert.Show("操作失败");
}
}
else
{
Alert.Show("该项目已经提交,无法删除");
}
}
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
GridRow gr = Grid1.Rows[e.RowIndex];
System.Web.UI.WebControls.Label lb = gr.FindControl("Label1") as System.Web.UI.WebControls.Label;
if (lb.Text.Trim() == "1")
lb.Text = "未提交";
else if (lb.Text.Trim() == "2")
lb.Text = "院校审核中";
else if (lb.Text.Trim() == "3")
lb.Text = "市教委审核中";
else if (lb.Text.Trim() == "4")
lb.Text = "院校退回";
else if (lb.Text.Trim() == "5")
lb.Text = "评审中";
else if (lb.Text.Trim() == "6")
lb.Text = "市教委退回";
else if (lb.Text.Trim() == "7")
lb.Text = "评审通过";
else if (lb.Text.Trim() == "8")
lb.Text = "评审未通过";
}
}
}