using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using DSWeb.MvcShipping.Models.MsSeaeOrder; using DSWeb.MvcShipping.DAL.MsSeaeOrderDAL; using DSWeb.Areas.Mobile.Models.Login; using DSWeb.Areas.Mobile.DAL; using System.Text; namespace DSWeb.Areas.Mobile.Views.BookSpace { public partial class LSDC : System.Web.Mvc.ViewPage { public string _LSDCHTML = ""; protected void Page_Load ( object sender, EventArgs e ) { SetupHTML(); } private void SetupHTML ( ) { string openid= Request.Cookies["openid"] == null ? "" : Request.Cookies["openid"].Value.ToString(); string querystr= SetupHiddenFiled(); //openid = "123"; User u = LoginDAL.GetUserWithOpenId(openid); List list = MsSeaeOrderDAL.GetDataList(0,100,querystr, u.uid, u.codename, u.comid); StringBuilder sb = new StringBuilder(); foreach (MsSeaeOrder item in list) { sb.Append("
  • "); sb.Append(""); sb.Append("订舱编号:"+item.ORDNO+"["+item.ORSTATUSREF+"]" + "
    委托单位:" + item.CUSTOMERNAME + "
    "); sb.Append("订舱日期:"+item.BSDATE+"
    "); sb.Append("装 货 港:" + item.PORTLOAD + "
    "); sb.Append("卸 货 港:" + item.PORTDISCHARGE + "
    "); sb.Append("集 装 箱:"+(item.CNTRTOTAL==""?"-":item.CNTRTOTAL)); sb.Append("
    "); sb.Append("
  • "); } _LSDCHTML = sb.ToString(); } private string SetupHiddenFiled () { string zhg = Request.QueryString["zhg"] == null ? "" : Request.QueryString["zhg"]; string xhg = Request.QueryString["xhg"] == null ? "" : Request.QueryString["xhg"]; string dcrq = Request.QueryString["dcrq"] == null ? "" : Request.QueryString["dcrq"]; hdszhg.Value = zhg; hdsxhg.Value = xhg; hdsdcrq.Value = dcrq; string qstr = " 1=1 "; if (zhg!="") { qstr += "and B.PORTLOAD like '%"+zhg+"%' "; } if (xhg != "") { qstr += "and B.PORTDISCHARGE like '%" + xhg + "%' "; } if (dcrq != "") { qstr += "and ( CONVERT(varchar(100),BSDATE, 23) = '"+dcrq+"') "; } return qstr; } } }