diff --git a/Common/CK.SCP.Common.csproj b/Common/CK.SCP.Common.csproj
index a1202e9..f34cec4 100644
--- a/Common/CK.SCP.Common.csproj
+++ b/Common/CK.SCP.Common.csproj
@@ -94,6 +94,7 @@
CktTextBox.cs
+
diff --git a/Common/MailManager.cs b/Common/MailManager.cs
new file mode 100644
index 0000000..34afce6
--- /dev/null
+++ b/Common/MailManager.cs
@@ -0,0 +1,42 @@
+using CK.SCP.Utils;
+using MailKit.Security;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CK.SCP.Common
+{
+ public class MailManager
+ {
+ ///
+ /// 发送邮件
+ ///
+ ///
+ ///
+ ///
+ public static void SendMailOrders(string mails = "", string mailbody = "", string p_MailTitle = "")
+ {
+ try
+ {
+ List toList = new List();
+ EmailAddress add = new EmailAddress(mails, mails);
+ toList.Add(add);
+ var smtpMailSender = new MailKitMailSender(SecureSocketOptions.StartTls);
+ smtpMailSender.BuildOrderMessage(
+ toList,
+ p_MailTitle,
+ mailbody,
+ "BBC"
+ );
+ smtpMailSender.SendOrder();
+ }
+ catch (Exception e)
+ {
+ LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message + e.InnerException?.Message);
+ throw e;
+ }
+ }
+ }
+}
diff --git a/Common/MyWebSmtpMail.cs b/Common/MyWebSmtpMail.cs
index 2688946..a3c7ed8 100644
--- a/Common/MyWebSmtpMail.cs
+++ b/Common/MyWebSmtpMail.cs
@@ -88,29 +88,34 @@ namespace CK.SCP.Common
}
}
-
+ ///
+ /// 材料邮件
+ ///
+ ///
+ ///
+ ///
public void SendOrdersEmail(string To, string Body, string Title)
{
mailMessage = new MailMessage();
mailMessage.To.Add(To);
- mailMessage.From = new System.Net.Mail.MailAddress(this.from);
+ mailMessage.From = new MailAddress("faway_cyjdd@163.com");
mailMessage.Subject = Title;
mailMessage.Body = Body;
mailMessage.IsBodyHtml = true;
- mailMessage.BodyEncoding = System.Text.Encoding.UTF8;
- mailMessage.Priority = System.Net.Mail.MailPriority.Normal;
+ mailMessage.BodyEncoding = Encoding.UTF8;
+ mailMessage.Priority = MailPriority.Normal;
if (mailMessage != null)
{
smtpClient = new SmtpClient();
if (!credentials)
{
- smtpClient.Credentials = new System.Net.NetworkCredential(username, password);
+ smtpClient.Credentials = new System.Net.NetworkCredential("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
}
- smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
- smtpClient.Host = server;
- smtpClient.Port = port;
- smtpClient.EnableSsl = enablessl;
+ smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
+ smtpClient.Host = "smtp.163.com";
+ smtpClient.Port = 25;
+ smtpClient.EnableSsl = false;
//smtpClient.Send(mailMessage);
//smtpClient.SendAsync(mailMessage, null);
@@ -122,14 +127,14 @@ namespace CK.SCP.Common
smtpClient.UseDefaultCredentials = false;
//指定邮箱账号和密码,需要注意的是,这个密码是你在QQ邮箱设置里开启服务的时候给你的那个授权码
- System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential(username, password);
+ System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
smtpClient.Credentials = networkCredential;
//发送邮件
smtpClient.Send(mailMessage);
}
- catch (System.Net.Mail.SmtpException ex)
+ catch (Exception ex)
{
throw ex;
}
@@ -218,6 +223,55 @@ namespace CK.SCP.Common
}
}
+ ///
+ /// 材料
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void BuildOrderMessage(List toAddressList, string subject, string body, string model)
+ {
+ _message = new MimeMessage();
+
+ _message.Sender = new MailboxAddress("faway_cyjdd@163.com", "faway_cyjdd@163.com");
+ _message.From.Add(new MailboxAddress("faway_cyjdd@163.com", "faway_cyjdd@163.com"));
+ _message.Subject = subject;
+ _message.Body = new TextPart(TextFormat.Html) { Text = body };
+
+ foreach (var emailAddress in toAddressList)
+ {
+ if (model == "BCC")//抄送模式(抄送模式只发送一个邮件,避免大量发重复邮件)
+ {
+ _message.Bcc.Add(new MailboxAddress(emailAddress.Name, emailAddress.Address));
+ }
+ else
+ {
+ _message.To.Add(new MailboxAddress(emailAddress.Name, emailAddress.Address));
+ }
+
+ }
+ }
+ ///
+ /// 材料
+ ///
+ public void SendOrder()
+ {
+ try
+ {
+ _client.Connect("smtp.163.com", 25, _secureSocketOptions);
+ _client.Authenticate("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
+ _client.Send(_message);
+ _client.Disconnect(true);
+ Console.WriteLine("MailKit Send Success:" + _message.To.Mailboxes.First());
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.Message);
+ Console.WriteLine();
+ throw ex;
+ }
+ }
public async Task SendAsync()
diff --git a/Controller/SCP_MPO_CONTROLLER.cs b/Controller/SCP_MPO_CONTROLLER.cs
index e4417df..3b6eaa0 100644
--- a/Controller/SCP_MPO_CONTROLLER.cs
+++ b/Controller/SCP_MPO_CONTROLLER.cs
@@ -185,7 +185,7 @@ namespace CK.SCP.Controller
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
- return db.V_TB_MPO_DETAIL.Where(p => p_lst.Contains(p.PurdocNO) && p.Ctype != "D").ToList();
+ return db.V_TB_MPO_DETAIL.Where(p => p_lst.Contains(p.PurdocNO)).ToList();
}
}
@@ -497,6 +497,20 @@ namespace CK.SCP.Controller
{
MATERIALORDERS = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == PurdocNO).ToList();
}
+ if (MATERIALORDERS.Count() > 0)
+ {
+ MATERIALORDERS.ForEach(q =>
+ {
+ if (q.Ctype == "D")
+ {
+ q.CType_DESC = "是";
+ }
+ else
+ {
+ q.CType_DESC = "否";
+ }
+ });
+ }
return MATERIALORDERS;
}
@@ -547,8 +561,12 @@ namespace CK.SCP.Controller
_detail.ITEMDELIVERYDATE = p.ItemDeliveryDate.ToString("yyyy-MM-dd");
_detail.GLACCTNODES = p.Glaccnum;
_detail.COSTCENTERDES = p.CostCenterDes;
+ _detail.CType_DESC = p.CType_DESC;
lsDetail.Add(_detail);
- SUM += p.NetValue;
+ if (p.Ctype != "D")
+ {
+ SUM += p.NetValue;
+ }
});
print.Total = SUM.ToString("F6");
var dt = ConvertHelper.ToDataTable(new List { print });
diff --git a/Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs b/Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs
index c88faf4..22d14c5 100644
--- a/Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs
+++ b/Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs
@@ -57,6 +57,7 @@ namespace CK.SCP.Models.ScpEntity
public string StoreLocation { get; set; }
[DisplayName("ʱ")]
public string UpdateTime { get; set; }
-
+ [NotMapped]
+ public string CType_DESC { get; set; }
}
}
diff --git a/Models/ScpEntity/V_MPO_PRINT.cs b/Models/ScpEntity/V_MPO_PRINT.cs
index 0a16aaa..8dfc6fd 100644
--- a/Models/ScpEntity/V_MPO_PRINT.cs
+++ b/Models/ScpEntity/V_MPO_PRINT.cs
@@ -33,6 +33,7 @@
public string ITEMDELIVERYDATE { get; set; }
public string GLACCTNODES { get; set; }
public string COSTCENTERDES { get; set; }
+ public string CType_DESC { get; set; }
}
}
diff --git a/SCP/SCP.csproj b/SCP/SCP.csproj
index e9cbc57..6d2a8d1 100644
--- a/SCP/SCP.csproj
+++ b/SCP/SCP.csproj
@@ -2958,11 +2958,13 @@
+
+
@@ -2986,6 +2988,8 @@
+
+
@@ -5363,6 +5367,13 @@
SCP_INVOICE_EDIT.aspx
+
+ SCP_MPO_DETAIL.aspx
+ ASPXCodeBehind
+
+
+ SCP_MPO_DETAIL.aspx
+
SCP_PART_LIFE.aspx
ASPXCodeBehind
@@ -5398,6 +5409,13 @@
SCP_ASN_DETAIL_View.aspx
+
+ SCP_PO_MATERIAL.aspx
+ ASPXCodeBehind
+
+
+ SCP_PO_MATERIAL.aspx
+
SCP_PO_PLAN_EXTEND.aspx
@@ -5558,6 +5576,20 @@
SCP_FORECAST.aspx
+
+ SCP_MPO_DETAIL.aspx
+ ASPXCodeBehind
+
+
+ SCP_MPO_DETAIL.aspx
+
+
+ SCP_PO_MATERIAL.aspx
+ ASPXCodeBehind
+
+
+ SCP_PO_MATERIAL.aspx
+
SCP_PO_PLAN_EXTEND_VIEW.aspx
ASPXCodeBehind
diff --git a/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx
new file mode 100644
index 0000000..48795b0
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx
@@ -0,0 +1,71 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_MPO_DETAIL" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.cs b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.cs
new file mode 100644
index 0000000..de5d5df
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Controller;
+using FineUI;
+using CK.SCP.Models.Enums;
+
+namespace SCP.Views.PlanData
+{
+ public partial class SCP_MPO_DETAIL : PageBase
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ if (!string.IsNullOrEmpty(Request["PurdocNO"]))
+ {
+ BindDetail();
+ }
+ else
+ {
+ Alert.Show("请选择数据后再查看明细!");
+ return;
+ }
+ }
+ }
+
+ public void SearchV_TB_PO_DETAIL(Action> p_action)
+ {
+ V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL();
+ string purdocnolist =Request["PurdocNO"];
+ _entity.purdocnolist = purdocnolist.Split(',').ToList();
+ SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> {
+ if (_ret.State == ReturnStatus.Succeed)
+ {
+ p_action(_ret.Result);
+ }
+ });
+ }
+
+
+ public void BindDetail()
+ {
+ SearchV_TB_PO_DETAIL((ret)=>{
+ this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count();
+ var list = SortAndPage(ret, Grid_V_TB_MPO_DETAIL);
+ Grid_V_TB_MPO_DETAIL.DataSource = list.ToList();
+ Grid_V_TB_MPO_DETAIL.DataBind();
+ });
+ }
+
+ protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindDetail();
+ }
+ protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
+
+ BindDetail();
+ }
+ /////
+ ///// 审批通过
+ /////
+ /////
+ /////
+ //protected void btnAccept_Click(object sender, EventArgs e)
+ //{
+ // int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
+ // List NOList = new List();
+ // //List ctylist = new List();
+ // List AcceptStatusList = new List();
+ // if (selections.Count() ==0 )
+ // {
+ // Alert.Show("您未选择数据进行审批");
+ // return;
+ // }
+ // else
+ // {
+ // foreach (int rowIndex in selections)
+ // {
+ // NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
+ // //ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
+ // var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
+ // AcceptStatusList.Add(int.Parse(app));
+ // }
+ // NOList = NOList.Distinct().ToList();
+ // //if (ctylist.Contains("D"))
+ // //{
+ // // Alert.Show("选择的数据包含已经作废的数据");
+ // // return;
+ // //}
+ // if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
+ // {
+ // Alert.Show("选择的数据包含已确认的数据");
+ // return;
+ // }
+
+ // var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
+
+ // if (ret.State == ReturnStatus.Succeed)
+ // {
+ // Alert.Show("确认成功");
+ // BindDetail();
+ // }
+ // else
+ // {
+ // Alert.Show(string.Join("
", ret.MessageList));
+ // return;
+ // }
+ // }
+
+
+ //}
+ /////
+ ///// 取消审批
+ /////
+ /////
+ /////
+ //protected void btnCancel_Click(object sender, EventArgs e)
+ //{
+ // int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
+ // List NOList = new List();
+ // List ctylist = new List();
+ // List AcceptStatusList = new List();
+ // if (selections.Count() == 0)
+ // {
+ // Alert.Show("您未选择数据进行取消审批");
+ // return;
+ // }
+ // else
+ // {
+ // foreach (int rowIndex in selections)
+ // {
+ // NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
+ // ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
+ // AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
+ // }
+ // NOList = NOList.Distinct().ToList();
+ // if (ctylist.Contains("D"))
+ // {
+ // Alert.Show("选择的数据包含已经作废的数据");
+ // return;
+ // }
+ // if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
+ // {
+ // Alert.Show("选择的数据包含新建的数据");
+ // return;
+ // }
+ // var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
+
+ // if (ret.State == ReturnStatus.Succeed)
+ // {
+ // Alert.Show("取消成功");
+ // BindDetail();
+ // }
+ // else
+ // {
+ // Alert.Show(string.Join("
", ret.MessageList));
+ // return;
+ // }
+ // }
+ //}
+
+ }
+}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.designer.cs b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.designer.cs
new file mode 100644
index 0000000..f9b1736
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.designer.cs
@@ -0,0 +1,98 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace SCP.Views.PlanData
+{
+
+
+ public partial class SCP_MPO_DETAIL
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Panel Panel1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Toolbar Toolbar2;
+
+ ///
+ /// BTN_REFRESH 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BTN_REFRESH;
+
+ ///
+ /// HF_GRID_INDEX 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.HiddenField HF_GRID_INDEX;
+
+ ///
+ /// Grid_V_TB_MPO_DETAIL 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Grid Grid_V_TB_MPO_DETAIL;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlGridPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DropDownList ddlGridPageSize;
+ }
+}
diff --git a/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx
new file mode 100644
index 0000000..88cacaf
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx
@@ -0,0 +1,119 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_PO_MATERIAL" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.cs b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.cs
new file mode 100644
index 0000000..cc5427f
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.cs
@@ -0,0 +1,246 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Controller;
+using FineUI;
+using System.Text;
+using CK.SCP.Models.Enums;
+
+namespace SCP.Views.PlanData
+{
+ public partial class SCP_PO_MATERIAL : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ LoadData();
+ }
+ }
+ public void LoadData()
+ {
+ if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
+ {
+ Alert.Show("当前用户未选择地点");
+ return;
+ }
+ BindOrder();
+ }
+
+ public void BindOrder()
+ {
+ SearchV_TB_MPO((result) =>
+ {
+ Grid_V_TB_MPO.RecordCount = result.Count();
+ var list = SortAndPage(result, Grid_V_TB_MPO);
+ Grid_V_TB_MPO.DataSource = list;
+ Grid_V_TB_MPO.DataBind();
+ });
+
+ }
+
+ public void SearchV_TB_MPO(Action> p_action)
+ {
+
+ V_TB_MPO _entity = new V_TB_MPO();
+
+ if (this.DP_StartDate.SelectedDate != null)
+ {
+ _entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate);
+ }
+ if (DP_EndDate.SelectedDate != null)
+ {
+ _entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate);
+ }
+ _entity.PurdocNO = TXT_PurdocNO.Text;
+ _entity.UserInVendIds = CurrentUser.VenderList;
+ SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) =>
+ {
+ if (_ret.State == ReturnStatus.Succeed)
+ {
+ p_action(_ret.Result);
+ }
+ });
+ }
+
+ protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ string BillNum = String.Join(",", NOList);
+ string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
+ PageContext.RegisterStartupScript(Window1.GetShowReference(url));
+ }
+ else
+ {
+ Alert.Show("请选择数据后再进行查看明细");
+ return;
+ }
+
+ }
+
+ protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
+ {
+ BindOrder();
+ }
+
+
+ ///
+ /// 导出
+ ///
+ ///
+ ///
+ protected void btnOutput_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string;
+ if (ctypesta == "D")
+ {
+ PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!"));
+ return;
+ }
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ }
+ else
+ {
+ PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
+ return;
+ }
+ NOList = NOList.Distinct().ToList();
+ var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList);
+ Dictionary cellheader = new Dictionary
+ {
+ { "PurdocNO", "订单号" },
+ { "PurchaseReqNO", "申请单号" },
+ { "ProposerDesc", "申请人" },
+ { "OASTATUS", "OA审批状态" },
+ { "MtlNO", "物料号" },
+ { "Shorttext", "物料描述" },
+ { "SizeCol", "型号规格" },
+ { "Matbrand", "材料牌号" },
+ { "Unitdes", "单位" },
+ { "Quantity", "数量" },
+ { "PRICE", "价格" },
+ { "NetValue", "金额" },
+ { "PurinfoReCord", "采购信息" },
+ { "ItemDeliveryDate", "要求到货日期" },
+ { "Glaccnum", "科目" },
+ { "CostCenterDes", "成本中心" },
+ { "StoreLocation", "存储地点" },
+ { "CType_DESC","是否已作废"},
+ };
+ string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细");
+
+ }
+
+ protected void btnDetail_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ string BillNum = String.Join(",", NOList);
+ string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
+ PageContext.RegisterStartupScript(Window1.GetShowReference(url));
+ }
+ else
+ {
+ Alert.Show("请选择数据后再进行查看明细");
+ return;
+ }
+ }
+
+ protected void btnShow_Click(object sender, EventArgs e)
+ {
+ gp1.Hidden = false;
+ }
+
+ protected void BtnClose_Click(object sender, EventArgs e)
+ {
+ gp1.Hidden = true;
+ }
+
+ protected void BtnSearch_Click(object sender, EventArgs e)
+ {
+ BindOrder();
+ }
+
+
+ protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
+
+ BindOrder();
+ }
+
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindOrder();
+ }
+
+
+
+
+ /////
+ ///// 打印
+ /////
+ /////
+ /////
+ //protected void btnPrinter_Click(object sender, EventArgs e)
+ //{
+ // int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ // string PurdocNO = "";
+ // int acc = 0;
+ // string status = "";
+ // if (selections.Count() == 0)
+ // {
+ // Alert.Show("请选择要打印的数据");
+ // return;
+ // }
+ // else if (selections.Count() > 1)
+ // {
+ // Alert.Show("只能选择一条数据进行打印");
+ // return;
+ // }
+ // else
+ // {
+ // foreach (int rowIndex in selections)
+ // {
+ // PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
+ // acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
+ // status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
+ // if (status =="D")
+ // {
+ // Alert.Show("已作废的数据不可以进行打印");
+ // return;
+ // }
+ // }
+ // if (acc == (int)GeneralMaterialOrderState.New)
+ // {
+ // Alert.Show("供应商确认过的数据才可以打印");
+ // return;
+ // }
+ // var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
+ // PageContext.RegisterStartupScript(str);
+ // }
+ //}
+ }
+}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.designer.cs b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.designer.cs
new file mode 100644
index 0000000..c93a013
--- /dev/null
+++ b/SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.designer.cs
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace SCP.Views.PlanData
+{
+
+
+ public partial class SCP_PO_MATERIAL
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Panel Panel1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Toolbar Toolbar2;
+
+ ///
+ /// Button3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button Button3;
+
+ ///
+ /// btnOutput 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnOutput;
+
+ ///
+ /// btnDetail 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnDetail;
+
+ ///
+ /// btnShow 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnShow;
+
+ ///
+ /// gp1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.GroupPanel gp1;
+
+ ///
+ /// TXT_PurdocNO 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.TextBox TXT_PurdocNO;
+
+ ///
+ /// DP_StartDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DatePicker DP_StartDate;
+
+ ///
+ /// DP_EndDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DatePicker DP_EndDate;
+
+ ///
+ /// BtnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BtnClose;
+
+ ///
+ /// BtnSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BtnSearch;
+
+ ///
+ /// Grid_V_TB_MPO 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Grid Grid_V_TB_MPO;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlGridPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DropDownList ddlGridPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Window Window1;
+ }
+}
diff --git a/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx
new file mode 100644
index 0000000..0b83770
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx
@@ -0,0 +1,75 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_MPO_DETAIL" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.cs b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.cs
new file mode 100644
index 0000000..9109699
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Controller;
+using FineUI;
+using CK.SCP.Models.Enums;
+
+namespace SCP.Views.SupplierData
+{
+ public partial class SCP_MPO_DETAIL : PageBase
+ {
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ if (!string.IsNullOrEmpty(Request["PurdocNO"]))
+ {
+ BindDetail();
+ }
+ else
+ {
+ Alert.Show("请选择数据后再查看明细!");
+ return;
+ }
+ }
+ }
+
+ public void SearchV_TB_PO_DETAIL(Action> p_action)
+ {
+ V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL();
+ string purdocnolist =Request["PurdocNO"];
+ _entity.purdocnolist = purdocnolist.Split(',').ToList();
+ SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> {
+ if (_ret.State == ReturnStatus.Succeed)
+ {
+ p_action(_ret.Result);
+ }
+ });
+ }
+
+
+ public void BindDetail()
+ {
+ SearchV_TB_PO_DETAIL((ret)=>{
+ this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count();
+ var list = SortAndPage(ret, Grid_V_TB_MPO_DETAIL);
+ Grid_V_TB_MPO_DETAIL.DataSource = list.ToList();
+ Grid_V_TB_MPO_DETAIL.DataBind();
+ });
+ }
+
+ protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
+ {
+ BindDetail();
+ }
+ protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
+
+ BindDetail();
+ }
+ ///
+ /// 审批通过
+ ///
+ ///
+ ///
+ protected void btnAccept_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
+ List NOList = new List();
+ //List ctylist = new List();
+ List AcceptStatusList = new List();
+ if (selections.Count() ==0 )
+ {
+ Alert.Show("您未选择数据进行审批");
+ return;
+ }
+ else
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
+ //ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
+ var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
+ AcceptStatusList.Add(int.Parse(app));
+ }
+ NOList = NOList.Distinct().ToList();
+ //if (ctylist.Contains("D"))
+ //{
+ // Alert.Show("选择的数据包含已经作废的数据");
+ // return;
+ //}
+ if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
+ {
+ Alert.Show("选择的数据包含已确认的数据");
+ return;
+ }
+
+ var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
+
+ if (ret.State == ReturnStatus.Succeed)
+ {
+ Alert.Show("确认成功");
+ BindDetail();
+ }
+ else
+ {
+ Alert.Show(string.Join("
", ret.MessageList));
+ return;
+ }
+ }
+
+
+ }
+ ///
+ /// 取消审批
+ ///
+ ///
+ ///
+ protected void btnCancel_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
+ List NOList = new List();
+ List ctylist = new List();
+ List AcceptStatusList = new List();
+ if (selections.Count() == 0)
+ {
+ Alert.Show("您未选择数据进行取消审批");
+ return;
+ }
+ else
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
+ ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
+ AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
+ }
+ NOList = NOList.Distinct().ToList();
+ //if (ctylist.Contains("D"))
+ //{
+ // Alert.Show("选择的数据包含已经作废的数据");
+ // return;
+ //}
+ if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
+ {
+ Alert.Show("选择的数据包含新建的数据");
+ return;
+ }
+ var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
+
+ if (ret.State == ReturnStatus.Succeed)
+ {
+ Alert.Show("取消成功");
+ BindDetail();
+ }
+ else
+ {
+ Alert.Show(string.Join("
", ret.MessageList));
+ return;
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.designer.cs b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.designer.cs
new file mode 100644
index 0000000..3277c3c
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.designer.cs
@@ -0,0 +1,116 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace SCP.Views.SupplierData
+{
+
+
+ public partial class SCP_MPO_DETAIL
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Panel Panel1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Toolbar Toolbar2;
+
+ ///
+ /// BTN_REFRESH 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BTN_REFRESH;
+
+ ///
+ /// btnAccept 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnAccept;
+
+ ///
+ /// btnCancel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnCancel;
+
+ ///
+ /// HF_GRID_INDEX 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.HiddenField HF_GRID_INDEX;
+
+ ///
+ /// Grid_V_TB_MPO_DETAIL 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Grid Grid_V_TB_MPO_DETAIL;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlGridPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DropDownList ddlGridPageSize;
+ }
+}
diff --git a/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx
new file mode 100644
index 0000000..c9ec919
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx
@@ -0,0 +1,119 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_PO_MATERIAL" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.cs b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.cs
new file mode 100644
index 0000000..38f8090
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.cs
@@ -0,0 +1,246 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+using CK.SCP.Models.ScpEntity;
+using CK.SCP.Controller;
+using FineUI;
+using System.Text;
+using CK.SCP.Models.Enums;
+
+namespace SCP.Views.SupplierData
+{
+ public partial class SCP_PO_MATERIAL : PageBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ LoadData();
+ }
+ }
+ public void LoadData()
+ {
+ if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
+ {
+ Alert.Show("当前用户未选择地点");
+ return;
+ }
+ BindOrder();
+ }
+
+ public void BindOrder()
+ {
+ SearchV_TB_MPO((result) =>
+ {
+ Grid_V_TB_MPO.RecordCount = result.Count();
+ var list = SortAndPage(result, Grid_V_TB_MPO);
+ Grid_V_TB_MPO.DataSource = list;
+ Grid_V_TB_MPO.DataBind();
+ });
+
+ }
+
+ public void SearchV_TB_MPO(Action> p_action)
+ {
+
+ V_TB_MPO _entity = new V_TB_MPO();
+
+ if (this.DP_StartDate.SelectedDate != null)
+ {
+ _entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate);
+ }
+ if (DP_EndDate.SelectedDate != null)
+ {
+ _entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate);
+ }
+ _entity.PurdocNO = TXT_PurdocNO.Text;
+ _entity.UserInVendIds = CurrentUser.VenderList;
+ SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) =>
+ {
+ if (_ret.State == ReturnStatus.Succeed)
+ {
+ p_action(_ret.Result);
+ }
+ });
+ }
+
+ protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ string BillNum = String.Join(",", NOList);
+ string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
+ PageContext.RegisterStartupScript(Window1.GetShowReference(url));
+ }
+ else
+ {
+ Alert.Show("请选择数据后再进行查看明细");
+ return;
+ }
+
+ }
+
+ protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
+ {
+ BindOrder();
+ }
+
+
+ ///
+ /// 导出
+ ///
+ ///
+ ///
+ protected void btnOutput_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string;
+ if (ctypesta == "D")
+ {
+ PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!"));
+ return;
+ }
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ }
+ else
+ {
+ PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
+ return;
+ }
+ NOList = NOList.Distinct().ToList();
+ var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList);
+ Dictionary cellheader = new Dictionary
+ {
+ { "PurdocNO", "订单号" },
+ { "PurchaseReqNO", "申请单号" },
+ { "ProposerDesc", "申请人" },
+ { "OASTATUS", "OA审批状态" },
+ { "MtlNO", "物料号" },
+ { "Shorttext", "物料描述" },
+ { "SizeCol", "型号规格" },
+ { "Matbrand", "材料牌号" },
+ { "Unitdes", "单位" },
+ { "Quantity", "数量" },
+ { "PRICE", "价格" },
+ { "NetValue", "金额" },
+ { "PurinfoReCord", "采购信息" },
+ { "ItemDeliveryDate", "要求到货日期" },
+ { "Glaccnum", "科目" },
+ { "CostCenterDes", "成本中心" },
+ { "StoreLocation", "存储地点" },
+ { "CType_DESC","是否已作废"},
+ };
+ string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细");
+
+ }
+
+ protected void btnDetail_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ List NOList = new List();
+ if (selections.Count() > 0)
+ {
+ foreach (int rowIndex in selections)
+ {
+ NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
+ }
+ string BillNum = String.Join(",", NOList);
+ string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
+ PageContext.RegisterStartupScript(Window1.GetShowReference(url));
+ }
+ else
+ {
+ Alert.Show("请选择数据后再进行查看明细");
+ return;
+ }
+ }
+
+ protected void btnShow_Click(object sender, EventArgs e)
+ {
+ gp1.Hidden = false;
+ }
+
+ protected void BtnClose_Click(object sender, EventArgs e)
+ {
+ gp1.Hidden = true;
+ }
+
+ protected void BtnSearch_Click(object sender, EventArgs e)
+ {
+ BindOrder();
+ }
+
+
+ protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
+
+ BindOrder();
+ }
+
+ protected void Window1_Close(object sender, WindowCloseEventArgs e)
+ {
+ BindOrder();
+ }
+
+
+
+
+ ///
+ /// 打印
+ ///
+ ///
+ ///
+ protected void btnPrinter_Click(object sender, EventArgs e)
+ {
+ int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
+ string PurdocNO = "";
+ int acc = 0;
+ string status = "";
+ if (selections.Count() == 0)
+ {
+ Alert.Show("请选择要打印的数据");
+ return;
+ }
+ else if (selections.Count() > 1)
+ {
+ Alert.Show("只能选择一条数据进行打印");
+ return;
+ }
+ else
+ {
+ foreach (int rowIndex in selections)
+ {
+ PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
+ acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
+ status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
+ if (status =="D")
+ {
+ Alert.Show("已作废的数据不可以进行打印");
+ return;
+ }
+ }
+ if (acc == (int)GeneralMaterialOrderState.New)
+ {
+ Alert.Show("供应商确认过的数据才可以打印");
+ return;
+ }
+ var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
+ PageContext.RegisterStartupScript(str);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.designer.cs b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.designer.cs
new file mode 100644
index 0000000..0785fea
--- /dev/null
+++ b/SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.designer.cs
@@ -0,0 +1,188 @@
+//------------------------------------------------------------------------------
+// <自动生成>
+// 此代码由工具生成。
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+// 自动生成>
+//------------------------------------------------------------------------------
+
+namespace SCP.Views.SupplierData
+{
+
+
+ public partial class SCP_PO_MATERIAL
+ {
+
+ ///
+ /// form1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// Panel1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Panel Panel1;
+
+ ///
+ /// Toolbar2 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Toolbar Toolbar2;
+
+ ///
+ /// Button3 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button Button3;
+
+ ///
+ /// btnOutput 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnOutput;
+
+ ///
+ /// btnDetail 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnDetail;
+
+ ///
+ /// btnShow 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnShow;
+
+ ///
+ /// btnPrinter 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button btnPrinter;
+
+ ///
+ /// gp1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.GroupPanel gp1;
+
+ ///
+ /// TXT_PurdocNO 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.TextBox TXT_PurdocNO;
+
+ ///
+ /// DP_StartDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DatePicker DP_StartDate;
+
+ ///
+ /// DP_EndDate 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DatePicker DP_EndDate;
+
+ ///
+ /// BtnClose 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BtnClose;
+
+ ///
+ /// BtnSearch 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Button BtnSearch;
+
+ ///
+ /// Grid_V_TB_MPO 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Grid Grid_V_TB_MPO;
+
+ ///
+ /// ToolbarSeparator1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
+
+ ///
+ /// ToolbarText1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.ToolbarText ToolbarText1;
+
+ ///
+ /// ddlGridPageSize 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.DropDownList ddlGridPageSize;
+
+ ///
+ /// Window1 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUI.Window Window1;
+ }
+}
diff --git a/SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs b/SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs
index 828a80f..a2730d9 100644
--- a/SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs
+++ b/SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs
@@ -77,7 +77,7 @@ namespace SCP.Views.富维冲压件
{
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
List NOList = new List();
- List ctylist = new List();
+ //List ctylist = new List();
List AcceptStatusList = new List();
if (selections.Count() ==0 )
{
@@ -89,16 +89,16 @@ namespace SCP.Views.富维冲压件
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
- ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
+ //ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
AcceptStatusList.Add(int.Parse(app));
}
NOList = NOList.Distinct().ToList();
- if (ctylist.Contains("D"))
- {
- Alert.Show("选择的数据包含已经作废的数据");
- return;
- }
+ //if (ctylist.Contains("D"))
+ //{
+ // Alert.Show("选择的数据包含已经作废的数据");
+ // return;
+ //}
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
{
Alert.Show("选择的数据包含已确认的数据");
diff --git a/SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs b/SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs
index f00c919..339bf9c 100644
--- a/SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs
+++ b/SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs
@@ -212,6 +212,7 @@ namespace SCP.Views.富维冲压件
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
string PurdocNO = "";
int acc = 0;
+ string status = "";
if (selections.Count() == 0)
{
Alert.Show("请选择要打印的数据");
@@ -228,6 +229,12 @@ namespace SCP.Views.富维冲压件
{
PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
+ status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
+ if (status =="D")
+ {
+ Alert.Show("已作废的数据不可以进行打印");
+ return;
+ }
}
if (acc == (int)GeneralMaterialOrderState.New)
{
diff --git a/UniApiGroup/Config/DurationConfig.cs b/UniApiGroup/Config/DurationConfig.cs
index 029334c..c473f85 100644
--- a/UniApiGroup/Config/DurationConfig.cs
+++ b/UniApiGroup/Config/DurationConfig.cs
@@ -12,6 +12,6 @@
public int CqBmptMES接口 { get; set; } = 300;
public int CqBmptEdiPut接口 { get; set; } = 600;
public int CqBmptEdiGet接口 { get; set; } = 600;
- public int 材料订单邮件发送 { get; set; } = 10;
+ public int 材料订单邮件发送 { get; set; } = 1800;
}
}
\ No newline at end of file
diff --git a/UniApiGroup/Controller/MailController.cs b/UniApiGroup/Controller/MailController.cs
index fcc6ecc..31c8897 100644
--- a/UniApiGroup/Controller/MailController.cs
+++ b/UniApiGroup/Controller/MailController.cs
@@ -189,9 +189,8 @@ namespace CK.SCP.UniApi.Controller
{
foreach (var item in emailList)
{
- MyWebSmtpMail webmail = new MyWebSmtpMail();
- webmail.SendOrdersEmail(item.EmailAddress, item.EmailString, "材料订单提醒");
- Console.WriteLine($"发送邮件:供应商编码为{ item.EmailToUser}");
+ MailManager.SendMailOrders(item.EmailAddress, item.EmailString, "材料订单提醒");
+ Console.WriteLine($"发送邮件:供应商为{ item.EmailToUser}");
}
emailList.ForEach(q =>
{
@@ -204,10 +203,14 @@ namespace CK.SCP.UniApi.Controller
{
emailList.ForEach(q =>
{
- q.EmailSendState = -1;
+ q.EmailSendState = 2;
q.EmailSendFailReason = ex.Message;
});
Console.WriteLine(ex.Message);
+ if (ex.InnerException != null)
+ {
+ Console.WriteLine(ex.InnerException.Message);
+ }
SDB.TS_Email.AddOrUpdate(q => q.UID, emailList.ToArray());
SDB.SaveChanges();
}
diff --git a/UniApiGroup/Controller/OdbcApiQadController.cs b/UniApiGroup/Controller/OdbcApiQadController.cs
index 3d6545b..4b22c26 100644
--- a/UniApiGroup/Controller/OdbcApiQadController.cs
+++ b/UniApiGroup/Controller/OdbcApiQadController.cs
@@ -29,6 +29,7 @@ using static CK.SCP.UniApi.Controller.vendidpartcontroller;
using static CK.SCP.UniApi.Controller.PoBillNumcontroller;
using static CK.SCP.UniApi.Controller.NetPriceController;
using System.Xml.Linq;
+using System.Security.Principal;
namespace CK.SCP.GrupUniApi.Controller
{
@@ -1652,25 +1653,73 @@ namespace CK.SCP.GrupUniApi.Controller
var Dlist = list.Where(p => p.CTYPE == "D");
var Ilist = list.Where(p => p.CTYPE != "D").GroupBy(p => p.PURDOCNO).Distinct();
var _Dlist = Dlist.GroupBy(p => p.PURDOCNO).Distinct();
+ string wwadres= sdb.TA_CONFIG.FirstOrDefault(q => q.ParamName == "ӿʼַ").ParamValue;
foreach (var DeleteItem in _Dlist)
{
var _list = DeleteItem.ToList();
var _entity = _list.First();
//
- var MATERIALORDERList = sdb.TB_MATERIALORDERS.Where(q => q.PurdocNO == _entity.PURDOCNO).ToList();
- MATERIALORDERList.ForEach(p =>
+ //var MATERIALORDERList = sdb.TB_MATERIALORDERS.Where(q => q.PurdocNO == _entity.PURDOCNO).ToList();
+ //MATERIALORDERList.ForEach(p =>
+ //{
+ // p.Ctype = "D" ;
+ // p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
+ // PoList.Add(p);
+ //});
+ foreach (var Ditem in _list)
{
- p.Ctype = "D" ;
- p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
- PoList.Add(p);
- });
- var MATERIALORDERDETAILList = sdb.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == _entity.PURDOCNO).ToList();
- MATERIALORDERDETAILList.ForEach(p =>
+ var MATERIALORDERDETAILList = sdb.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == Ditem.PURDOCNO && q.PurchaseReqNO == Ditem.PURCHASEREQNO).ToList();
+ MATERIALORDERDETAILList.ForEach(p =>
+ {
+ p.Ctype = "D";
+ p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
+ PoDetailList.Add(p);
+ });
+ var valueType = MATERIALORDERDETAILList.Select(q => q.Ctype).Distinct().ToList();
+ var type = valueType.FirstOrDefault();
+ if (valueType.Count() == 1 && type =="D")
+ {
+ var MATERIALORDERList = sdb.TB_MATERIALORDERS.Where(q => q.PurdocNO == Ditem.PURDOCNO).ToList();
+ MATERIALORDERList.ForEach(p =>
+ {
+ p.Ctype = "D";
+ PoList.Add(p);
+ });
+
+ #region
+ // ӷʼ
+ TS_Email email = new TS_Email();
+ email.EmailToUser = Ditem.VENDORDESC;
+ string mailbody = "";
+ mailbody += " Ӧ
";
+ mailbody += "ã
";
+ mailbody += "һ϶ " + Ditem.PURDOCNO + " ϵIJ¼ӦЭͬվж鿴
";
+ mailbody += "¼˺ţ" + Ditem.VENDORNO + "@W21" + "
";
+ mailbody += "¼ַ" + wwadres + "
";
+ mailbody += "
ڣ" + DateTime.Now;
+ email.EmailString = mailbody;
+ var user = authdb.Users.FirstOrDefault(q => q.Name.Contains(Ditem.VENDORNO));
+ if (user == null)
+ {
+ email.EmailSendState = 2;
+ email.EmailSendFailReason = "ùӦδά";
+ }
+ else
+ {
+ email.EmailAddress = user.Email;
+ email.EmailSendState = 0;
+ }
+ emails.Add(email);
+ #endregion
+ }
+ }
+
+ var maxlist1 = new xxDiMaxes_Po
{
- p.Ctype = "D";
- p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
- PoDetailList.Add(p);
- });
+ Di_Batchno = _entity.DI_BATCHNO,
+
+ };
+ xxMaxbath.Add(maxlist1);
}
foreach (var InsertItem in Ilist)
@@ -1718,16 +1767,19 @@ namespace CK.SCP.GrupUniApi.Controller
InPoDetailList.Add(orderdetail);
}
#endregion
+ #region
// ӷʼ
TS_Email email = new TS_Email();
email.EmailToUser = inentity.VENDORDESC;
string mailbody = "";
- mailbody += "ĹӦ
";
+ mailbody += " Ӧ
";
mailbody += "ã
";
mailbody += "һ϶ " + inentity.PURDOCNO + " Ѿ뵽ӦЭͬվ鿴
";
+ mailbody += "¼˺ţ" + inentity.VENDORNO + "@W21" + "
";
+ mailbody += "¼ַ" + wwadres+ "
";
mailbody += "
ڣ" + DateTime.Now;
email.EmailString = mailbody;
- var user = authdb.Users.FirstOrDefault(q => inentity.VENDORNO.Contains(q.Name));
+ var user = authdb.Users.FirstOrDefault(q => q.Name.Contains(inentity.VENDORNO));
if (user == null)
{
email.EmailSendState = 2;
@@ -1739,11 +1791,19 @@ namespace CK.SCP.GrupUniApi.Controller
email.EmailSendState = 0;
}
emails.Add(email);
+ #endregion
+ var maxlist1 = new xxDiMaxes_Po
+ {
+ Di_Batchno = inentity.DI_BATCHNO,
+
+ };
+ xxMaxbath.Add(maxlist1);
}
sdb.BulkInsert(emails);// һ϶ʼ
sdb.BulkInsert(InPoList);// Ӳ
sdb.BulkInsert(InPoDetailList);// ϸ
item.Remark = ((int)UniApiState.ɹ).ToString();
+ item.MaxdibatchNO = item.MaxdibatchNO + list.Count;
idb.xxDiMaxes_Po.AddOrUpdate(xxMaxbath.ToArray());
// uidи
sdb.TB_MATERIALORDERS.AddOrUpdate(q=> q.UID, PoList.ToArray());
diff --git a/UniApiGroup/Controller/PoBillNumcontroller.cs b/UniApiGroup/Controller/PoBillNumcontroller.cs
index 486cdf4..3bddc92 100644
--- a/UniApiGroup/Controller/PoBillNumcontroller.cs
+++ b/UniApiGroup/Controller/PoBillNumcontroller.cs
@@ -114,7 +114,7 @@ namespace CK.SCP.UniApi.Controller
public string MATBRAND { get; set; }
public DateTime? DI_UPDATETIME { get; set; }
public string PURORGDESC { get; set; }
- public string DI_BATCHNO { get; set; }
+ public int DI_BATCHNO { get; set; }
public string VOLUMEWEIGHT { get; set; }
public string CTYPE { get; set; }
public DateTime? DINDATE { get; set; }