You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/Mobile/Views/YunJia/YJCX.aspx.cs

111 lines
4.2 KiB
C#

2 years ago
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;
using DSWeb.MvcShipping.DAL.MsCrmPriceCarrierDAL;
using DSWeb.MvcShipping.Models.MsCrmPriceCarrier;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.DAL.MsCrmPriceCarrierListDAL;
namespace DSWeb.Areas.Mobile.Views.YunJia
{
public partial class YJCX : System.Web.Mvc.ViewPage
{
public string _YJCXHTML = "";
public string _QYGHTML = "";
protected void Page_Load ( object sender, EventArgs e )
{
SetupHTML();
}
private void SetupHTML ( )
{
string openid = Request.Cookies["openid"] == null ? "123" : Request.Cookies["openid"].Value.ToString();
string querystr = SetupHiddenFiled();
User u = LoginDAL.GetUserWithOpenId(openid);
List<MsCrmPriceCarrier> list = MsCrmPriceCarrierListDAL.GetDataList(querystr, 0, 1000, u.uid, u.showname, u.comid, "");
StringBuilder sb = new StringBuilder();
foreach (MsCrmPriceCarrier item in list)
{
sb.Append("<li>");
// sb.Append("<a data-ajax=\"false\" href=\"/Mobile/BookSpace/XSDC?ordno=" + item. + "\">");
sb.Append("<b>" + "" + item.PODLOAD + "-");
if (item.VIA=="")
{
sb.Append("直达-" + item.PORTDISCHARGE );
}
else
{
sb.Append(item.VIA+"-" + item.PORTDISCHARGE );
}
sb.Append("</b><br/>");
sb.Append("船公司/船期:" + item.CARRIER + "/" + item.ETD+"<br/>");
string validate = item.VALIDDATE.ToString("yyyy-MM-dd");
sb.Append("有效期/航程:" + validate + "/" + item.TT + "<br/>");
sb.Append("底价:小柜/大柜/超高:<br/><b style=\"color:red\">"+item.CTN00+"/"+item.CTN10+"/"+item.CTN20+"</b><br/>");
sb.Append("报价:小柜/大柜/超高:<br/><b style=\"color:red\">" + item.CTN02 + "/" + item.CTN12 + "/" + item.CTN22 + "</b><br/>");
// sb.Append("</a>");
sb.Append("</li>");
}
_YJCXHTML = sb.ToString();
//查询下拉框
//起运港下拉框
List<CodeLoadportModel> listQyg = BasicDataRefDAL.GetCodeLoadportList();
StringBuilder sbQyg = new StringBuilder();
//foreach (var item in listQyg)
//{
// sbQyg.Append("<option value=\"" + item.PORT + "\">" + item.CodeAndName + "</option>");
//}
_QYGHTML = sbQyg.ToString();
}
private string SetupHiddenFiled ( )
{
string qyg = Request.QueryString["qyg"] == null ? "" : Request.QueryString["qyg"];
string xhg = Request.QueryString["xhg"] == null ? "" : Request.QueryString["xhg"];
string cgs = Request.QueryString["cgs"] == null ? "" : Request.QueryString["cgs"];
string ksrq = Request.QueryString["ksrq"] == null ? "" : Request.QueryString["ksrq"];
string jsrq = Request.QueryString["jsrq"] == null ? "" : Request.QueryString["jsrq"];
hdsqyg.Value = qyg;
hdsxhg.Value = xhg;
hdscgs.Value = cgs;
hdsksrq.Value = ksrq;
hdsjsrq.Value = jsrq;
string qstr = " 1=1 and ISISSUE =1 ";
if (qyg != "")
{
qstr += "and PODLOAD like '%" + qyg + "%' ";
}
if (xhg != "")
{
qstr += "and PORTDISCHARGE like '%" + xhg + "%' ";
}
if (cgs!="")
{
qstr += "and CARRIER like '%" + cgs + "%'";
}
if (ksrq != "")
{
qstr += "and VALIDDATE >= '" + ksrq + "'";
}
if (jsrq != "")
{
qstr += "and VALIDDATE <= '" + jsrq + "'";
}
return qstr;
}
}
}