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("" + item.CodeAndName + ""); } else { sbWtdw.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbDcdl.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbZhg.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbXhg.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbCgs.Append("" + item.CodeAndName + ""); } } _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("" + item.FRT + ""); } else { sbFffs.Append("" + item.FRT + ""); } } _FFFSHTML = sbFffs.ToString(); //集装箱箱型 _listctn = BasicDataRefDAL.GetCodeCtnList(); StringBuilder sbctn = new StringBuilder(); sbctn.Append(""); foreach (var item in _listctn) { if (item.CTN=="") { sbctn.Append("箱型"); } else { sbctn.Append("" + item.CTN + ""); } } sbctn.Append(""); hdJZXComboxHtml.Value = sbctn.ToString(); _CTNHTML = sbctn.ToString(); //集装箱数量 StringBuilder sbctnshuliang = new StringBuilder(); sbctnshuliang.Append(""); sbctnshuliang.Append("数量"); for (int i = 1; i <= 20; i++) { sbctnshuliang.Append("" + i + ""); } 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("" + item.PKGS + ""); } else { sbBaozhuang.Append("" + item.PKGS + ""); } } _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("" + item.CodeAndName + ""); } else { sbKefu.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbHaiwaiKefu.Append("" + item.CodeAndName + ""); } } _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("" + item.CodeAndName + ""); } else { sbCaoZuo.Append("" + item.CodeAndName + ""); } } _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(""); foreach (var item in _listctn) { if (item.CTN == "") { sbctncomboxgroup.Append("箱型"); } else { if (item.CTN==ctnname) { sbctncomboxgroup.Append("" + item.CTN + ""); } else { sbctncomboxgroup.Append("" + item.CTN + ""); } } } sbctncomboxgroup.Append(""); //2.集装箱数量下拉框 sbctncomboxgroup.Append(""); sbctncomboxgroup.Append("数量"); for (int i = 1; i <= 20; i++) { if (i==Convert.ToInt32(ctncnt)) { sbctncomboxgroup.Append("" + i + ""); } else { sbctncomboxgroup.Append("" + i + ""); } } 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(); } } }