95 lines
4.6 KiB
C#
95 lines
4.6 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Collections;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
|
|
public partial class Main_SmsShow : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
ZWL.Common.PublicMethod.CheckSession();
|
|
ZWL.BLL.ERPLanEmail MyLanEmail = new ZWL.BLL.ERPLanEmail();
|
|
|
|
//获得最新的一个未读ID
|
|
int NewMailID = int.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 ID from ERPLanEmail where ToUser='" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "' and EmailState='未读' order by ID desc"));
|
|
MyLanEmail.GetModel(NewMailID);
|
|
this.Label5.Text = MyLanEmail.EmailTitle;
|
|
this.Label2.Text = MyLanEmail.FromUser;
|
|
this.Label4.Text = MyLanEmail.ToUser;
|
|
this.Label3.Text = MyLanEmail.TimeStr.ToString();
|
|
this.Label6.Text = MyLanEmail.EmailContent + "<br>" + ZWL.Common.PublicMethod.GetWenJian(MyLanEmail.FuJian, "../UploadFile/");
|
|
this.Label7.Text = NewMailID.ToString();
|
|
//新邮件个数
|
|
this.Label1.Text = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select count(*) from ERPLanEmail where ToUser='" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "' and EmailState='未读'");
|
|
|
|
string type = MyLanEmail.type;
|
|
if (string.IsNullOrEmpty(type))
|
|
this.HyperLink1.NavigateUrl = "../LanEmail/EmailView.aspx?ID=" + NewMailID.ToString();
|
|
else
|
|
{
|
|
string id = type.Split('|')[1];
|
|
string type2= type.Split('|')[0];
|
|
switch (type2)
|
|
{
|
|
case "出差报销":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqccbxshMessageNew?id=" + id; break;
|
|
case "其他报销":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqqtbxshMessageNew?id =" + id; break;
|
|
case "物资采购报销":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqwzcgbxshMessageNew?id =" + id; break;
|
|
|
|
case "项目经费申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqspMessageNew?id=" + id; break;
|
|
case "三重一大申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/szyd_zjspMessageNew?id=" + id; break;
|
|
case "费用支出申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqfyzcshMessageNew?id=" + id; break;
|
|
case "物资采购":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqwzcgshMessageNew?id=" + id; break;
|
|
case "维修":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqwxshMessageNew?id=" + id; break;
|
|
case "加班用餐":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqjbycshMessageNew?id=" + id; break;
|
|
case "公务接待":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqgwjdshMessageNew?id =" + id; break;
|
|
case "出差申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/chuchai_spMessageNew?id=" + id; break;
|
|
|
|
case "预算申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqysspMessage?id =" + id; break;
|
|
case "借款申请":
|
|
this.HyperLink1.NavigateUrl = "/dccdc/sq2/sqjkshMessage?id=" + id; break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
protected void LinkButton4_Click(object sender, EventArgs e)
|
|
{
|
|
ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPLanEmail set EmailState='已读' where ID="+this.Label7.Text.Trim());
|
|
Response.Write("<script>window.close();window.parent.closeExtToastWindow();</script>");
|
|
}
|
|
protected void LinkButton1_Click(object sender, EventArgs e)
|
|
{
|
|
ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPLanEmail set EmailState='删除' where ID=" + this.Label7.Text.Trim());
|
|
Response.Write("<script>window.close();window.parent.closeExtToastWindow();</script>");
|
|
}
|
|
public void btnDownloadFile_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
ZWL.Common.PublicMethod.DownloadFile(Server.MapPath("~"), this.hdnFileURL.Value.Trim());
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|