protected static FR_L2L_GSTfSTID_1427 Execute(DbConnection Connection, DbTransaction Transaction, P_L2L_GSTfSTID_1427 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_L2L_GSTfSTID_1427(); returnValue.Result = new L2L_GSTfSTID_1427(); //Put your code here var shipmentTypeID = Parameter.ShipmentTypeID; if (shipmentTypeID == Guid.Empty) { returnValue.Status = FR_Status.Error_Internal; returnValue.ErrorMessage = "ShipmentTypeID cannot be Guid empty!"; return(returnValue); } ORM_LOG_SHP_Shipment_Type orm_shipmentTYpe = new ORM_LOG_SHP_Shipment_Type(); orm_shipmentTYpe.Load(Connection, Transaction, shipmentTypeID); returnValue.Result.ORM_ShipmentType = orm_shipmentTYpe; return(returnValue); #endregion UserCode }
protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L2L_CoUST_1327 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 var defaultLanguage = cls_Get_Default_Language_For_Tenant.Invoke(Connection, Transaction, securityTicket).Result.DefaultLanguage.CMN_LanguageID; var shipmentTypeID = Parameter.ShipmentTypeID; if (shipmentTypeID == Guid.Empty) { returnValue.Status = FR_Status.Error_Internal; returnValue.ErrorMessage = "ShipmentTypeID cannot be Guid empty!"; return(returnValue); } ORM_LOG_SHP_Shipment_Type.Query orm_shipmentTypeQuery = new ORM_LOG_SHP_Shipment_Type.Query(); orm_shipmentTypeQuery.LOG_SHP_Shipment_TypeID = shipmentTypeID; orm_shipmentTypeQuery.Tenant_RefID = securityTicket.TenantID; orm_shipmentTypeQuery.IsDeleted = false; var exists = ORM_LOG_SHP_Shipment_Type.Query.Exists(Connection, Transaction, orm_shipmentTypeQuery); if (exists) //UPDATE { ORM_LOG_SHP_Shipment_Type orm_shipmentType = new ORM_LOG_SHP_Shipment_Type(); orm_shipmentType.Load(Connection, Transaction, shipmentTypeID); orm_shipmentType.ShipmentType_Name.UpdateEntry(defaultLanguage, Parameter.Name); orm_shipmentType.ShipmentType_Description.UpdateEntry(defaultLanguage, Parameter.Description); orm_shipmentType.Creation_Timestamp = DateTime.Now; orm_shipmentType.Save(Connection, Transaction); returnValue.Result = orm_shipmentType.LOG_SHP_Shipment_TypeID; } else // CREATE { ORM_LOG_SHP_Shipment_Type orm_shipmentType = new ORM_LOG_SHP_Shipment_Type(); orm_shipmentType.LOG_SHP_Shipment_TypeID = shipmentTypeID; orm_shipmentType.ShipmentType_Name = new Dict() { DictionaryID = Guid.NewGuid() }; orm_shipmentType.ShipmentType_Description = new Dict() { DictionaryID = Guid.NewGuid() }; orm_shipmentType.ShipmentType_Name.UpdateEntry(defaultLanguage, Parameter.Name); orm_shipmentType.ShipmentType_Description.UpdateEntry(defaultLanguage, Parameter.Description); orm_shipmentType.Tenant_RefID = securityTicket.TenantID; orm_shipmentType.Creation_Timestamp = DateTime.Now; orm_shipmentType.Save(Connection, Transaction); returnValue.Result = orm_shipmentType.LOG_SHP_Shipment_TypeID; } return(returnValue); #endregion UserCode }