//save SupportDocMasterConsignment public object SaveSupportDocMasterConsignment(SupportDocMasterConsignmentModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblSupportDocMasterConsignmentMaps.Where(z => z.iSupportDocsId == model.iSupportDocsId).SingleOrDefault(); if (data != null) { data.iMasterConsignmentId = model.iMasterConsignmentId ?? 0; data.iMessageImplementationId = model.iMessageImplementationId; data.sTagRef = model.sTagRef; data.sRefSerialNo = model.sRefSerialNo; data.sSubSerialNoRef = model.sSubSerialNoRef; data.sIcegateUserId = model.sIcegateUserId; data.sIRNNo = model.sIRNNo; data.sDocRefNo = model.sDocRefNo; data.sDocTypeCd = model.sDocTypeCd; data.sBeneficiaryCd = model.sBeneficiaryCd; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblSupportDocMasterConsignmentMap { iMasterConsignmentId = model.iMasterConsignmentId ?? 0, iMessageImplementationId = model.iMessageImplementationId, sTagRef = model.sTagRef, sRefSerialNo = model.sRefSerialNo, sSubSerialNoRef = model.sSubSerialNoRef, sIcegateUserId = model.sIcegateUserId, sIRNNo = model.sIRNNo, sDocRefNo = model.sDocRefNo, sDocTypeCd = model.sDocTypeCd, sBeneficiaryCd = model.sBeneficiaryCd, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblSupportDocMasterConsignmentMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Support Doc saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
public object SaveUser(UserModel model, int iUserId) { using (var db = new SeaManifestEntities()) { var data = db.tblUserMs.Where(z => z.iUserId == model.iUserId).SingleOrDefault(); if (data == null) { if (db.tblUserMs.Any(z => z.sUserName == model.sUsername)) { return(new { Status = false, Message = "User already exists" }); } else { data = new tblUserM { sFirstName = model.sFirstName, sLastName = model.sLastName, sPassword = Crypto.Encrypt(model.sPassword), iRoleId = model.iRoleId, sPhoneNumber = model.sPhoneNo, sUserName = model.sUsername, sEmailId = model.sEmailID, }; db.tblUserMs.Add(data); db.SaveChanges(); return(new { Status = true, Message = "User saved successfully!" }); } } else { if (db.tblUserMs.Any(z => z.sUserName == model.sUsername && z.iUserId != model.iUserId)) { return(new { Status = false, Message = "User already exists" }); } else { data.sFirstName = model.sFirstName; data.sLastName = model.sLastName; data.sPassword = Crypto.Encrypt(model.sPassword); data.iRoleId = model.iRoleId; data.sPhoneNumber = model.sPhoneNo; data.sUserName = model.sUsername; data.sEmailId = model.sEmailID; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(new { Status = true, Message = "User saved successfully!" }); } } } }
//save AdditionalDetailsHouseCargo public object SaveAdditionalDetailsHouseCargo(AdditionalDetailsHouseCargoModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblAdditionalDetailsHouseCargoMaps.Where(z => z.iAdditionalDetailsId == model.iAdditionalDetailsId).SingleOrDefault(); if (data != null) { data.iHouseCargoDescId = model.iHouseCargoDescId; data.sTagRef = model.sTagRef; data.dRefSerialNo = model.dRefSerialNo; data.sInfoType = model.sInfoType; data.sInfoQualifier = model.sInfoQualifier; data.sInfoCd = model.sInfoCd; data.sInfoText = model.sInfoText; data.sInfoMsr = model.sInfoMsr; data.dtInfoDate = model.sInfoDate.ToDate(); data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblAdditionalDetailsHouseCargoMap { iHouseCargoDescId = model.iHouseCargoDescId, sTagRef = model.sTagRef, dRefSerialNo = model.dRefSerialNo, sInfoType = model.sInfoType, sInfoQualifier = model.sInfoQualifier, sInfoCd = model.sInfoCd, sInfoText = model.sInfoText, sInfoMsr = model.sInfoMsr, dtInfoDate = model.sInfoDate.ToDate(), iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblAdditionalDetailsHouseCargoMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Additional Details saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save ItemDeatilsHouseCargo public object SaveItemDetailssHouseCargo(ItemDetailsHouseCargoModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblItemDetailsHouseCargoMaps.Where(z => z.iItemsDetailsId == model.iItemsDetailsId).SingleOrDefault(); if (data != null) { data.iHouseCargoDescId = model.iHouseCargoDescId ?? 0; data.iMasterConsignmentId = model.iMasterConsignmentId; data.dCargoItemSequenceNo = model.dCargoItemSequenceNo; data.sHsCd = model.sHsCd; data.sCargoItemDesc = model.sCargoItemDesc; data.sUnoCd = model.sUnoCd; data.sIMDGCd = model.sIMDGCd; data.dNoOfPakages = model.dNoOfPakages; data.sTypesOfPackages = model.sTypesOfPackages; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblItemDetailsHouseCargoMap { iHouseCargoDescId = model.iHouseCargoDescId ?? 0, iMasterConsignmentId = model.iMasterConsignmentId, dCargoItemSequenceNo = model.dCargoItemSequenceNo, sHsCd = model.sHsCd, sCargoItemDesc = model.sCargoItemDesc, sUnoCd = model.sUnoCd, sIMDGCd = model.sIMDGCd, dNoOfPakages = model.dNoOfPakages, sTypesOfPackages = model.sTypesOfPackages, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblItemDetailsHouseCargoMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Item Details saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save ItemDeatilsMasterConsignment public object SaveItineraryHouseMasterConsignment(ItineraryMasterConsignmentModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblItineraryMasterConsignmentMaps.Where(z => z.iItineraryId == model.iItineraryId).SingleOrDefault(); if (data != null) { data.iMasterConsignmentId = model.iMasterConsignmentId ?? 0; data.iMessageImplementationId = model.iMessageImplementationId; data.dPortOfCallSequenceNo = model.dPortOfCallSequenceNo; data.sPortOfCallCd = model.sPortOfCallCd; data.sPortOfCallName = model.sPortOfCallName; data.sNextPortOfCallCdd = model.sNextPortOfCallCdd; data.sNextPortOfCallName = model.sNextPortOfCallName; data.sModeOfTransport = model.sModeOfTransport; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblItineraryMasterConsignmentMap { iMasterConsignmentId = model.iMasterConsignmentId ?? 0, iMessageImplementationId = model.iMessageImplementationId, dPortOfCallSequenceNo = model.dPortOfCallSequenceNo, sPortOfCallCd = model.sPortOfCallCd, sPortOfCallName = model.sPortOfCallName, sNextPortOfCallCdd = model.sNextPortOfCallCdd, sNextPortOfCallName = model.sNextPortOfCallName, sModeOfTransport = model.sModeOfTransport, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblItineraryMasterConsignmentMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Itinerary saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
public object SavePermission(PermissionInputModel model) { using (var db = new SeaManifestEntities()) { var data = db.tblPermissionMs.Where(z => z.iPermissionId == model.iPermissionId).SingleOrDefault(); if (data == null) { if (db.tblPermissionMs.Any(z => z.sPermissionName == model.sPermissionName)) { return(new { Status = false, Message = "Permission already exists" }); } else { data = new tblPermissionM { sPermissionName = model.sPermissionName, iParentId = model.iParentId ?? 0, iOrder = model.iOrder, sPath = model.sPath }; db.tblPermissionMs.Add(data); db.SaveChanges(); return(new { Status = true, Message = "Permission saved successfully!" }); } } else { if (db.tblPermissionMs.Any(z => z.sPermissionName == model.sPermissionName && z.iPermissionId != model.iPermissionId)) { return(new { Status = false, Message = "Permission already exists" }); } else { data.sPermissionName = model.sPermissionName; data.iParentId = model.iParentId ?? 0; data.iOrder = model.iOrder; data.sPath = model.sPath; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(new { Status = true, Message = "Permission saved successfully!" }); } } } }
public object SaveRole(RoleModel model) { using (var db = new SeaManifestEntities()) { var data = db.tblRoleMs.Where(z => z.iRoleId == model.iRoleId).SingleOrDefault(); if (data == null) { if (db.tblRoleMs.Any(z => z.sRoleName == model.sRolename)) { return(new { Status = false, Message = "Role already exists" }); } else { data = new tblRoleM { iRoleId = model.iRoleId, sRoleName = model.sRolename, }; db.tblRoleMs.Add(data); db.SaveChanges(); return(new { Status = true, Message = "Role saved successfully!" }); } } else { if (db.tblRoleMs.Any(z => z.sRoleName == model.sRolename && z.iRoleId != model.iRoleId)) { return(new { Status = false, Message = "Role already exists" }); } else { data.iRoleId = model.iRoleId; data.sRoleName = model.sRolename; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(new { Status = true, Message = "Role saved successfully!" }); } } } }
//save Port public object SavePort(PortModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { if (db.tblPortMs.Any(z => z.iPortId != model.iPortId && z.sPortCode == model.sPortCode)) { return(new { Status = false, Message = "Port Code already exists." }); } var data = db.tblPortMs.Where(z => z.iPortId == model.iPortId).SingleOrDefault(); if (data != null) { data.sPortCode = model.sPortCode; data.sPortDescription = model.sPortDescription; data.sCountryCode = model.sCountryCode; data.SstateCode = model.SstateCode; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblPortM { sPortCode = model.sPortCode, sPortDescription = model.sPortDescription, sCountryCode = model.sCountryCode, SstateCode = model.SstateCode, }; db.tblPortMs.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Port saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save AmendmentDetailsMessageImlementation public object SaveAmendmentDetailsMessageImlementation(AmendmentDetailsMessageImlementationModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblAmendmentDetailsMessageImlementationMaps.Where(z => z.iAmendmentId == model.iAmendmentId).SingleOrDefault(); if (data != null) { data.iMessageImplementationId = model.iMessageImplementationId; data.sAmendRefNo = model.sAmendRefNo; data.sAmendFlag = model.sAmendFlag; data.sAmendType = model.sAmendType; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblAmendmentDetailsMessageImlementationMap { iMessageImplementationId = model.iMessageImplementationId, sAmendRefNo = model.sAmendRefNo, sAmendFlag = model.sAmendFlag, sAmendType = model.sAmendType, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblAmendmentDetailsMessageImlementationMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Amendment Details saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save PersonOnBoardMessageImplementation public object SavePersonOnBoardMessageImplementation(PersonOnBoardMessageImplementationModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblPersonOnBoardMessageImplementationMaps.Where(z => z.iPersonOnBoardId == model.iPersonOnBoardId).SingleOrDefault(); if (data != null) { data.iMessageImplementationId = model.iMessageImplementationId; data.dPersonOnBaordSeqNo = model.dPersonOnBaordSeqNo; data.sPersonDetailsPersonTypeCdd = model.sPersonDetailsPersonTypeCdd; data.sPersonDetailsPersonFamilyName = model.sPersonDetailsPersonFamilyName; data.sPersonDetailsPersonGivenName = model.sPersonDetailsPersonGivenName; data.sPersonDetailsPersonNationalityCdd = model.sPersonDetailsPersonNationalityCdd; data.dPersonDetailsPassengersInTransitIndicator = model.dPersonDetailsPassengersInTransitIndicator; data.sPersonDetailsCrewMemberRankOrRatingName = model.sPersonDetailsCrewMemberRankOrRatingName; data.sPersonDetailsCrewMemberRankOrRatingCdd = model.sPersonDetailsCrewMemberRankOrRatingCdd; data.sPersonDetailsPassangerPartOfEmbarkTnCdd = model.sPersonDetailsPassangerPartOfEmbarkTnCdd; data.sPersonDetailsPassangerPartOfEmbarkTnName = model.sPersonDetailsPassangerPartOfEmbarkTnName; data.sPersonDetailsPassangerPartOfDsmbarkTnCdd = model.sPersonDetailsPassangerPartOfDsmbarkTnCdd; data.sPersonDetailsPassangerPartOfDsmbarkTnName = model.sPersonDetailsPassangerPartOfDsmbarkTnName; data.sPersonDetailsPersonGenderCdd = model.sPersonDetailsPersonGenderCdd; data.dtPersonDetailsPersonDateOfBirth = model.dtPersonDetailsPersonDateOfBirth.ToDate(); data.sPersonDetailsPersonPlaceOfBirthName = model.sPersonDetailsPersonPlaceOfBirthName; data.sPersonDetailsPersonCountryOfBirthCdd = model.sPersonDetailsPersonCountryOfBirthCdd; data.dtPersonIdDocExpiryDate = model.dtPersonIdDocExpiryDate.ToDate(); data.sPersonIdOrTravelDocIssuingNationCdd = model.sPersonIdOrTravelDocIssuingNationCdd; data.sPersonIdOrTravelDocNo = model.sPersonIdOrTravelDocNo; data.sPersonIdOrTravelDocTypeCdd = model.sPersonIdOrTravelDocTypeCdd; data.sVisaDetailsPersonVisa = model.sVisaDetailsPersonVisa; data.sVisaDetailsPNRNo = model.sVisaDetailsPNRNo; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblPersonOnBoardMessageImplementationMap { iMessageImplementationId = model.iMessageImplementationId, dPersonOnBaordSeqNo = model.dPersonOnBaordSeqNo, sPersonDetailsPersonTypeCdd = model.sPersonDetailsPersonTypeCdd, sPersonDetailsPersonFamilyName = model.sPersonDetailsPersonFamilyName, sPersonDetailsPersonGivenName = model.sPersonDetailsPersonGivenName, sPersonDetailsPersonNationalityCdd = model.sPersonDetailsPersonNationalityCdd, dPersonDetailsPassengersInTransitIndicator = model.dPersonDetailsPassengersInTransitIndicator, sPersonDetailsCrewMemberRankOrRatingName = model.sPersonDetailsCrewMemberRankOrRatingName, sPersonDetailsCrewMemberRankOrRatingCdd = model.sPersonDetailsCrewMemberRankOrRatingCdd, sPersonDetailsPassangerPartOfEmbarkTnCdd = model.sPersonDetailsPassangerPartOfEmbarkTnCdd, sPersonDetailsPassangerPartOfEmbarkTnName = model.sPersonDetailsPassangerPartOfEmbarkTnName, sPersonDetailsPassangerPartOfDsmbarkTnCdd = model.sPersonDetailsPassangerPartOfDsmbarkTnCdd, sPersonDetailsPassangerPartOfDsmbarkTnName = model.sPersonDetailsPassangerPartOfDsmbarkTnName, sPersonDetailsPersonGenderCdd = model.sPersonDetailsPersonGenderCdd, dtPersonDetailsPersonDateOfBirth = model.dtPersonDetailsPersonDateOfBirth.ToDate(), sPersonDetailsPersonPlaceOfBirthName = model.sPersonDetailsPersonPlaceOfBirthName, sPersonDetailsPersonCountryOfBirthCdd = model.sPersonDetailsPersonCountryOfBirthCdd, dtPersonIdDocExpiryDate = model.dtPersonIdDocExpiryDate.ToDate(), sPersonIdOrTravelDocIssuingNationCdd = model.sPersonIdOrTravelDocIssuingNationCdd, sPersonIdOrTravelDocNo = model.sPersonIdOrTravelDocNo, sPersonIdOrTravelDocTypeCdd = model.sPersonIdOrTravelDocTypeCdd, sVisaDetailsPersonVisa = model.sVisaDetailsPersonVisa, sVisaDetailsPNRNo = model.sVisaDetailsPNRNo, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblPersonOnBoardMessageImplementationMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Person On Board saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save TransportEquipmentMasterConsignment public object SaveTransportEquipmentMasterConsignment(TransportEquipmentMasterConsignmentModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblTransportEquipmentMasterConsignmentMaps.Where(z => z.iTransporterEquipmentId == model.iTransporterEquipmentId).SingleOrDefault(); if (data != null) { data.iMasterConsignmentId = model.iMasterConsignmentId; data.iEquipmentSequenceNo = model.iEquipmentSequenceNo; data.sEquipmentId = model.sEquipmentId; data.sEquipmentType = model.sEquipmentType; data.sEquipmentSize = model.sEquipmentSize; data.sEquipmentLoadStatus = model.sEquipmentLoadStatus; data.sAdditionalEquipmentHold = model.sAdditionalEquipmentHold; data.sEquipmentSealType = model.sEquipmentSealType; data.sEquipmentSealNo = model.sEquipmentSealNo; data.sOtherEquipmentId = model.sOtherEquipmentId; data.sSOCFlag = model.sSOCFlag; data.sContainerAgentCd = model.sContainerAgentCd; data.iMessageImplementationId = model.iMessageImplementationId; data.dContainerWeight = model.dContainerWeight; data.dTotalNoOfPackages = model.dTotalNoOfPackages; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblTransportEquipmentMasterConsignmentMap { iMasterConsignmentId = model.iMasterConsignmentId, iEquipmentSequenceNo = model.iEquipmentSequenceNo, sEquipmentId = model.sEquipmentId, sEquipmentType = model.sEquipmentType, sEquipmentSize = model.sEquipmentSize, sEquipmentLoadStatus = model.sEquipmentLoadStatus, sAdditionalEquipmentHold = model.sAdditionalEquipmentHold, sEquipmentSealType = model.sEquipmentSealType, sEquipmentSealNo = model.sEquipmentSealNo, sOtherEquipmentId = model.sOtherEquipmentId, sSOCFlag = model.sSOCFlag, sContainerAgentCd = model.sContainerAgentCd, iMessageImplementationId = model.iMessageImplementationId, dContainerWeight = model.dContainerWeight, dTotalNoOfPackages = model.dTotalNoOfPackages, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblTransportEquipmentMasterConsignmentMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Transport Equipment saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save master Consigment public object SaveMasterConsigment(MasterConsignmentModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblMasterConsignmentMessageImplementationMaps.Where(z => z.iMasterConsignmentId == model.iMasterConsignmentId).SingleOrDefault(); if (data != null) { data.iMessageImplementationId = model.iMessageImplementationId; data.iMCRefLineNo = model.iMCRefLineNo; data.sMCRefMasterBillNo = model.sMCRefMasterBillNo; data.dtMCRefMasterBillDate = model.sMCRefMasterBillDate.ToDate(); data.sMCRefConsolidatedIndicator = model.sMCRefConsolidatedIndicator; data.sMCRefPreviousDeclaration = model.sMCRefPreviousDeclaration; data.sMCRefConsolidatorPan = model.sMCRefConsolidatorPan; data.sPrevRefCinType = model.sPrevRefCinType; data.sPrevRefMcinPcin = model.sPrevRefMcinPcin; data.sPrevRefCSNSubmtdType = model.sPrevRefCSNSubmtdType; data.sPrevRefCSNSubmtdBy = model.sPrevRefCSNSubmtdBy; data.sPrevRefCSNReportingType = model.sPrevRefCSNReportingType; data.sPrevRefCSNSiteId = model.sPrevRefCSNSiteId; data.iPrevRefCSNNo = model.iPrevRefCSNNo; data.dtPrevRefCSNDate = model.sPrevRefCSNDate.ToDate(); data.sPrevRefSplitIndicator = model.sPrevRefSplitIndicator; data.dPrevRefNoOfPackages = model.dPrevRefNoOfPackages; data.sPrevRefTypeOfPackage = model.sPrevRefTypeOfPackage; data.sLocCustomFirstPortOfEntry = model.sLocCustomFirstPortOfEntry; data.sLocCustomDestPort = model.sLocCustomDestPort; data.sLocCustomNextPortOfUnlanding = model.sLocCustomNextPortOfUnlanding; data.sLocCustomTypeOfCargo = model.sLocCustomTypeOfCargo; data.sLocCustomItemType = model.sLocCustomItemType; data.sLocCustomCargoMovement = model.sLocCustomCargoMovement; data.sLocCustomNatureOfCargo = model.sLocCustomNatureOfCargo; data.sLocCustomSplitIndicator = model.sLocCustomSplitIndicator; data.dLocCustomNoOfPackages = model.dLocCustomNoOfPackages; data.sLocCustomTypeOfPackage = model.sLocCustomTypeOfPackage; data.sTrnshprCd = model.sTrnshprCd; data.sTrnshprBond = model.sTrnshprBond; data.sTrnsprtrDocPortOfAcceptedCCd = model.sTrnsprtrDocPortOfAcceptedCCd; data.sTrnsprtrDocPortOfAcceptedName = model.sTrnsprtrDocPortOfAcceptedName; data.sTrnsprtrDocPortOfReceiptCcd = model.sTrnsprtrDocPortOfReceiptCcd; data.sTrnsprtrDocPortOfReceiptName = model.sTrnsprtrDocPortOfReceiptName; data.sTrnsprtrDocConsignorName = model.sTrnsprtrDocConsignorName; data.sTrnsprtrDocConsignorCd = model.sTrnsprtrDocConsignorCd; data.sTrnsprtrDocConsignorCdType = model.sTrnsprtrDocConsignorCdType; data.sTrnsprtrDocConsignorStreetAddress = model.sTrnsprtrDocConsignorStreetAddress; data.sTrnsprtrDocConsignorCity = model.sTrnsprtrDocConsignorCity; data.sTrnsprtrDocConsignorCountrySubDivName = model.sTrnsprtrDocConsignorCountrySubDivName; data.sTrnsprtrDocConsignorCountrySubDivCd = model.sTrnsprtrDocConsignorCountrySubDivCd; data.sTrnsprtrDocConsignorCountryCd = model.sTrnsprtrDocConsignorCountryCd; data.sTrnsprtrDocConsignorPostCd = model.sTrnsprtrDocConsignorPostCd; data.sTrnsprtrDocConsigneeName = model.sTrnsprtrDocConsigneeName; data.sTrnsprtrDocConsigneeCd = model.sTrnsprtrDocConsigneeCd; data.sTrnsprtrDocTypeOfCd = model.sTrnsprtrDocTypeOfCd; data.sTrnsprtrDocConsigneeStreetAddress = model.sTrnsprtrDocConsigneeStreetAddress; data.sTrnsprtrDocConsigneeCity = model.sTrnsprtrDocConsigneeCity; data.sTrnsprtrDocConsigneeCountrySubDivName = model.sTrnsprtrDocConsigneeCountrySubDivName; data.sTrnsprtrDocConsigneeCountrySubDiv = model.sTrnsprtrDocConsigneeCountrySubDiv; data.sTrnsprtrDocConsigneeCountryCd = model.sTrnsprtrDocConsigneeCountryCd; data.sTrnsprtrDocConsigneePostCd = model.sTrnsprtrDocConsigneePostCd; data.sTrnsprtrDocNameOfAnyOtherNotFdParty = model.sTrnsprtrDocNameOfAnyOtherNotFdParty; data.sTrnsprtrDocPANOfNotFdParty = model.sTrnsprtrDocPANOfNotFdParty; data.sTrnsprtrDocTypeOfNotFdPartyCd = model.sTrnsprtrDocTypeOfNotFdPartyCd; data.sTrnsprtrDocNotFdPartyStreetAddress = model.sTrnsprtrDocNotFdPartyStreetAddress; data.sTrnsprtrDocNotFdPartyCity = model.sTrnsprtrDocNotFdPartyCity; data.sTrnsprtrDocNotFdPartyCountrySubDivName = model.sTrnsprtrDocNotFdPartyCountrySubDivName; data.sTrnsprtrDocNotFdPartyCountrySubDiv = model.sTrnsprtrDocNotFdPartyCountrySubDiv; data.sTrnsprtrDocNotFdPartyCountryCd = model.sTrnsprtrDocNotFdPartyCountryCd; data.sTrnsprtrDocNotFdPartyPostCd = model.sTrnsprtrDocNotFdPartyPostCd; data.sTrnsprtrDocGoodsDescAsPerBill = model.sTrnsprtrDocGoodsDescAsPerBill; data.sTrnsprtrDocUCRType = model.sTrnsprtrDocUCRType; data.sTrnsprtrDocUCRCd = model.sTrnsprtrDocUCRCd; data.dTrnsprtrDocMsrNoOfPackages = model.dTrnsprtrDocMsrNoOfPackages; data.sTrnsprtrDocMsrTypesOfPackages = model.sTrnsprtrDocMsrTypesOfPackages; data.sTrnsprtrDocMsrMarksNoOnPackages = model.sTrnsprtrDocMsrMarksNoOnPackages; data.dTrnsprtrDocMsrGrossWeight = model.dTrnsprtrDocMsrGrossWeight; data.dTrnsprtrDocMsrNetWeight = model.dTrnsprtrDocMsrNetWeight; data.sTrnsprtrDocMsrUnitOfWeight = model.sTrnsprtrDocMsrUnitOfWeight; data.dTrnsprtrDocMsrGrossVolume = model.dTrnsprtrDocMsrGrossVolume; data.sTrnsprtrDocMsrUnitOfVolume = model.sTrnsprtrDocMsrUnitOfVolume; data.dTrnsprtrDocMsrInvoiceValueOfConsigment = model.dTrnsprtrDocMsrInvoiceValueOfConsigment; data.sTrnsprtrDocMsrCurrencyCd = model.sTrnsprtrDocMsrCurrencyCd; data.sSuplmntryDecCinType = model.sSuplmntryDecCinType; data.sSuplmntryDecMCinPCin = model.sSuplmntryDecMCinPCin; data.sSuplmntryDecCSNSubmtdType = model.sSuplmntryDecCSNSubmtdType; data.sSuplmntryDecCSNSubmtdBy = model.sSuplmntryDecCSNSubmtdBy; data.sSuplmntryDecCSNReportingType = model.sSuplmntryDecCSNReportingType; data.sSuplmntryDecCSNSiteId = model.sSuplmntryDecCSNSiteId; data.dSuplmntryDecCSNNo = model.dSuplmntryDecCSNNo; data.dtSuplmntryDecCSNDate = model.sSuplmntryDecCSNDate.ToDateTime(); data.sSuplmntryDecPrevMCIN = model.sSuplmntryDecPrevMCIN; data.sSuplmntryDecSplitIndicator = model.sSuplmntryDecSplitIndicator; data.dSuplmntryDecNoOfPackages = model.dSuplmntryDecNoOfPackages; data.sSuplmntryDecTypeOfPackages = model.sSuplmntryDecTypeOfPackages; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblMasterConsignmentMessageImplementationMap { iMessageImplementationId = model.iMessageImplementationId, iMCRefLineNo = model.iMCRefLineNo, sMCRefMasterBillNo = model.sMCRefMasterBillNo, dtMCRefMasterBillDate = model.sMCRefMasterBillDate.ToDate(), sMCRefConsolidatedIndicator = model.sMCRefConsolidatedIndicator, sMCRefPreviousDeclaration = model.sMCRefPreviousDeclaration, sMCRefConsolidatorPan = model.sMCRefConsolidatorPan, sPrevRefCinType = model.sPrevRefCinType, sPrevRefMcinPcin = model.sPrevRefMcinPcin, sPrevRefCSNSubmtdType = model.sPrevRefCSNSubmtdType, sPrevRefCSNSubmtdBy = model.sPrevRefCSNSubmtdBy, sPrevRefCSNReportingType = model.sPrevRefCSNReportingType, sPrevRefCSNSiteId = model.sPrevRefCSNSiteId, iPrevRefCSNNo = model.iPrevRefCSNNo, dtPrevRefCSNDate = model.sPrevRefCSNDate.ToDate(), sPrevRefSplitIndicator = model.sPrevRefSplitIndicator, dPrevRefNoOfPackages = model.dPrevRefNoOfPackages, sPrevRefTypeOfPackage = model.sPrevRefTypeOfPackage, sLocCustomFirstPortOfEntry = model.sLocCustomFirstPortOfEntry, sLocCustomDestPort = model.sLocCustomDestPort, sLocCustomNextPortOfUnlanding = model.sLocCustomNextPortOfUnlanding, sLocCustomTypeOfCargo = model.sLocCustomTypeOfCargo, sLocCustomItemType = model.sLocCustomItemType, sLocCustomCargoMovement = model.sLocCustomCargoMovement, sLocCustomNatureOfCargo = model.sLocCustomNatureOfCargo, sLocCustomSplitIndicator = model.sLocCustomSplitIndicator, dLocCustomNoOfPackages = model.dLocCustomNoOfPackages, sLocCustomTypeOfPackage = model.sLocCustomTypeOfPackage, sTrnshprCd = model.sTrnshprCd, sTrnshprBond = model.sTrnshprBond, sTrnsprtrDocPortOfAcceptedCCd = model.sTrnsprtrDocPortOfAcceptedCCd, sTrnsprtrDocPortOfAcceptedName = model.sTrnsprtrDocPortOfAcceptedName, sTrnsprtrDocPortOfReceiptCcd = model.sTrnsprtrDocPortOfReceiptCcd, sTrnsprtrDocPortOfReceiptName = model.sTrnsprtrDocPortOfReceiptName, sTrnsprtrDocConsignorName = model.sTrnsprtrDocConsignorName, sTrnsprtrDocConsignorCd = model.sTrnsprtrDocConsignorCd, sTrnsprtrDocConsignorCdType = model.sTrnsprtrDocConsignorCdType, sTrnsprtrDocConsignorStreetAddress = model.sTrnsprtrDocConsignorStreetAddress, sTrnsprtrDocConsignorCity = model.sTrnsprtrDocConsignorCity, sTrnsprtrDocConsignorCountrySubDivName = model.sTrnsprtrDocConsignorCountrySubDivName, sTrnsprtrDocConsignorCountrySubDivCd = model.sTrnsprtrDocConsignorCountrySubDivCd, sTrnsprtrDocConsignorCountryCd = model.sTrnsprtrDocConsignorCountryCd, sTrnsprtrDocConsignorPostCd = model.sTrnsprtrDocConsignorPostCd, sTrnsprtrDocConsigneeName = model.sTrnsprtrDocConsigneeName, sTrnsprtrDocConsigneeCd = model.sTrnsprtrDocConsigneeCd, sTrnsprtrDocTypeOfCd = model.sTrnsprtrDocTypeOfCd, sTrnsprtrDocConsigneeStreetAddress = model.sTrnsprtrDocConsigneeStreetAddress, sTrnsprtrDocConsigneeCity = model.sTrnsprtrDocConsigneeCity, sTrnsprtrDocConsigneeCountrySubDivName = model.sTrnsprtrDocConsigneeCountrySubDivName, sTrnsprtrDocConsigneeCountrySubDiv = model.sTrnsprtrDocConsigneeCountrySubDiv, sTrnsprtrDocConsigneeCountryCd = model.sTrnsprtrDocConsigneeCountryCd, sTrnsprtrDocConsigneePostCd = model.sTrnsprtrDocConsigneePostCd, sTrnsprtrDocNameOfAnyOtherNotFdParty = model.sTrnsprtrDocNameOfAnyOtherNotFdParty, sTrnsprtrDocPANOfNotFdParty = model.sTrnsprtrDocPANOfNotFdParty, sTrnsprtrDocTypeOfNotFdPartyCd = model.sTrnsprtrDocTypeOfNotFdPartyCd, sTrnsprtrDocNotFdPartyStreetAddress = model.sTrnsprtrDocNotFdPartyStreetAddress, sTrnsprtrDocNotFdPartyCity = model.sTrnsprtrDocNotFdPartyCity, sTrnsprtrDocNotFdPartyCountrySubDivName = model.sTrnsprtrDocNotFdPartyCountrySubDivName, sTrnsprtrDocNotFdPartyCountrySubDiv = model.sTrnsprtrDocNotFdPartyCountrySubDiv, sTrnsprtrDocNotFdPartyCountryCd = model.sTrnsprtrDocNotFdPartyCountryCd, sTrnsprtrDocNotFdPartyPostCd = model.sTrnsprtrDocNotFdPartyPostCd, sTrnsprtrDocGoodsDescAsPerBill = model.sTrnsprtrDocGoodsDescAsPerBill, sTrnsprtrDocUCRType = model.sTrnsprtrDocUCRType, sTrnsprtrDocUCRCd = model.sTrnsprtrDocUCRCd, dTrnsprtrDocMsrNoOfPackages = model.dTrnsprtrDocMsrNoOfPackages, sTrnsprtrDocMsrTypesOfPackages = model.sTrnsprtrDocMsrTypesOfPackages, sTrnsprtrDocMsrMarksNoOnPackages = model.sTrnsprtrDocMsrMarksNoOnPackages, dTrnsprtrDocMsrGrossWeight = model.dTrnsprtrDocMsrGrossWeight, dTrnsprtrDocMsrNetWeight = model.dTrnsprtrDocMsrNetWeight, sTrnsprtrDocMsrUnitOfWeight = model.sTrnsprtrDocMsrUnitOfWeight, dTrnsprtrDocMsrGrossVolume = model.dTrnsprtrDocMsrGrossVolume, sTrnsprtrDocMsrUnitOfVolume = model.sTrnsprtrDocMsrUnitOfVolume, dTrnsprtrDocMsrInvoiceValueOfConsigment = model.dTrnsprtrDocMsrInvoiceValueOfConsigment, sTrnsprtrDocMsrCurrencyCd = model.sTrnsprtrDocMsrCurrencyCd, sSuplmntryDecCinType = model.sSuplmntryDecCinType, sSuplmntryDecMCinPCin = model.sSuplmntryDecMCinPCin, sSuplmntryDecCSNSubmtdType = model.sSuplmntryDecCSNSubmtdType, sSuplmntryDecCSNSubmtdBy = model.sSuplmntryDecCSNSubmtdBy, sSuplmntryDecCSNReportingType = model.sSuplmntryDecCSNReportingType, sSuplmntryDecCSNSiteId = model.sSuplmntryDecCSNSiteId, dSuplmntryDecCSNNo = model.dSuplmntryDecCSNNo, dtSuplmntryDecCSNDate = model.sSuplmntryDecCSNDate.ToDateTime(), sSuplmntryDecPrevMCIN = model.sSuplmntryDecPrevMCIN, sSuplmntryDecSplitIndicator = model.sSuplmntryDecSplitIndicator, dSuplmntryDecNoOfPackages = model.dSuplmntryDecNoOfPackages, sSuplmntryDecTypeOfPackages = model.sSuplmntryDecTypeOfPackages, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblMasterConsignmentMessageImplementationMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "Master Consignment saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }
//save HouseCargo public object SaveHouseCargo(HouseCargoModel model, int iUserId) { try { using (var db = new SeaManifestEntities()) { var data = db.tblHouseCargoDescriptionMasterConsignmentMaps.Where(z => z.iHouseCargoDescId == model.iHouseCargoDescId).SingleOrDefault(); if (data != null) { data.iMessageImplementationId = model.iMessageImplementationId; data.iMasterConsignmentId = model.iMasterConsignmentId ?? 0; data.dHCRefSubLineNo = model.dHCRefSubLineNo; data.sHCRefBillNo = model.sHCRefBillNo; data.dtHCRefBillDate = model.sHCRefBillDate.ToDate(); data.sHCRefConsolidatedIndicator = model.sHCRefConsolidatedIndicator; data.sHCRefConsolidatorPan = model.sHCRefConsolidatorPan; data.sHCRefPreviousDescription = model.sHCRefPreviousDescription; data.sLocCstmFirstPortOfEntry = model.sLocCstmFirstPortOfEntry; data.sLocCstmDestinationPort = model.sLocCstmDestinationPort; data.sLocCstmNextPortOfUnlading = model.sLocCstmNextPortOfUnlading; data.sLocCstmTypeOfCargo = model.sLocCstmTypeOfCargo; data.sLocCstmItemType = model.sLocCstmItemType; data.sLocCstmCargoMovement = model.sLocCstmCargoMovement; data.sLocCstmNatureOfCargo = model.sLocCstmNatureOfCargo; data.sLocCstmSplitIndicator = model.sLocCstmSplitIndicator; data.dLocCstmNoOfPackages = model.dLocCstmNoOfPackages; data.sLocCstmTypeOfPakages = model.sLocCstmTypeOfPakages; data.sTrnshprTranshipperCd = model.sTrnshprTranshipperCd; data.sTrnshprTranshipperBond = model.sTrnshprTranshipperBond; data.sTrnsprtrDocPartyPortOfAcceptedCCd = model.sTrnsprtrDocPartyPortOfAcceptedCCd; data.sTrnsprtrDocPartyPortOfAcceptedName = model.sTrnsprtrDocPartyPortOfAcceptedName; data.sTrnsprtrDocPartyPortOfReceiptCcd = model.sTrnsprtrDocPartyPortOfReceiptCcd; data.sTrnsprtrDocPartyPortOfReceiptName = model.sTrnsprtrDocPartyPortOfReceiptName; data.sTrnsprtrDocPartyConsignorName = model.sTrnsprtrDocPartyConsignorName; data.sTrnsprtrDocPartyConsignorCd = model.sTrnsprtrDocPartyConsignorCd; data.sTrnsprtrDocPartyConsignorCdType = model.sTrnsprtrDocPartyConsignorCdType; data.sTrnsprtrDocPartyConsignorStreetAddress = model.sTrnsprtrDocPartyConsignorStreetAddress; data.sTrnsprtrDocPartyConsignorCity = model.sTrnsprtrDocPartyConsignorCity; data.sTrnsprtrDocPartyConsignorCountrySubDivName = model.sTrnsprtrDocPartyConsignorCountrySubDivName; data.sTrnsprtrDocPartyConsignorCountrySubDivCd = model.sTrnsprtrDocPartyConsignorCountrySubDivCd; data.sTrnsprtrDocPartyConsignorCountryCd = model.sTrnsprtrDocPartyConsignorCountryCd; data.sTrnsprtrDocPartyConsignorPostCd = model.sTrnsprtrDocPartyConsignorPostCd; data.sTrnsprtrDocPartyConsigneeName = model.sTrnsprtrDocPartyConsigneeName; data.sTrnsprtrDocPartyConsigneeCd = model.sTrnsprtrDocPartyConsigneeCd; data.sTrnsprtrDocPartyTypeOfCd = model.sTrnsprtrDocPartyTypeOfCd; data.sTrnsprtrDocPartyConsigneeStreetAddress = model.sTrnsprtrDocPartyConsigneeStreetAddress; data.sTrnsprtrDocPartyConsigneeCity = model.sTrnsprtrDocPartyConsigneeCity; data.sTrnsprtrDocPartyConsigneeCountrySubDivName = model.sTrnsprtrDocPartyConsigneeCountrySubDivName; data.sTrnsprtrDocPartyConsigneeCountrySubDiv = model.sTrnsprtrDocPartyConsigneeCountrySubDiv; data.sTrnsprtrDocPartyConsigneeCountryCd = model.sTrnsprtrDocPartyConsigneeCountryCd; data.sTrnsprtrDocPartyConsigneePostCd = model.sTrnsprtrDocPartyConsigneePostCd; data.sTrnsprtrDocPartyNameOfAnyOtherNotFdParty = model.sTrnsprtrDocPartyNameOfAnyOtherNotFdParty; data.sTrnsprtrDocPartyPANOfNotFdParty = model.sTrnsprtrDocPartyPANOfNotFdParty; data.sTrnsprtrDocPartyTypeOfNotFdPartyCd = model.sTrnsprtrDocPartyTypeOfNotFdPartyCd; data.sTrnsprtrDocPartyNotFdPartyStreetAddress = model.sTrnsprtrDocPartyNotFdPartyStreetAddress; data.sTrnsprtrDocPartyNotFdPartyCity = model.sTrnsprtrDocPartyNotFdPartyCity; data.sTrnsprtrDocPartyNotFdPartyCountrySubDivName = model.sTrnsprtrDocPartyNotFdPartyCountrySubDivName; data.sTrnsprtrDocPartyNotFdPartyCountrySubDiv = model.sTrnsprtrDocPartyNotFdPartyCountrySubDiv; data.sTrnsprtrDocPartyNotFdPartyCountryCd = model.sTrnsprtrDocPartyNotFdPartyCountryCd; data.sTrnsprtrDocPartyNotFdPartyPostCd = model.sTrnsprtrDocPartyNotFdPartyPostCd; data.sTrnsprtrDocPartyGoodsDescAsPerBill = model.sTrnsprtrDocPartyGoodsDescAsPerBill; data.sTrnsprtrDocPartyUCRType = model.sTrnsprtrDocPartyUCRType; data.sTrnsprtrDocPartyUCRCd = model.sTrnsprtrDocPartyUCRCd; data.dTrnsprtrDocMsrNoOfPackages = model.dTrnsprtrDocMsrNoOfPackages; data.sTrnsprtrDocMsrTypesOfPackages = model.sTrnsprtrDocMsrTypesOfPackages; data.sTrnsprtrDocMsrMarksNoOnPackages = model.sTrnsprtrDocMsrMarksNoOnPackages; data.dTrnsprtrDocMsrGrossWeight = model.dTrnsprtrDocMsrGrossWeight; data.dTrnsprtrDocMsrNetWeight = model.dTrnsprtrDocMsrNetWeight; data.sTrnsprtrDocMsrUnitOfWeight = model.sTrnsprtrDocMsrUnitOfWeight; data.dTrnsprtrDocMsrGrossVolume = model.dTrnsprtrDocMsrGrossVolume; data.sTrnsprtrDocMsrUnitOfVolume = model.sTrnsprtrDocMsrUnitOfVolume; data.dTrnsprtrDocMsrInvoiceValueOfConsigment = model.dTrnsprtrDocMsrInvoiceValueOfConsigment; data.sTrnsprtrDocMsrCurrencyCd = model.sTrnsprtrDocMsrCurrencyCd; data.iActionBy = iUserId; data.dtActionDate = DateTime.Now; db.Entry(data).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { data = new tblHouseCargoDescriptionMasterConsignmentMap { iMessageImplementationId = model.iMessageImplementationId, iMasterConsignmentId = model.iMasterConsignmentId ?? 0, dHCRefSubLineNo = model.dHCRefSubLineNo, sHCRefBillNo = model.sHCRefBillNo, dtHCRefBillDate = model.sHCRefBillDate.ToDate(), sHCRefConsolidatedIndicator = model.sHCRefConsolidatedIndicator, sHCRefConsolidatorPan = model.sHCRefConsolidatorPan, sHCRefPreviousDescription = model.sHCRefPreviousDescription, sLocCstmFirstPortOfEntry = model.sLocCstmFirstPortOfEntry, sLocCstmDestinationPort = model.sLocCstmDestinationPort, sLocCstmNextPortOfUnlading = model.sLocCstmNextPortOfUnlading, sLocCstmTypeOfCargo = model.sLocCstmTypeOfCargo, sLocCstmItemType = model.sLocCstmItemType, sLocCstmCargoMovement = model.sLocCstmCargoMovement, sLocCstmNatureOfCargo = model.sLocCstmNatureOfCargo, sLocCstmSplitIndicator = model.sLocCstmSplitIndicator, dLocCstmNoOfPackages = model.dLocCstmNoOfPackages, sLocCstmTypeOfPakages = model.sLocCstmTypeOfPakages, sTrnshprTranshipperCd = model.sTrnshprTranshipperCd, sTrnshprTranshipperBond = model.sTrnshprTranshipperBond, sTrnsprtrDocPartyPortOfAcceptedCCd = model.sTrnsprtrDocPartyPortOfAcceptedCCd, sTrnsprtrDocPartyPortOfAcceptedName = model.sTrnsprtrDocPartyPortOfAcceptedName, sTrnsprtrDocPartyPortOfReceiptCcd = model.sTrnsprtrDocPartyPortOfReceiptCcd, sTrnsprtrDocPartyPortOfReceiptName = model.sTrnsprtrDocPartyPortOfReceiptName, sTrnsprtrDocPartyConsignorName = model.sTrnsprtrDocPartyConsignorName, sTrnsprtrDocPartyConsignorCd = model.sTrnsprtrDocPartyConsignorCd, sTrnsprtrDocPartyConsignorCdType = model.sTrnsprtrDocPartyConsignorCdType, sTrnsprtrDocPartyConsignorStreetAddress = model.sTrnsprtrDocPartyConsignorStreetAddress, sTrnsprtrDocPartyConsignorCity = model.sTrnsprtrDocPartyConsignorCity, sTrnsprtrDocPartyConsignorCountrySubDivName = model.sTrnsprtrDocPartyConsignorCountrySubDivName, sTrnsprtrDocPartyConsignorCountrySubDivCd = model.sTrnsprtrDocPartyConsignorCountrySubDivCd, sTrnsprtrDocPartyConsignorCountryCd = model.sTrnsprtrDocPartyConsignorCountryCd, sTrnsprtrDocPartyConsignorPostCd = model.sTrnsprtrDocPartyConsignorPostCd, sTrnsprtrDocPartyConsigneeName = model.sTrnsprtrDocPartyConsigneeName, sTrnsprtrDocPartyConsigneeCd = model.sTrnsprtrDocPartyConsigneeCd, sTrnsprtrDocPartyTypeOfCd = model.sTrnsprtrDocPartyTypeOfCd, sTrnsprtrDocPartyConsigneeStreetAddress = model.sTrnsprtrDocPartyConsigneeStreetAddress, sTrnsprtrDocPartyConsigneeCity = model.sTrnsprtrDocPartyConsigneeCity, sTrnsprtrDocPartyConsigneeCountrySubDivName = model.sTrnsprtrDocPartyConsigneeCountrySubDivName, sTrnsprtrDocPartyConsigneeCountrySubDiv = model.sTrnsprtrDocPartyConsigneeCountrySubDiv, sTrnsprtrDocPartyConsigneeCountryCd = model.sTrnsprtrDocPartyConsigneeCountryCd, sTrnsprtrDocPartyConsigneePostCd = model.sTrnsprtrDocPartyConsigneePostCd, sTrnsprtrDocPartyNameOfAnyOtherNotFdParty = model.sTrnsprtrDocPartyNameOfAnyOtherNotFdParty, sTrnsprtrDocPartyPANOfNotFdParty = model.sTrnsprtrDocPartyPANOfNotFdParty, sTrnsprtrDocPartyTypeOfNotFdPartyCd = model.sTrnsprtrDocPartyTypeOfNotFdPartyCd, sTrnsprtrDocPartyNotFdPartyStreetAddress = model.sTrnsprtrDocPartyNotFdPartyStreetAddress, sTrnsprtrDocPartyNotFdPartyCity = model.sTrnsprtrDocPartyNotFdPartyCity, sTrnsprtrDocPartyNotFdPartyCountrySubDivName = model.sTrnsprtrDocPartyNotFdPartyCountrySubDivName, sTrnsprtrDocPartyNotFdPartyCountrySubDiv = model.sTrnsprtrDocPartyNotFdPartyCountrySubDiv, sTrnsprtrDocPartyNotFdPartyCountryCd = model.sTrnsprtrDocPartyNotFdPartyCountryCd, sTrnsprtrDocPartyNotFdPartyPostCd = model.sTrnsprtrDocPartyNotFdPartyPostCd, sTrnsprtrDocPartyGoodsDescAsPerBill = model.sTrnsprtrDocPartyGoodsDescAsPerBill, sTrnsprtrDocPartyUCRType = model.sTrnsprtrDocPartyUCRType, sTrnsprtrDocPartyUCRCd = model.sTrnsprtrDocPartyUCRCd, dTrnsprtrDocMsrNoOfPackages = model.dTrnsprtrDocMsrNoOfPackages, sTrnsprtrDocMsrTypesOfPackages = model.sTrnsprtrDocMsrTypesOfPackages, sTrnsprtrDocMsrMarksNoOnPackages = model.sTrnsprtrDocMsrMarksNoOnPackages, dTrnsprtrDocMsrGrossWeight = model.dTrnsprtrDocMsrGrossWeight, dTrnsprtrDocMsrNetWeight = model.dTrnsprtrDocMsrNetWeight, sTrnsprtrDocMsrUnitOfWeight = model.sTrnsprtrDocMsrUnitOfWeight, dTrnsprtrDocMsrGrossVolume = model.dTrnsprtrDocMsrGrossVolume, sTrnsprtrDocMsrUnitOfVolume = model.sTrnsprtrDocMsrUnitOfVolume, dTrnsprtrDocMsrInvoiceValueOfConsigment = model.dTrnsprtrDocMsrInvoiceValueOfConsigment, sTrnsprtrDocMsrCurrencyCd = model.sTrnsprtrDocMsrCurrencyCd, iActionBy = iUserId, dtActionDate = DateTime.Now, }; db.tblHouseCargoDescriptionMasterConsignmentMaps.Add(data); db.SaveChanges(); } return(new { Status = true, Message = "House Cargo saved successfully!" }); } } catch (Exception) { return(new { Status = false, Message = "Something went wrong" }); } }