using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.BLL.EC;
|
using CY.Model;
|
using CY.BLL.Sys;
|
using CY.Infrastructure.Common;
|
using CY.Infrastructure.Query;
|
using CY.BLL;
|
using CY.Model.Inquiry;
|
using CY.BLL.OA;
|
using CY.SQLDAL;
|
|
namespace CY.WebForm.Pages.business
|
{
|
//吴辉
|
//合版施工单
|
public partial class AgSpecialOrderEdit : BasePage
|
{
|
EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null;
|
EC_MemberDictionaryBLL bll_EC_MemberDictionaryBLL = null;
|
OA_InventoryBLL bll_OA_InventoryBLL = null;
|
OA_OutOfStorageBLL bll_OA_OutOfStorageBLL = null;
|
EC_CuttingPaperSpecBLL bll_EC_CuttingPaperSpecBLL = null;
|
public string PressesDeskHtml = "";
|
public string SpecificationsSheetHtml = "";
|
public string selFilmSpecHtml = "";
|
public string selCTPSpecHtml = "";
|
public string SelPaperSpecHtml = "";
|
public string selPaperNameHtml = "";
|
public string selCuttingPaperSpecHtml = "";
|
public string keyid ="";
|
public string printCount = "";
|
public string[] Width = new string[7];
|
public string[] Lenth = new string[7];
|
public string xialapr = "";
|
//初始化
|
public AgSpecialOrderEdit()
|
{
|
bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL();
|
bll_EC_MemberDictionaryBLL = new EC_MemberDictionaryBLL();
|
bll_OA_InventoryBLL = new OA_InventoryBLL();
|
bll_OA_OutOfStorageBLL = new OA_OutOfStorageBLL();
|
bll_EC_CuttingPaperSpecBLL = new EC_CuttingPaperSpecBLL();
|
}
|
|
//页面加载
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
InitData();
|
}
|
}
|
|
/// <summary>
|
/// 加载合版施工单信息
|
/// </summary>
|
private bool InitData()
|
{
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "印刷机台") as List<EC_MemberDictionary>;
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList_o = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "板材规格") as List<EC_MemberDictionary>;
|
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList_paperName = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "自带纸名称") as List<EC_MemberDictionary>;
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList_paperSpec = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "自带纸规格") as List<EC_MemberDictionary>;
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList_filmSpec = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "自带菲林规格") as List<EC_MemberDictionary>;
|
List<EC_MemberDictionary> m_EC_MemberDictionaryList_ctpSpec = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "自带CTP规格") as List<EC_MemberDictionary>;
|
|
Pagination pa = new Pagination();
|
pa.PageSize = 15;
|
pa.PageIndex = 1;
|
List<EC_CuttingPaperSpec> m_EC_CuttingPaperSpec = bll_EC_CuttingPaperSpecBLL.SelectModelPage(pa, CurrentUser.MemberId) as List<EC_CuttingPaperSpec>;
|
|
|
|
if (m_EC_MemberDictionaryList != null && m_EC_MemberDictionaryList.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList)
|
{
|
PressesDeskHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
var sss = bll_EC_MemberDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "版材规格");
|
foreach (var eC_MemberDictionary in sss)
|
{
|
xialapr += " <div class=\"xialaprp\">" + eC_MemberDictionary.ParName + "</div>";
|
|
}
|
if (m_EC_MemberDictionaryList_o != null && m_EC_MemberDictionaryList_o.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList_o)
|
{
|
SpecificationsSheetHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
|
if (m_EC_MemberDictionaryList_paperName != null && m_EC_MemberDictionaryList_paperName.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList_paperName)
|
{
|
selPaperNameHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
|
if (m_EC_MemberDictionaryList_paperSpec != null && m_EC_MemberDictionaryList_paperSpec.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList_paperSpec)
|
{
|
SelPaperSpecHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
|
if (m_EC_MemberDictionaryList_filmSpec != null && m_EC_MemberDictionaryList_filmSpec.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList_filmSpec)
|
{
|
selFilmSpecHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
|
if (m_EC_MemberDictionaryList_ctpSpec != null && m_EC_MemberDictionaryList_ctpSpec.Count > 0)
|
{
|
foreach (var item in m_EC_MemberDictionaryList_ctpSpec)
|
{
|
selCTPSpecHtml += "<option value='" + item.ParName + "'>" + item.ParName + "</option>";
|
}
|
}
|
|
if (m_EC_CuttingPaperSpec != null && m_EC_CuttingPaperSpec.Count > 0)
|
{
|
foreach (var item in m_EC_CuttingPaperSpec)
|
{
|
selCuttingPaperSpecHtml += "<option value='" + item.SpecName + "'>" + item.SpecName + "</option>";
|
}
|
}
|
|
#region 获取订单及其相关
|
|
EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
|
string orderIdStr = Request["orderid"];
|
if (string.IsNullOrEmpty(orderIdStr))
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
|
return false;
|
}
|
int? orderId = MyConvert.ConvertToInt32(orderIdStr);
|
if (!orderId.HasValue)
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
|
return false;
|
}
|
|
EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.Value);
|
if (null == _eC_OrderBasic)
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
|
return false;
|
}
|
EC_AcceptWayByOrderBLL _eC_AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL();
|
EC_AcceptWayByOrder _eC_AcceptWayByOrder = _eC_AcceptWayByOrderBLL.GetModelByTargetId(orderId.Value);
|
if (null == _eC_AcceptWayByOrder)
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
|
return false;
|
}
|
|
EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
|
EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId.Value);
|
InquiryCommonModel _inquiryCommonModel = null;
|
if (null == _eC_OrderPrintParameter)
|
{
|
_inquiryCommonModel = new InquiryCommonModel();
|
}
|
else
|
{
|
_inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
|
}
|
|
#endregion
|
|
|
EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(orderId);
|
if (m_EC_SpecialOrders == null)
|
m_EC_SpecialOrders = new EC_SpecialOrders();
|
|
keyid = m_EC_SpecialOrders.Keyid.ToString2();
|
|
OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
|
Sys_DictionaryBLL sys_DictionaryBLL = new Sys_DictionaryBLL();
|
_inquiryCommonModel.DeliveryModeName = sys_DictionaryBLL.GetModelByKeyid(_eC_AcceptWayByOrder.AcceptTypeId);
|
_inquiryCommonModel.BillModeName = _eC_AcceptWayByOrder.InvoiceDemand;
|
|
this.spanSpecialNum.InnerText = string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_OrderNum) ? bll_EC_SpecialOrdersBLL.GetPSO_OrderNum(CurrentUser.MemberId) : m_EC_SpecialOrders.PSO_OrderNum;
|
this.spanSpecialExigency.InnerText = _eC_OrderBasic.OrderExtend.ExigencyCase.Name;
|
this.spanSpecialTime.InnerText = m_EC_SpecialOrders.PSO_OrderTime == null ? DateTime.Now.ToString("yyyy-MM-dd HH:mm") : m_EC_SpecialOrders.PSO_OrderTime.Value.ToString("yyyy-MM-dd HH:mm");
|
this.spanSpecialOprator.InnerText = string.IsNullOrEmpty(m_EC_SpecialOrders.Operator) ? CurrentUser.ShortName : m_EC_SpecialOrders.Operator;
|
this.txtPSO_Work.InnerText = m_EC_SpecialOrders.PSO_Work;
|
this.txtPSO_Remarks.InnerText = m_EC_SpecialOrders.PSO_Remarks;
|
|
this.spanOrderNum.InnerText = _eC_OrderBasic.SellerOrderId;
|
this.spanOrderType.InnerText = _eC_OrderBasic.OrderType.Name;
|
this.spanOrderTitle.InnerText = _eC_OrderBasic.DocumentName;
|
this.txtDeliveryTime.Value = _eC_OrderBasic.DeliveryTime == null ? "" : _eC_OrderBasic.DeliveryTime.Value.ToString("yyyy-MM-dd");
|
|
this.spanOrderCustormName.InnerText = _eC_OrderBasic.BuyerName;
|
this.spanOrderCustormLevel.InnerText = _eC_OrderBasic.OrderExtend.CustomerLevel.Name;
|
this.spanOrderCustormPeople.InnerText = _eC_OrderBasic.OrderExtend.Contacts;
|
this.spanOrderCustormPhone.InnerText = _eC_OrderBasic.OrderExtend.ContactPhone;
|
this.spanOrderBusinessManage.InnerText = _eC_OrderBasic.OrderExtend.BusinessManager.Name;
|
this.spanOrderCustormManage.InnerText = _eC_OrderBasic.OrderExtend.CustomerManager.Name;
|
|
this.spanOrderName.InnerText = _eC_OrderBasic.DocumentName;
|
//this.spanOrderAllMoney.InnerText = "¥" + _eC_OrderBasic.SumPrice.ToDecimal2Yen();
|
//this.spanOrderSize.InnerText = _inquiryCommonModel.PrintSizeName;
|
this.spanOrderPrintNum.InnerText = _eC_OrderBasic.OrderExtend.PrintNum.ToString2();
|
if (_eC_OrderBasic.PrintTypeId == 13)
|
{
|
this.spanOrderPrintDemand.InnerText = "印刷数量:(" + _inquiryCommonModel.PrintBoxNumber + "款,每款" + _eC_OrderBasic.OrderExtend.PrintNum + "盒);" + _inquiryCommonModel.PrintDemand;
|
}
|
else
|
{
|
this.spanOrderPrintDemand.InnerText = "印刷数量:(" + _eC_OrderBasic.OrderExtend.PrintNum + ");" + _inquiryCommonModel.PrintDemand;
|
}
|
this.spanOrderAfterWorksDemand.InnerText = _inquiryCommonModel.AfterWorksDemand;
|
this.spanOrderDeliveryModeName.InnerText = _inquiryCommonModel.DeliveryModeName;
|
this.spanOrderBillModeName.InnerText = _inquiryCommonModel.BillModeName;
|
this.spanOrderRemarks.InnerText = _eC_OrderBasic.Remark;
|
|
printCount = _eC_OrderBasic.OrderExtend.PrintNum.ToString2();
|
|
List<EC_SpecialForums> m_EC_SpecialForumsList = bll_EC_SpecialOrdersBLL.GetEC_SpecialForumsListByKeyid(m_EC_SpecialOrders.Keyid) as List<EC_SpecialForums>;
|
if (m_EC_SpecialForumsList == null || m_EC_SpecialForumsList.Count == 0)
|
{
|
m_EC_SpecialForumsList = new List<EC_SpecialForums>();
|
EC_SpecialForums m_EC_SpecialForums = new EC_SpecialForums();
|
//m_EC_SpecialForums.PSF_Note = _inquiryCommonModel.AfterWorksDemand;
|
m_EC_SpecialForums.PSF_Forumsid = 1;
|
m_EC_SpecialForumsList.Add(m_EC_SpecialForums);
|
this.txtPSO_Work.InnerText = _inquiryCommonModel.AfterWorksDemand;
|
}
|
this.RepClientList.DataSource = m_EC_SpecialForumsList;
|
this.RepClientList.DataBind();
|
|
//获取开料尺寸
|
EC_CuttingPaperSpec model = new EC_CuttingPaperSpec();
|
//model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "小全开");
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "小全开");
|
if (model != null)
|
{
|
Width[0] = model.Width;
|
Lenth[0] = model.Length;
|
}
|
else
|
{
|
Width[0] = "";
|
Lenth[0] = "";
|
}
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "2开");
|
|
if (model != null)
|
{
|
Width[1] = model.Width;
|
Lenth[1] = model.Length;
|
}
|
else
|
{
|
Width[1] = "";
|
Lenth[1] = "";
|
}
|
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "3开");
|
if (model != null)
|
{
|
Width[2] = model.Width;
|
Lenth[2] = model.Length;
|
}
|
else
|
{
|
Width[2] = "";
|
Lenth[2] = "";
|
}
|
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "4开");
|
if (model != null)
|
{
|
Width[3] = model.Width;
|
Lenth[3] = model.Length;
|
}
|
else
|
{
|
Width[3] = "";
|
Lenth[3] = "";
|
}
|
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "6开");
|
if (model != null)
|
{
|
Width[4] = model.Width;
|
Lenth[4] = model.Length;
|
}
|
else
|
{
|
Width[4] = "";
|
Lenth[4] = "";
|
}
|
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "8开");
|
if (model != null)
|
{
|
Width[5] = model.Width;
|
Lenth[5] = model.Length;
|
}
|
else
|
{
|
Width[5] = "";
|
Lenth[5] = "";
|
}
|
|
model = bll_EC_CuttingPaperSpecBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "其它");
|
if (model != null)
|
{
|
Width[6] = model.Width;
|
Lenth[6] = model.Length;
|
}
|
else
|
{
|
Width[6] = "";
|
Lenth[6] = "";
|
}
|
|
return true;
|
}
|
|
//提交事件
|
protected void btn_Submit_form(object sender, EventArgs e)
|
{
|
try
|
{
|
#region 获取值并判断值是否正确
|
|
string[] PSF_Forumsid = Request["PSF_Forumsid"].ToString2().Split(',');
|
|
if (PSF_Forumsid.Length == 0)
|
{
|
JavaScript.MessageBox("提交失败", this);
|
return;
|
}
|
|
string[] PSF_Component = Request["PSF_Component"].ToString2().Split(',');
|
string[] PSF_PNum = Request["PSF_PNum"].ToString2().Split(',');
|
string[] PSF_PressesDesk = Request["PSF_PressesDesk"].ToString2().Split(',');
|
string[] PSF_PrintedColorPositive = Request["PSF_PrintedColorPositive"].ToString2().Split(',');
|
string[] PSF_PrintedColorRear = Request["PSF_PrintedColorRear"].ToString2().Split(',');
|
string[] PSF_Typesetting = Request["PSF_Typesetting"].ToString2().Split(',');
|
string[] PSF_Typesettinghide = Request["PSF_Typesettinghide"].ToString2().Split(',');
|
string[] PSF_PrintedCount = Request["PSF_PrintedCount"].ToString2().Split(',');
|
string[] PSF_PrintedPositive = Request["PSF_PrintedPositive"].ToString2().Split(',');
|
string[] PSF_LastNum = Request["PSF_LastNum"].ToString2().Split(',');
|
//string[] PSF_SheetSource = Request["PSF_SheetSource"].ToString2().Split(',');
|
//string[] PSF_SpecificationsSheet = Request["PSF_SpecificationsSheet"].ToString2().Split(',');
|
//string[] PSF_EditionCount = Request["PSF_EditionCount"].ToString2().Split(',');
|
string[] PSF_PaperSource = Request["PSF_PaperSource"].ToString2().Split(',');
|
string[] PSF_PaperId = Request["PSF_PaperId"].ToString2().Split(',');
|
string[] PMS_PaperCount1 = Request["PMS_PaperCount1"].ToString2().Split(',');
|
string[] PSF_CTPId = Request["PSF_PaperId2"].ToString2().Split(',');
|
string[] PSF_PSId = Request["PSF_PaperId3"].ToString2().Split(',');
|
string[] PSF_PaperName = Request["PSF_PaperName"].ToString2().Split(',');
|
string[] selPaperName = Request["selPaperName"].ToString2().Split(',');
|
string[] PSF_MaterialSpecifications = Request["PSF_MaterialSpecifications"].ToString2().Split(',');
|
string[] SelPaperSpec = Request["SelPaperSpec"].ToString2().Split(',');
|
|
string[] PSF_BigPaperCount = Request["PSF_BigPaperCount"].ToString2().Split(',');
|
string[] PSF_OpenSpecifications = Request["PSF_OpenSpecifications"].ToString2().Split(',');
|
string[] PSF_OpenWidth = Request["PSF_OpenWidth"].ToString2().Split(',');
|
string[] PSF_OpenWidthName = Request["PSF_OpenWidthName"].ToString2().Split(',');
|
string[] PSF_OpenLength = Request["PSF_OpenLength"].ToString2().Split(',');
|
|
string[] selPlateType = Request["selPlateType"].ToString2().Split(',');
|
string[] CTPSpecName = Request["CTPSpecName"].ToString2().Split(',');
|
string[] selCTPSpec = Request["selCTPSpec"].ToString2().Split(',');
|
string[] selFilmSpec = Request["selFilmSpec"].ToString2().Split(',');
|
string[] CTPCount = Request["CTPCount"].ToString2().Split(',');
|
string[] PSF_PSBan = Request["PSF_PSBan"].ToString2().Split(',');
|
string[] PSCount = Request["PSCount"].ToString2().Split(',');
|
|
string[] PSF_Note = Request["PSF_Note"].ToString2().Split(',');
|
string PSO_Work = Request["PSO_Work"].ToString2();
|
string PSO_Remarks = Request["PSO_Remarks"].ToString2();
|
|
string[] oldPSF_PaperId = Request["oldPSF_PaperId"].ToString2().Split(',');
|
string[] oldPSF_BigPaperCount = Request["oldPSF_BigPaperCount"].ToString2().Split(',');
|
|
//if (PSF_Forumsid.Length != PSF_Component.Length || PSF_Forumsid.Length != PSF_PNum.Length || PSF_Forumsid.Length != PSF_PressesDesk.Length || PSF_Forumsid.Length != PSF_PrintedColorPositive.Length || PSF_Forumsid.Length != PSF_PrintedColorRear.Length || PSF_Forumsid.Length != PSF_Typesetting.Length || PSF_Forumsid.Length != PSF_PrintedCount.Length || PSF_Forumsid.Length != PSF_PrintedPositive.Length || PSF_Forumsid.Length != PSF_LastNum.Length || PSF_Forumsid.Length != PSF_SheetSource.Length || PSF_Forumsid.Length != PSF_SpecificationsSheet.Length || PSF_Forumsid.Length != PSF_EditionCount.Length || PSF_Forumsid.Length != PSF_PaperSource.Length || PSF_Forumsid.Length != PSF_PaperId.Length || PSF_Forumsid.Length != PSF_PaperName.Length || PSF_Forumsid.Length != PSF_MaterialSpecifications.Length || PSF_Forumsid.Length != PSF_BigPaperCount.Length || PSF_Forumsid.Length != PSF_OpenSpecifications.Length || PSF_Forumsid.Length != PSF_OpenWidth.Length || PSF_Forumsid.Length != PSF_OpenLength.Length || PSF_Forumsid.Length != PSF_Note.Length)
|
//{
|
// JavaScript.MessageBox("提交失败", this);
|
// return;
|
//}
|
|
#endregion
|
|
EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
|
string orderIdStr = Request["orderid"];
|
if (string.IsNullOrEmpty(orderIdStr))
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
|
return;
|
}
|
int? orderId = MyConvert.ConvertToInt32(orderIdStr);
|
if (!orderId.HasValue)
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
|
return;
|
}
|
EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.Value);
|
if (null == _eC_OrderBasic)
|
{
|
CY.WebForm.BasePage.JavaScript.MessageBox("订单不存在!", this);
|
return;
|
}
|
_eC_OrderBasic.DeliveryTime = this.txtDeliveryTime.Value.ToDateTime2();
|
_eC_OrderBasicBLL.UpdateModel(_eC_OrderBasic);
|
|
EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(orderId);
|
if (m_EC_SpecialOrders == null || m_EC_SpecialOrders.Keyid == null)
|
m_EC_SpecialOrders = new EC_SpecialOrders();
|
|
List<EC_SpecialForums> m_EC_SpecialForumsList = new List<EC_SpecialForums>();
|
List<OA_Inventory> m_OA_InventoryList = new List<OA_Inventory>();
|
List<OA_OutOfStorage> m_OA_OutOfStorageList = new List<OA_OutOfStorage>();
|
|
for (int i = 0; i < PSF_Forumsid.Length; i++)
|
{
|
EC_SpecialForums m_EC_SpecialForums = new EC_SpecialForums();
|
m_EC_SpecialForums.PSF_Component = PSF_Component[i].ToString2().Replace(",+-+,", ",");
|
if (PSF_PNum[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_PNum = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_PNum = PSF_PNum[i].ToInt32();
|
}
|
m_EC_SpecialForums.PSF_PressesDesk = PSF_PressesDesk[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_PrintedColorPositive = PSF_PrintedColorPositive[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_PrintedColorRear = PSF_PrintedColorRear[i].ToString2().Replace(",+-+,", ",");
|
if (PSF_PressesDesk[i].IndexOf("数码") >= 0)
|
{
|
m_EC_SpecialForums.PSF_Typesetting = PSF_Typesettinghide[i].ToString2().Replace(",+-+,", ",");
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_Typesetting = PSF_Typesetting[i].ToString2().Replace(",+-+,", ",");
|
}
|
|
|
if (PSF_PrintedCount[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_PrintedCount = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_PrintedCount = PSF_PrintedCount[i].ToInt32();
|
}
|
if (PSF_PrintedPositive[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_PrintedPositive = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_PrintedPositive = PSF_PrintedPositive[i].ToInt32();
|
}
|
if (PSF_LastNum[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_LastNum = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_LastNum = PSF_LastNum[i].ToInt32();
|
}
|
m_EC_SpecialForums.PSF_PaperSource = PSF_PaperSource[i].ToString2().Replace(",+-+,", ",");
|
if (m_EC_SpecialForums.PSF_PaperSource == "来自仓库")
|
{
|
m_EC_SpecialForums.PSF_PaperName = PSF_PaperName[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_MaterialSpecifications = PSF_MaterialSpecifications[i].ToString2().Replace(",+-+,", ",");
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_PaperName = selPaperName[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_MaterialSpecifications = SelPaperSpec[i].ToString2().Replace(",+-+,", ",");
|
}
|
|
m_EC_SpecialForums.PSF_Forumsid = PSF_Forumsid[i].ToInt32();
|
//if (PSF_BigPaperCount[i].ToInt32() == null)
|
//{
|
// m_EC_SpecialForums.PSF_BigPaperCount = 0;
|
//}
|
//else
|
//{
|
// m_EC_SpecialForums.PSF_BigPaperCount = PSF_BigPaperCount[i].ToInt32();
|
//}
|
m_EC_SpecialForums.PSF_BigPaperCount = 0;
|
m_EC_SpecialForums.PSF_OpenSpecifications = PSF_OpenSpecifications[i].ToString2().Replace(",+-+,", ",");
|
if (PSF_PressesDesk[i].IndexOf("轮转")>=0)
|
{
|
if (PSF_OpenWidthName[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_OpenWidth = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_OpenWidth = PSF_OpenWidthName[i].ToInt32();
|
}
|
}
|
else
|
{
|
if (PSF_OpenWidth[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_OpenWidth = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_OpenWidth = PSF_OpenWidth[i].ToInt32();
|
}
|
}
|
|
|
if (PSF_OpenLength[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_OpenLength = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_OpenLength = PSF_OpenLength[i].ToInt32();
|
}
|
m_EC_SpecialForums.PSF_PlateSource = selPlateType[i].ToString2().Replace(",+-+,", ",");
|
if (m_EC_SpecialForums.PSF_PlateSource == "本厂CTP")
|
{
|
m_EC_SpecialForums.PSF_CTPSpecType = CTPSpecName[i].ToString2().Replace(",+-+,", ",");
|
|
if(CTPCount[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_CTPCount = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_CTPCount = CTPCount[i].ToInt32();
|
}
|
}
|
else if (m_EC_SpecialForums.PSF_PlateSource == "自带CTP")
|
{
|
m_EC_SpecialForums.PSF_CTPSpecType = selCTPSpec[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_CTPCount = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_CTPSpecType = selFilmSpec[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_CTPCount = 0;
|
}
|
m_EC_SpecialForums.PSF_FilmType = "";
|
m_EC_SpecialForums.PSF_PSSpec = PSF_PSBan[i].ToString2().Replace(",+-+,", ",");
|
if (PSCount[i].ToInt32() == null)
|
{
|
m_EC_SpecialForums.PSF_PSCount = 0;
|
}
|
else
|
{
|
m_EC_SpecialForums.PSF_PSCount = PSCount[i].ToInt32();
|
}
|
m_EC_SpecialForums.PSF_Note = PSF_Note[i].ToString2().Replace(",+-+,", ",");
|
m_EC_SpecialForums.PSF_PaperId = 0;
|
m_EC_SpecialForumsList.Add(m_EC_SpecialForums);
|
|
//int? PaperId = PSF_PaperId[i].ToInt32();
|
//int? CtpId = PSF_CTPId[i].ToInt32();
|
//int? PSId = PSF_PSId[i].ToInt32();
|
int? PaperCount = m_EC_SpecialForums.PSF_PrintedCount ?? 0;
|
int? iCTPCount = m_EC_SpecialForums.PSF_CTPCount ?? 0;
|
int? iPSCount = m_EC_SpecialForums.PSF_PSCount ?? 0;
|
|
//int? PaperCountOld = oldPSF_BigPaperCount[i].ToInt32() ?? 0;
|
|
string[] PSF_PaperIdForStore = new string[3];
|
PSF_PaperIdForStore[0] = PSF_PaperId[i].ToString2().Trim('|');
|
PSF_PaperIdForStore[1] = PSF_CTPId[i].ToString2().Trim('|');
|
PSF_PaperIdForStore[2] = PSF_PSId[i].ToString2().Trim('|');
|
if (m_EC_SpecialOrders.Keyid == null)
|
{
|
for (int j = 0; j < PSF_PaperIdForStore.Length; j++)
|
{
|
if (j == 0)
|
{
|
string[] PSF_PaperId_NEW = PSF_PaperIdForStore[0].Trim('|').Split('|');
|
string[] PMS_PaperCount1_NEW = PMS_PaperCount1[i].ToString2().Trim('|').Split('|');
|
|
foreach (var item in PSF_PaperId_NEW)
|
{
|
OA_Inventory m_OA_InventoryOld = bll_OA_InventoryBLL.GetModelByKeyid(item.ToInt32());
|
if (m_OA_InventoryOld != null && m_OA_InventoryOld.FirmId == CurrentUser.MemberId)
|
{
|
OA_OutOfStorage m_OA_OutOfStorageOld = new OA_OutOfStorage();
|
m_OA_OutOfStorageOld.FirmId = CurrentUser.MemberId;
|
m_OA_OutOfStorageOld.GoodsId = m_OA_InventoryOld.GoodsId;
|
m_OA_OutOfStorageOld.CargoSpaceId = 0;
|
m_OA_OutOfStorageOld.WarehouseId = m_OA_InventoryOld.WarehouseId;
|
m_OA_OutOfStorageOld.InfoType = "确认出库";
|
m_OA_OutOfStorageOld.SuppliersId = 0;
|
m_OA_OutOfStorageOld.Price = 0;
|
m_OA_OutOfStorageOld.Quantity = PMS_PaperCount1_NEW[Array.IndexOf(PSF_PaperId_NEW, item)].ToInt32() ?? 0;
|
m_OA_OutOfStorageOld.AllMoney = 0;
|
m_OA_OutOfStorageOld.LastUpdateTime = DateTime.Now;
|
m_OA_OutOfStorageOld.Operator = CurrentUser.ShortName;
|
m_OA_OutOfStorageOld.Remark = "";
|
m_OA_OutOfStorageOld.TanPrice = 0;
|
m_OA_OutOfStorageOld.BrandId = m_OA_InventoryOld.BrandId;
|
m_OA_OutOfStorageOld.PaperWeightId = m_OA_InventoryOld.PaperWeightId;
|
m_OA_OutOfStorageOld.SpecificationId = m_OA_InventoryOld.SpecificationId;
|
m_OA_OutOfStorageList.Add(m_OA_OutOfStorageOld);
|
}
|
}
|
}
|
else
|
{
|
OA_Inventory m_OA_Inventory = bll_OA_InventoryBLL.GetModelByKeyid(PSF_PaperIdForStore[j].ToInt32());
|
if (m_OA_Inventory != null && m_OA_Inventory.FirmId == CurrentUser.MemberId)
|
{
|
OA_OutOfStorage m_OA_OutOfStorage = new OA_OutOfStorage();
|
m_OA_OutOfStorage.FirmId = CurrentUser.MemberId;
|
m_OA_OutOfStorage.GoodsId = m_OA_Inventory.GoodsId;
|
m_OA_OutOfStorage.CargoSpaceId = 0;
|
m_OA_OutOfStorage.WarehouseId = m_OA_Inventory.WarehouseId;
|
m_OA_OutOfStorage.InfoType = "确认出库";
|
m_OA_OutOfStorage.SuppliersId = 0;
|
m_OA_OutOfStorage.Price = 0;
|
if (j == 0)
|
{
|
m_OA_OutOfStorage.Quantity = PaperCount;
|
}
|
else if (j == 1)
|
{
|
m_OA_OutOfStorage.Quantity = iCTPCount;
|
}
|
else if (j == 3)
|
{
|
m_OA_OutOfStorage.Quantity = iPSCount;
|
}
|
m_OA_OutOfStorage.AllMoney = 0;
|
m_OA_OutOfStorage.LastUpdateTime = DateTime.Now;
|
m_OA_OutOfStorage.Operator = CurrentUser.ShortName;
|
m_OA_OutOfStorage.Remark = "";
|
m_OA_OutOfStorage.TanPrice = 0;
|
m_OA_OutOfStorage.BrandId = m_OA_Inventory.BrandId;
|
m_OA_OutOfStorage.PaperWeightId = m_OA_Inventory.PaperWeightId;
|
m_OA_OutOfStorage.SpecificationId = m_OA_Inventory.SpecificationId;
|
m_OA_OutOfStorageList.Add(m_OA_OutOfStorage);
|
}
|
}
|
}
|
}
|
}
|
m_EC_SpecialOrders.LastUpdateTime = DateTime.Now;
|
m_EC_SpecialOrders.Operator = CurrentUser.ShortName;
|
m_EC_SpecialOrders.PSO_Remarks = this.txtPSO_Remarks.InnerText;
|
m_EC_SpecialOrders.PSO_Work = this.txtPSO_Work.InnerText;
|
|
if (m_EC_SpecialOrders.Keyid > 0)
|
{
|
|
if (bll_EC_SpecialOrdersBLL.UpdateSpecialForums(m_EC_SpecialOrders, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList))
|
//JavaScript.MessageBox("操作成功", this);
|
JavaScript.RefreshDIVOpener(this);
|
else
|
{
|
InitData();
|
JavaScript.MessageBox("提交失败", this);
|
}
|
}
|
else
|
{
|
m_EC_SpecialOrders.Memberid = CurrentUser.MemberId;
|
m_EC_SpecialOrders.OrderNum = 0;
|
m_EC_SpecialOrders.PO_OrderId = orderId;
|
m_EC_SpecialOrders.PO_OrderNum = _eC_OrderBasic.SellerOrderId;
|
m_EC_SpecialOrders.PSO_OrderNum = bll_EC_SpecialOrdersBLL.GetPSO_OrderNum(CurrentUser.MemberId);
|
m_EC_SpecialOrders.PSO_OrderPeople = CurrentUser.ShortName;
|
m_EC_SpecialOrders.PSO_OrderTime = DateTime.Now;
|
m_EC_SpecialOrders.IsPrint = 0;// 新增设为未打印
|
|
EC_OrderOperate m_EC_OrderOperate = new EC_OrderOperate();
|
m_EC_OrderOperate.LastUpdateTime = DateTime.Now;
|
m_EC_OrderOperate.OperateType = 3;
|
m_EC_OrderOperate.Operator = CurrentUser.ShortName;
|
m_EC_OrderOperate.OrderId = orderId;
|
m_EC_OrderOperate.Remark = "";
|
|
OA_OrderWorkListRelation m_OA_OrderWorkListRelation = new OA_OrderWorkListRelation();
|
m_OA_OrderWorkListRelation.OrderId = orderId;
|
m_OA_OrderWorkListRelation.RelationTargetId = 0;
|
m_OA_OrderWorkListRelation.RelationTypeId = 1; //专版1,合版2,后道外协3,整单外协4
|
|
//bll_EC_SpecialOrdersBLL.AddSpecialForums(m_EC_OrderOperate, m_EC_SpecialOrders, m_OA_OrderWorkListRelation, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList)
|
if (bll_EC_SpecialOrdersBLL.AddSpecialForums(m_EC_OrderOperate, m_EC_SpecialOrders, m_OA_OrderWorkListRelation, m_EC_SpecialForumsList, m_OA_InventoryList, m_OA_OutOfStorageList))
|
{
|
//JavaScript.MessageBox("操作成功", this);
|
JavaScript.RefreshDIVOpener(this);
|
}
|
else
|
{
|
InitData();
|
JavaScript.MessageBox("提交失败", this);
|
}
|
}
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("提交失败", this);
|
}
|
}
|
}
|
}
|