protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L2L_DSTfLP_1711 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Base(); //Put your code here var logisticProvider = new ORM_LOG_LogisticsProvider(); logisticProvider.Load(Connection, Transaction, Parameter.LogisticProviderID); ORM_CMN_BPT_AvailableShipmentType.Query shipmentType = new ORM_CMN_BPT_AvailableShipmentType.Query(); shipmentType.CMN_BPT_AvailableShipmentTypeID = Parameter.ShipmentTypeID; shipmentType.CMN_BPT_BusinessParticipant_RefID = logisticProvider.Ext_CMN_BPT_BusinessParticipant_RefID; shipmentType.Tenant_RefID = securityTicket.TenantID; var result = ORM_CMN_BPT_AvailableShipmentType.Query.SoftDelete(Connection, Transaction, shipmentType); if (result == 1) { returnValue.Status = FR_Status.Success; } else { returnValue.Status = FR_Status.Error_Internal; } return(returnValue); #endregion UserCode }
protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L5ZL_DLPaAST_1523 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Base(); //Put your code here ORM_LOG_LogisticsProvider logisticProvider = new ORM_LOG_LogisticsProvider(); logisticProvider.Load(Connection, Transaction, Parameter.LogisticProviderID); ORM_CMN_BPT_AvailableShipmentType.Query availableShipmentTypeQuery = new ORM_CMN_BPT_AvailableShipmentType.Query(); availableShipmentTypeQuery.CMN_BPT_BusinessParticipant_RefID = logisticProvider.Ext_CMN_BPT_BusinessParticipant_RefID; availableShipmentTypeQuery.Tenant_RefID = securityTicket.TenantID; availableShipmentTypeQuery.IsDeleted = false; // delete all shipment types for this logistic provider var numberOfDeletedTypes = ORM_CMN_BPT_AvailableShipmentType.Query.SoftDelete(Connection, Transaction, availableShipmentTypeQuery); // delete that logistic provider logisticProvider.IsDeleted = true; logisticProvider.Save(Connection, Transaction); return(returnValue); #endregion UserCode }
protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L3L_SLP_1114 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Guid(); //Put your code here // CREATE NEW if (Parameter.LogisticProviderID == Guid.Empty) { ORM_CMN_BPT_BusinessParticipant bp = new ORM_CMN_BPT_BusinessParticipant(); bp.CMN_BPT_BusinessParticipantID = Guid.NewGuid(); bp.DisplayName = Parameter.Name; bp.IsCompany = true; bp.Tenant_RefID = securityTicket.TenantID; bp.Save(Connection, Transaction); ORM_LOG_LogisticsProvider logisticProvider = new ORM_LOG_LogisticsProvider(); logisticProvider.LOG_LogisticsProviderID = Guid.NewGuid(); logisticProvider.Ext_CMN_BPT_BusinessParticipant_RefID = bp.CMN_BPT_BusinessParticipantID; logisticProvider.IsProviding_TransportServices = Parameter.IsProvidingTransportServices; logisticProvider.IsTrackingAvailable = Parameter.IsTrackingAvailable; logisticProvider.Tenant_RefID = securityTicket.TenantID; logisticProvider.Save(Connection, Transaction); returnValue.Result = logisticProvider.LOG_LogisticsProviderID; } // UPDATE EXISTING else { ORM_LOG_LogisticsProvider logisticProvider = new ORM_LOG_LogisticsProvider(); logisticProvider.Load(Connection, Transaction, Parameter.LogisticProviderID); logisticProvider.IsProviding_TransportServices = Parameter.IsProvidingTransportServices; logisticProvider.IsTrackingAvailable = Parameter.IsTrackingAvailable; logisticProvider.Save(Connection, Transaction); ORM_CMN_BPT_BusinessParticipant bp = new ORM_CMN_BPT_BusinessParticipant(); bp.Load(Connection, Transaction, logisticProvider.Ext_CMN_BPT_BusinessParticipant_RefID); bp.DisplayName = Parameter.Name; bp.Save(Connection, Transaction); returnValue.Result = Parameter.LogisticProviderID; } return(returnValue); #endregion UserCode }
protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L3L_SSTfLP_1404 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Guid(); //Put your code here ORM_LOG_LogisticsProvider logisticProvider1 = new ORM_LOG_LogisticsProvider(); logisticProvider1.Load(Connection, Transaction, Parameter.LogisticProviderID); ORM_CMN_BPT_AvailableShipmentType.Query queryShipmentTypes = new ORM_CMN_BPT_AvailableShipmentType.Query(); queryShipmentTypes.CMN_BPT_BusinessParticipant_RefID = logisticProvider1.Ext_CMN_BPT_BusinessParticipant_RefID; queryShipmentTypes.LOG_SHP_Shipment_Type_RefID = Parameter.ShipmentTypeID; queryShipmentTypes.Tenant_RefID = securityTicket.TenantID; queryShipmentTypes.IsDeleted = false; var shipmentTypeExists = ORM_CMN_BPT_AvailableShipmentType.Query.Exists(Connection, Transaction, queryShipmentTypes); if (shipmentTypeExists) { if (Parameter.IsPrimaryShipmentType) { ORM_CMN_BPT_AvailableShipmentType.Query queryST = new ORM_CMN_BPT_AvailableShipmentType.Query(); queryST.CMN_BPT_BusinessParticipant_RefID = logisticProvider1.Ext_CMN_BPT_BusinessParticipant_RefID; queryST.IsPrimaryShipmentType = true; queryST.Tenant_RefID = securityTicket.TenantID; ORM_CMN_BPT_AvailableShipmentType.Query querySTvalue = new ORM_CMN_BPT_AvailableShipmentType.Query(); querySTvalue.IsPrimaryShipmentType = false; ORM_CMN_BPT_AvailableShipmentType.Query.Update(Connection, Transaction, queryST, querySTvalue); } var availableShipmentType = ORM_CMN_BPT_AvailableShipmentType.Query.Search(Connection, Transaction, queryShipmentTypes); var availableShipmentTypeID = availableShipmentType.Select(x => x.CMN_BPT_AvailableShipmentTypeID).FirstOrDefault(); ORM_CMN_BPT_AvailableShipmentType shipmentType = new ORM_CMN_BPT_AvailableShipmentType(); shipmentType.Load(Connection, Transaction, availableShipmentTypeID); shipmentType.IsPrimaryShipmentType = Parameter.IsPrimaryShipmentType; shipmentType.Save(Connection, Transaction); returnValue.Result = availableShipmentTypeID; } else { if (Parameter.IsPrimaryShipmentType) { ORM_CMN_BPT_AvailableShipmentType.Query queryST = new ORM_CMN_BPT_AvailableShipmentType.Query(); queryST.CMN_BPT_BusinessParticipant_RefID = logisticProvider1.Ext_CMN_BPT_BusinessParticipant_RefID; queryST.IsPrimaryShipmentType = true; queryST.Tenant_RefID = securityTicket.TenantID; ORM_CMN_BPT_AvailableShipmentType.Query querySTvalue = new ORM_CMN_BPT_AvailableShipmentType.Query(); querySTvalue.IsPrimaryShipmentType = false; ORM_CMN_BPT_AvailableShipmentType.Query.Update(Connection, Transaction, queryST, querySTvalue); } ORM_LOG_LogisticsProvider logisticProvider = new ORM_LOG_LogisticsProvider(); logisticProvider.Load(Connection, Transaction, Parameter.LogisticProviderID); ORM_CMN_BPT_AvailableShipmentType newShipmentType = new ORM_CMN_BPT_AvailableShipmentType(); newShipmentType.CMN_BPT_AvailableShipmentTypeID = Guid.NewGuid(); newShipmentType.CMN_BPT_BusinessParticipant_RefID = logisticProvider.Ext_CMN_BPT_BusinessParticipant_RefID; newShipmentType.LOG_SHP_Shipment_Type_RefID = Parameter.ShipmentTypeID; newShipmentType.IsPrimaryShipmentType = Parameter.IsPrimaryShipmentType; newShipmentType.Tenant_RefID = securityTicket.TenantID; newShipmentType.Save(Connection, Transaction); returnValue.Result = newShipmentType.CMN_BPT_AvailableShipmentTypeID; } return(returnValue); #endregion UserCode }