You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Shipping/SeaeOrderInfoRejected.aspx.cs

132 lines
5.3 KiB
C#

3 years ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using DSWeb.DataAccess;
using System.Data.SqlClient;
using DSWeb.Models;
using DSWeb.EntityDA;
using System.Web.Script.Serialization;
using JsonHelper;
using DSWeb.Log;
namespace DSWeb.Shipping
{
public partial class SeaeOrderInfoRejected : System.Web.UI.Page
{
CrmSeaeorderDA CrmSeaeorderDA = new CrmSeaeorderDA();
CrmSeaeorderEntity CrmSeaeorderEntity = new CrmSeaeorderEntity();
TopSeaeEntity TopSeaeEntity = new TopSeaeEntity();
SeaExportInfoDA SeaExportInfoDA = new SeaExportInfoDA();
public string strUserID;//用户GID
private string strShowName;//用户登录名
T_ALL_DA T_ALL_DA = new T_ALL_DA();
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString().Trim();
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
//strUserID = "";
}
if (Session["SHOWNAME"] != null)
{
strShowName = Session["SHOWNAME"].ToString();
}
//
if (!IsPostBack)
{
if (Request.QueryString["ORDNO"] != null)
{
ViewState["ORDNO"] = Request.QueryString["ORDNO"].ToString();
}
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();</script>");
return;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (ViewState["ORDNO"] != null)
{
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["ORDNO"].ToString().Trim());
if (TopSeaeEntity.BSNO != null)
{
string alt = T_ALL_DA.GetSeaExportInfoDel(TopSeaeEntity.BSNO.Trim(), TopSeaeEntity.BSSTATUS, strUserID.Trim());
if (alt != "")
{
Response.Write("<script>alert('" + alt + " 因此不允许驳回!');window.close();</script>");
return;
}
}
//
CrmSeaeorderEntity = CrmSeaeorderDA.GetID(ViewState["ORDNO"].ToString().Trim());
if (CrmSeaeorderEntity.ORDNO != null)
{
if (CrmSeaeorderEntity.ORSTATUS.ToString().Trim().Equals("0") || CrmSeaeorderEntity.ORSTATUS.ToString().Trim().Equals("1"))
{
int iii = CrmSeaeorderDA.UpdateInfoCNTRTOTAL("update crm_seaeorder set ORREASON='" + this.TextBox1.Text.Trim() + "',ORSTATUS='2' where ORDNO='" + ViewState["ORDNO"].ToString().Trim() + "'", strUserID.Trim());
if (iii == 1)
{
UserDA userDA = new UserDA();
UserEntity userEntity = new UserEntity();
userEntity = userDA.GetUserAllBySHOWNAME(CrmSeaeorderEntity.INPUTBY);
IList<MessageEntity> messageEntities = new List<MessageEntity>();
MessageDA messageDA = new MessageDA();
//插入消息提醒
MessageEntity messageEntity = new MessageEntity();
messageEntity.GID = Guid.NewGuid().ToString();
messageEntity.Name = "SeaOrderAudit";
messageEntity.Description = "销售订舱审核通知";
messageEntity.IsRead = false;
messageEntity.ReadCount = 0;
messageEntity.MessageContent = strShowName + " 未批准您的 [销售订舱审核] 申请,销售订舱被驳回 ";
messageEntity.TaskID = "";
messageEntity.Receiver = userEntity.Gid;
messageEntity.TaskUrl = "shipping/SeaeOrderList.aspx";
messageEntity.Type = messageDA.GetMessageType(MessageType.SEAORDERAUDIT);
messageEntity.RecvType = 3;//审核完成类型
messageEntities.Add(messageEntity);
if (messageEntities.Count > 0)
{
messageDA.CreateMessage(MessageType.SEAORDERAUDIT, messageEntities);
}
Response.Write("<script>window.opener.location.reload();window.close();</script>");
return;
}
else
{
Response.Write("<script>alert('出错,请重新操作!');history.back();</script>");
return;
}
}
}
}
}
}
}