using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using DSWeb.Areas.CommMng.Models; using DSWeb.Areas.CommMng.DAL; using System.Text; using DSWeb.MvcShipping.DAL.MsSeaeOrderDAL; using DSWeb.MvcShipping.Models.MsSeaeOrder; using DSWeb.MvcShipping.Comm.Cookie; namespace DSWeb.Areas.Mobile.Views.BookSpace { /// /// 销售订舱 /// public partial class XSDC : System.Web.Mvc.ViewPage { public string _WTDWHTML = "";//委托单位 public string _DCDLHTML = "";//订舱代理 public string _ZHGHTML = "";//装货港 public string _XHGHTML = "";//卸货港 public string _CGSHTML = "";//船公司 public string _FFFSHTML = "";//付费方式 public string _CTNHTML = "";//集装箱箱型 public string _BAOZHUANG = "";//包装 public string _KEFU = "";//客服 public string _HAIWAIKEFU = "";//海外客服 public string _CAOZUO = "";//操作 public string _CTNREAD = ""; List _listctn; MsSeaeOrder _MSO = null; public string _FOOTERHTML = ""; protected void Page_Load ( object sender, EventArgs e ) { SetupHTML(); } private void SetupHTML ( ) { GetData(); //委托单位下拉框 List listWtdw = BasicDataRefDAL.GetCustomRefList("ISCONTROLLER='1'"); StringBuilder sbWtdw = new StringBuilder(); foreach (var item in listWtdw) { string temp = ""; if (_MSO!=null) { temp = _MSO.CUSTOMERNAME; } if (temp != "" && temp == item.CodeAndName) { sbWtdw.Append(""); } else { sbWtdw.Append(""); } } _WTDWHTML = sbWtdw.ToString(); //订舱代理下拉框 List listDcdl = BasicDataRefDAL.GetCustomRefList("ISBOOKING='1'"); StringBuilder sbDcdl = new StringBuilder(); foreach (var item in listDcdl) { string temp = ""; if (_MSO != null) { temp = _MSO.FORWARDER; } if (temp != "" && temp == item.CodeAndName) { sbDcdl.Append(""); } else { sbDcdl.Append(""); } } _DCDLHTML = sbDcdl.ToString(); //装货港下拉框 List listZhg = BasicDataRefDAL.GetCodeLoadportList(); StringBuilder sbZhg = new StringBuilder(); foreach (var item in listZhg) { string temp = ""; if (_MSO != null) { temp = _MSO.PORTLOADID; } if (temp != "" && temp == item.EDICODE) { sbZhg.Append(""); } else { sbZhg.Append(""); } } _ZHGHTML = sbZhg.ToString(); //卸货港下拉框 List listXhg = BasicDataRefDAL.GetCodeDisportList(""); StringBuilder sbXhg = new StringBuilder(); foreach (var item in listXhg) { string temp = ""; if (_MSO != null) { temp = _MSO.PORTDISCHARGEID; } if (temp != "" && temp == item.EDICODE) { sbXhg.Append(""); } else { sbXhg.Append(""); } } _XHGHTML = sbXhg.ToString(); //船公司 List listCgs = BasicDataRefDAL.GetCustomRefList("ISCARRIER='1'"); StringBuilder sbCgs = new StringBuilder(); foreach (var item in listCgs) { if (item.CodeAndName == null || item.CodeAndName == "") { continue; } string temp = ""; if (_MSO != null) { temp = _MSO.CARRIER; } if (temp != "" && temp == item.CodeAndName) { sbCgs.Append(""); } else { sbCgs.Append(""); } } _CGSHTML = sbCgs.ToString(); //付费方式 List listFffs = BasicDataRefDAL.GetCodeFrtList(); StringBuilder sbFffs = new StringBuilder(); foreach (var item in listFffs) { string temp = ""; if (_MSO != null) { temp = _MSO.BLFRT; } if (temp != "" && temp == item.FRT) { sbFffs.Append(""); } else { sbFffs.Append(""); } } _FFFSHTML = sbFffs.ToString(); //集装箱箱型 _listctn = BasicDataRefDAL.GetCodeCtnList(); StringBuilder sbctn = new StringBuilder(); sbctn.Append(""); hdJZXComboxHtml.Value = sbctn.ToString(); _CTNHTML = sbctn.ToString(); //集装箱数量 StringBuilder sbctnshuliang = new StringBuilder(); sbctnshuliang.Append(""); hdJZXShuliangComboxHtml.Value = sbctnshuliang.ToString(); //包装 List listBaozhuang = BasicDataRefDAL.GetCodePackageList(); StringBuilder sbBaozhuang = new StringBuilder(); foreach (var item in listBaozhuang) { string temp = ""; if (_MSO != null) { temp = _MSO.KINDPKGS; } if (temp != "" && temp == item.PKGS) { sbBaozhuang.Append(""); } else { sbBaozhuang.Append(""); } } _BAOZHUANG = sbBaozhuang.ToString(); //客服 List listKefu = BasicDataRefDAL.GetUserRefList(); StringBuilder sbKefu = new StringBuilder(); foreach (var item in listKefu) { string temp = ""; if (_MSO != null) { temp = _MSO.CUSTSERVICE; } if (temp != "" && temp == item.UserName) { sbKefu.Append(""); } else { sbKefu.Append(""); } } _KEFU = sbKefu.ToString(); //海外客服 List listHaiwaiKefu = BasicDataRefDAL.GetUserRefList(); StringBuilder sbHaiwaiKefu = new StringBuilder(); foreach (var item in listHaiwaiKefu) { string temp = ""; if (_MSO != null) { temp = _MSO.DOC; } if (temp != "" && temp == item.UserName) { sbHaiwaiKefu.Append(""); } else { sbHaiwaiKefu.Append(""); } } _HAIWAIKEFU = sbHaiwaiKefu.ToString(); //操作 List listCaozuo = BasicDataRefDAL.GetUserRefList(); StringBuilder sbCaoZuo = new StringBuilder(); foreach (var item in listCaozuo) { string temp = ""; if (_MSO != null) { temp = _MSO.OP; } if (temp != "" && temp == item.UserName) { sbCaoZuo.Append(""); } else { sbCaoZuo.Append(""); } } _CAOZUO = sbCaoZuo.ToString(); if (_MSO!=null) { CreateCTNHTML(_MSO.CNTRTOTAL); hdordno.Value = _MSO.ORDNO; } else { hdordno.Value = ""; } CreateFooterHTML(); } private void GetData () { string ordno = Request.QueryString["ordno"] == null ? "" : Request.QueryString["ordno"]; string copy = Request.QueryString["copy"] == null ? "" : Request.QueryString["copy"]; if (ordno!="") { string sql = "B.ORDNO = '" + ordno + "'"; MsSeaeOrder mso = MsSeaeOrderDAL.GetData(sql, Convert.ToString(Session["USERID"])); if (mso != null) { if (copy=="1") { mso.ORSTATUS = "9"; mso.ORSTATUSREF = "录入状态"; mso.ORDNO = "*"; } _MSO = mso; } } } private void CreateCTNHTML (string str) { StringBuilder sbctncomboxgroup = new StringBuilder(); string[] ctn = str.Split('/'); foreach (string ctnobj in ctn) { if (ctnobj=="") { continue; } string ctnname = ctnobj.Split('*')[0]; string ctncnt = ctnobj.Split('*')[1]; #region 集装箱信息下拉框控件组 sbctncomboxgroup.Append("
  • "); //1.集装箱箱型下拉框 sbctncomboxgroup.Append(""); //2.集装箱数量下拉框 sbctncomboxgroup.Append(""); //3.删除按钮 sbctncomboxgroup.Append("删除"); sbctncomboxgroup.Append("
  • "); #endregion } _CTNREAD = sbctncomboxgroup.ToString(); hdctntemp.Value = str; } private void CreateFooterHTML ( ) { StringBuilder sb = new StringBuilder(); if (_MSO == null || _MSO.ORSTATUS == "9" || _MSO.ORSTATUS == "2") { sb.Append("
  • 集装箱信息
  • "); sb.Append("
  • 暂存
  • "); sb.Append("
  • 订舱
  • "); } else { if (_MSO.ORSTATUS=="1") { sb.Append("
  • 撤销提交
  • "); } else if (_MSO.ORSTATUS =="8") { sb.Append("
  • 复制订舱
  • "); } else { sb.Append("
  • 复制订舱
  • "); } } _FOOTERHTML = sb.ToString(); } } }