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.

193 lines
7.0 KiB
C#

using DSWeb.Areas.MvcShipping.DAL.MsOpSeaeBaoXian;
using DSWeb.Areas.MvcShipping.Models.MsOpSeaeBaoXian;
using DSWeb.MvcShipping.DAL.MsOpSeaeDAL;
using DSWeb.MvcShipping.Helper;
using DSWeb.MvcShipping.Models.MsOpSeae;
using System.Web.Mvc;
namespace DSWeb.MvcShipping.Controllers
{
public class MsOpSeaeBaoXianController : Controller
{
// GET:
public ActionResult Index()
{
return View();
}
// GET: /
public ActionResult ZD()
{
return View();
}
// GET: /
public ActionResult FP()
{
return View();
}
public ContentResult Apply(string handle, string condition)
{
MsOpSeae head = MsOpSeaeDAL.GetData(condition);
if (head == null)
{
var json = JsonConvert.Serialize(
new { Success = true, Message = "申请失败", data = head });
return new ContentResult() { Content = json };
}
else
{
//转化模型
string userid = Session["USERID"].ToString();
string showname = Session["SHOWNAME"].ToString();
string codename = Session["CODENAME"].ToString();
string comid = Session["COMPANYID"].ToString();
OpSeaeBaoXianModel_Apply_Requst rq = new OpSeaeBaoXianModel_Apply_Requst();
rq.clientid = userid;
rq.productcode = "CA06";
rq.partnerorderid = head.BSNO;
rq.partnerapplyid = head.BSNO;
rq.username = showname;
rq.orgcode = "";
rq.address = "";
rq.tel = "";
rq.mail = "";
rq.cusqq = "";
rq.fixedtelephone = "";
rq.holderphone = "";
rq.holdercontact = "";
rq.holderaddresse = "";
string sp = "";
try
{
string temp = head.SHIPPER.Replace("\r\n","^");
sp = temp.Split('^')[0];
}
catch (System.Exception)
{
sp = "";
}
rq.insuredname = sp;
rq.insuredaddress = "";
rq.insuredcontact = "";
rq.insuredphone = "";
rq.goodscategorycode = "";
rq.packagetypecode = "";
rq.goodsmt = head.MARKS;
rq.goodsmarks = head.DESCRIPTION;
rq.goodsmarksdesc = head.PKGS.ToString()+head.KINDPKGS;
rq.invoiceno = "";
rq.billno = head.MBLNO;
rq.converyance = head.VESSEL+" " +
""+head.VOYNO;
rq.transporttypecode = "";
rq.portloading = head.PORTLOAD;
rq.destination = head.DESTINATION;
rq.porttranshipment = "";
rq.departurestartdate = head.ETD;
rq.abbreviation = "";
rq.isasprebill = "";
rq.worknumber = codename;
OpSeaeBaoXianModel_Apply_Response m = MsOpSeaeBaoXianDAL.apply(rq, userid, comid);
if (m.success=="true")
{
var json = JsonConvert.Serialize(
new { Success = m.success, Message = m.message, Data = m.result.url });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(
new { Success = m.success, Message = m.message, Data = m.message });
return new ContentResult() { Content = json };
}
}
}
public ContentResult ApplyFenDan(string handle, string condition)
{
var head = MsOpSeaeDAL.GetBillData(condition);
if (head == null)
{
var json = JsonConvert.Serialize(
new { Success = true, Message = "申请失败", data = head });
return new ContentResult() { Content = json };
}
else
{
//转化模型
string userid = Session["USERID"].ToString();
string showname = Session["SHOWNAME"].ToString();
string codename = Session["CODENAME"].ToString();
string comid = Session["COMPANYID"].ToString();
OpSeaeBaoXianModel_Apply_Requst rq = new OpSeaeBaoXianModel_Apply_Requst();
rq.clientid = userid;
rq.productcode = "CA06";
rq.partnerorderid = head.BSNO;
rq.partnerapplyid = head.BSNO;
rq.username = showname;
rq.orgcode = "";
rq.address = "";
rq.tel = "";
rq.mail = "";
rq.cusqq = "";
rq.fixedtelephone = "";
rq.holderphone = "";
rq.holdercontact = "";
rq.holderaddresse = "";
string sp = "";
try
{
string temp = head.SHIPPER.Replace("\r\n", "^");
sp = temp.Split('^')[0];
}
catch (System.Exception)
{
sp = "";
}
rq.insuredname = sp;
rq.insuredaddress = "";
rq.insuredcontact = "";
rq.insuredphone = "";
rq.goodscategorycode = "";
rq.packagetypecode = "";
rq.goodsmt = head.MARKS;
rq.goodsmarks = head.DESCRIPTION;
rq.goodsmarksdesc = head.PKGS.ToString() + head.KINDPKGS;
rq.invoiceno = "";
rq.billno = head.HBLNO;
rq.converyance = head.VESSEL + " " +
"" + head.VOYNO;
rq.transporttypecode = "";
rq.portloading = head.PORTLOAD;
rq.destination = head.DESTINATION;
rq.porttranshipment = "";
rq.departurestartdate = head.ETD;
rq.abbreviation = "";
rq.isasprebill = "";
rq.worknumber = codename;
OpSeaeBaoXianModel_Apply_Response m = MsOpSeaeBaoXianDAL.apply(rq, userid, comid);
if (m.success == "true")
{
var json = JsonConvert.Serialize(
new { Success = m.success, Message = m.message, Data = m.result.url });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(
new { Success = m.success, Message = m.message, Data = m.message });
return new ContentResult() { Content = json };
}
}
}
}
}