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.BLL;
using CY.Model.Inquiry;
using CY.BLL.OA;
namespace CY.WebForm.Pages.business
{
//吴辉
//合版施工单
public partial class AgSpecialOrderDetail : BasePage
{
EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null;
string orderIdStr = string.Empty;
//初始化
public AgSpecialOrderDetail()
{
bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL();
}
//页面加载
protected void Page_Load(object sender, EventArgs e)
{
//if (!IsPostBack)
//{
// InitData();
//}
switch (Request["Target"])
{
case "print":
int orderId = Request["orderIdStr"].ToString().ToInt32().Value;
EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(orderId);
m_EC_SpecialOrders.IsPrint = 1;
bll_EC_SpecialOrdersBLL.UpdateModel(m_EC_SpecialOrders);
break;
default:
InitData();
return;
}
}
///
/// 加载合版施工单信息
///
private bool InitData()
{
#region 获取订单及其相关
EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
orderIdStr = Request["orderid"];
this.hideOrderId.Value = 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();
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;
if (string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_Work))
{
this.txtPSO_Work_o_TR.Visible = false;
}
else
{
this.txtPSO_Work_o.InnerText = m_EC_SpecialOrders.PSO_Work;
}
if (string.IsNullOrEmpty(m_EC_SpecialOrders.PSO_Remarks))
{
this.txtPSO_Remarks_o_TR.Visible = false;
}
else
{
this.txtPSO_Remarks_o.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.spanOrderDeliveryTime.InnerText = _eC_OrderBasic.DeliveryTime == null ? "" : _eC_OrderBasic.DeliveryTime.Value.ToString("yyyy-MM-dd HH:mm");
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;
List m_EC_SpecialForumsList = bll_EC_SpecialOrdersBLL.GetEC_SpecialForumsListByKeyid(m_EC_SpecialOrders.Keyid) as List;
if (m_EC_SpecialForumsList == null || m_EC_SpecialForumsList.Count == 0)
{
m_EC_SpecialForumsList = new List();
EC_SpecialForums m_EC_SpecialForums = new EC_SpecialForums();
m_EC_SpecialForums.PSF_Forumsid = 1;
m_EC_SpecialForumsList.Add(m_EC_SpecialForums);
}
foreach (var eC_SpecialForums in m_EC_SpecialForumsList)
{
if (eC_SpecialForums.PSF_PressesDesk.IndexOf("数码")>=0 || eC_SpecialForums.PSF_PressesDesk.IndexOf("直接修切") >= 0)
{
eC_SpecialForums.shifouxianshi = "display:none;";
}
if (eC_SpecialForums.PSF_PressesDesk.IndexOf("与其他订单合版") >= 0 )
{
eC_SpecialForums.shifouxianshi = "display:none;";
eC_SpecialForums.shifouxianshiheban = "display:none;";
}
}
this.RepClientList.DataSource = m_EC_SpecialForumsList;
this.RepClientList.DataBind();
return true;
}
///
///
///
///
///
protected void btnPress_Click(object sender, EventArgs e)
{
EC_SpecialOrders m_EC_SpecialOrders = bll_EC_SpecialOrdersBLL.GetModelByOrderId(Convert.ToInt32(Request["orderid"]));
m_EC_SpecialOrders.IsPrint = 1;
bll_EC_SpecialOrdersBLL.UpdateModel(m_EC_SpecialOrders);
}
public string show(string str,string strPlateSource)
{
string reStr = string.Empty;
if (strPlateSource == "本厂CTP")
{
if(str == "CTPCount")
{
reStr = "style="+"\""+""+"\"";
}
else if(str == "PSSpec")
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
else
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
}
else if(strPlateSource == "自带CTP")
{
if (str == "CTPCount")
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
else if (str == "PSSpec")
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
else
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
}
else if (strPlateSource == "自带菲林" || strPlateSource == "本厂菲林")
{
if (str == "CTPCount")
{
reStr = "style=" + "\"" + "display:none" + "\"";
}
else if (str == "PSSpec")
{
reStr = "style=" + "\"" + "" + "\"";
}
else
{
reStr = "style=" + "\"" + "" + "\"";
}
}
return reStr;
}
}
}