diff --git a/DSWeb/Areas/MvcShipping/Controllers/BookingConfirmController.cs b/DSWeb/Areas/MvcShipping/Controllers/BookingConfirmController.cs index 2cc5c878..073bca59 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/BookingConfirmController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/BookingConfirmController.cs @@ -820,7 +820,11 @@ namespace DSWeb.MvcShipping.Controllers var detailmodb = new ModelObjectDB(); - OpSeaeData.NOPKGS = OpSeaeData.PKGS.ToString() + OpSeaeData.KINDPKGS.ToString(); + + + OpSeaeData.NOPKGS = CtnList.Sum(s=>s.PKGS) + OpSeaeData.KINDPKGS.ToString(); + OpSeaeData.GROSSWEIGHT = CtnList.Sum(s => s.KGS) + "KGS"; + OpSeaeData.MEASUREMENT = CtnList.Sum(s => s.CBM) + "CBM"; if (SIData["ISMULTI"] == "true") { @@ -833,11 +837,18 @@ namespace DSWeb.MvcShipping.Controllers } } - result = modb.SaveHead(OpSeaeData); + + var userid = Convert.ToString(Session["USERID"]); + var username = Convert.ToString(Session["SHOWNAME"]); + var COMPANYID = Convert.ToString(Session["COMPANYID"]); + var COMPANYNAME = Convert.ToString(Session["COMPANYNAME"]); + //result = modb.SaveHead(OpSeaeData); + result = DSWeb.MvcShipping.DAL.MsOpSeaeDAL.MsOpSeaeDAL.DoSave("edit", OpSeaeData, CtnList, userid, username, COMPANYID, COMPANYNAME); if (!result.Success) { - jsonRespose.SetDBResult(result); - return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + //jsonRespose.SetDBResult(result); + //return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + return BasicDataRefDAL.GetContentResult(result); } result = modb.SaveHead(OpSeaeAms); @@ -847,14 +858,14 @@ namespace DSWeb.MvcShipping.Controllers return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } - result = modb.SaveComm("BSNO", ctnParentIDValue - , ModelObjectConvert.ToModelObjectList(CtnList) - ,null); - if (!result.Success) - { - jsonRespose.SetDBResult(result); - return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; - } + //result = modb.SaveComm("BSNO", ctnParentIDValue + // , ModelObjectConvert.ToModelObjectList(CtnList) + // ,null); + //if (!result.Success) + //{ + // jsonRespose.SetDBResult(result); + // return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + //} foreach (var ctndetail in ChangeCtnDetailList) { diff --git a/DSWeb/Areas/MvcShipping/DAL/BookingConfirm/BookingConfirmDAL.cs b/DSWeb/Areas/MvcShipping/DAL/BookingConfirm/BookingConfirmDAL.cs index e107f302..b868916f 100644 --- a/DSWeb/Areas/MvcShipping/DAL/BookingConfirm/BookingConfirmDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/BookingConfirm/BookingConfirmDAL.cs @@ -737,6 +737,8 @@ namespace DSWeb.Areas.MvcShipping.DAL.BookingConfirm return result; } + // + result.Success = true; return result; } diff --git a/DSWeb/Areas/MvcShipping/Models/BookingConfirm/BookingConfirmModel.cs b/DSWeb/Areas/MvcShipping/Models/BookingConfirm/BookingConfirmModel.cs index 976503fd..4157a1db 100644 --- a/DSWeb/Areas/MvcShipping/Models/BookingConfirm/BookingConfirmModel.cs +++ b/DSWeb/Areas/MvcShipping/Models/BookingConfirm/BookingConfirmModel.cs @@ -172,7 +172,8 @@ namespace DSWeb.MvcShipping.Models.BookingConfirm public static string getSQL() { - return " SELECT [CTN_ID],[ORDNO],[CTNALL],[CTNNUM],[TEU],[CNTRNO],[SEALNO],[PKGS],[KINDPKGS],[KGS],[CBM],[TAREWEIGHT],[CTNSTATUS],[WEIGHTYPE],[WEIGHKGS],[WEIGHATTN],[VGMCONNCOM],[WEIGHTEL],[WEIGHDATE],[VGMADDR],[VGMEMAIL],[REMARK] ,(select bsno from OP_SEAE_ORDER where ORDNO in(select ORDNO from op_seae_si where SINO=[OP_SI_CTN].ORDNO)) BSNO_PARENT,(select bsno from OP_SEAE_ORDER where ORDNO =[OP_SI_CTN].ORDNO) BSNO,(select MBLNO from OP_SEAE_SI where SINO =[OP_SI_CTN].ORDNO) SI_MBLNO FROM [OP_SI_CTN] "; + return " SELECT [CTN_ID],[ORDNO],[CTNALL]," + + "case when isnull(CNTRNO,'')<>'' then 1 else [CTNNUM] end as CTNNUM,[TEU],[CNTRNO],[SEALNO],[PKGS],[KINDPKGS],[KGS],[CBM],[TAREWEIGHT],[CTNSTATUS],[WEIGHTYPE],[WEIGHKGS],[WEIGHATTN],[VGMCONNCOM],[WEIGHTEL],[WEIGHDATE],[VGMADDR],[VGMEMAIL],[REMARK] ,(select bsno from OP_SEAE_ORDER where ORDNO in(select ORDNO from op_seae_si where SINO=[OP_SI_CTN].ORDNO)) BSNO_PARENT,(select bsno from OP_SEAE_ORDER where ORDNO =[OP_SI_CTN].ORDNO) BSNO,(select MBLNO from OP_SEAE_SI where SINO =[OP_SI_CTN].ORDNO) SI_MBLNO FROM [OP_SI_CTN] "; } public Booking_SICtnmb() diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/BookingConfirm/Booking_SIEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/BookingConfirm/Booking_SIEdit.js index b43fd6fb..738613c2 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/BookingConfirm/Booking_SIEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/BookingConfirm/Booking_SIEdit.js @@ -8522,6 +8522,9 @@ Ext.extend(Shipping.Booking_SIEdit, Ext.Panel, { a = typeof (SIValue); b = typeof (LocalValue); + //console.log(FieldName); + //console.log(SIValue); + //console.log(LocalValue); isdifferent = this.checkDifferent(FieldName, SIValue, LocalValue); if (isdifferent) { @@ -8642,15 +8645,21 @@ Ext.extend(Shipping.Booking_SIEdit, Ext.Panel, { return result; }, gridCellrenderer: function (value, meta, record, a, b, parentstore, c) { - headname = _this.initctncolumns[b].dataIndex; - if (!_this.needFind(headname)) { - return value; - } else { - isdifferent = _this.FindDiffenet_record(record.get("CNTRNO"), headname, value); + //console.log(b); + //console.log(_this.initctncolumns); + if (b < _this.initctncolumns.length) { + headname = _this.initctncolumns[b].dataIndex; + if (!_this.needFind(headname)) { + return value; + } else { + isdifferent = _this.FindDiffenet_record(record.get("CNTRNO"), headname, value); - if (isdifferent) { - meta.tdCls = 'feestatus_shenmodify'; + if (isdifferent) { + meta.tdCls = 'feestatus_shenmodify'; + } + return value; } + } else { return value; } },