protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here var prioritiesQuery = new ORM_TMS_PRO_DeveloperTask_Priority.Query(); prioritiesQuery.IsDeleted = false; prioritiesQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_TMS_PRO_DeveloperTask_Priority> priorities = ORM_TMS_PRO_DeveloperTask_Priority.Query.Search(Connection, Transaction, prioritiesQuery).ToList(); if (priorities != null) { priorities = priorities.OrderBy(p => p.PriorityLevel).ToList(); for (int i = 0; i < priorities.Count; i++) { ORM_TMS_PRO_DeveloperTask_Priority p = priorities[i]; p.PriorityLevel = i; p.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5MC_CGMfMID_1513 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); var group = ORM_HEC_CMT_CommunityGroup.Query.Search(Connection, Transaction, new ORM_HEC_CMT_CommunityGroup.Query() { IsDeleted = false, Tenant_RefID = securityTicket.TenantID, IsPrivate = true, CommunityGroupCode = Parameter.GroupCode }).SingleOrDefault(); if (group != null) { var posibleCurrentAssignment = ORM_HEC_CMT_GroupSubscription.Query.Search(Connection, Transaction, new ORM_HEC_CMT_GroupSubscription.Query() { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, Membership_RefID = Parameter.HEC_CMT_MembershipID, CommunityGroup_RefID = group.HEC_CMT_CommunityGroupID }).ToArray(); returnValue.Result = posibleCurrentAssignment.Length > 0; } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_DO_RGPfP_1544 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here var allDoctorsFromPractice = cls_Get_DoctorIDs_for_PracticeID.Invoke(Connection, Transaction, new P_DO_GDIDsfPID_1635 { PracticeID = Parameter.PracticeID }, securityTicket).Result; foreach (var doctor in allDoctorsFromPractice) { cls_Save_Doctor_Grace_Period.Invoke(Connection, Transaction, new P_DO_SDGP_1639 { DoctorID = doctor.DoctorID, ResetGracePeriod = true }, securityTicket); } cls_Save_Practice_Grace_Period.Invoke(Connection, Transaction, new P_DO_SPGP_0942 { PracticeID = Parameter.PracticeID, ResetGracePeriod = true }, securityTicket); return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_DO_SPGP_0942 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); //Put your code here var practice = ORM_HEC_MedicalPractis.Query.Search(Connection, Transaction, new ORM_HEC_MedicalPractis.Query { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, HEC_MedicalPractiseID = Parameter.PracticeID }).SingleOrDefault(); if (practice != null) { var passwordGracePeriodGPM = ORM_HEC_MedicalPractice_UniversalProperty.Query.Search(Connection, Transaction, new ORM_HEC_MedicalPractice_UniversalProperty.Query { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, GlobalPropertyMatchingID = EGracePeriod.PracticeGracePeriod.Value() }).SingleOrDefault(); if (passwordGracePeriodGPM == null) { passwordGracePeriodGPM = new ORM_HEC_MedicalPractice_UniversalProperty() { Tenant_RefID = securityTicket.TenantID, GlobalPropertyMatchingID = EGracePeriod.PracticeGracePeriod.Value(), IsValue_String = true, PropertyName = String.Empty }; passwordGracePeriodGPM.Save(Connection, Transaction); } var passwordGracePeriodValue = ORM_HEC_MedicalPractice_2_UniversalProperty.Query.Search(Connection, Transaction, new ORM_HEC_MedicalPractice_2_UniversalProperty.Query { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, HEC_MedicalPractice_UniversalProperty_RefID = passwordGracePeriodGPM.HEC_MedicalPractice_UniversalPropertyID, HEC_MedicalPractice_RefID = practice.HEC_MedicalPractiseID }).SingleOrDefault(); if (passwordGracePeriodValue == null) { passwordGracePeriodValue = new ORM_HEC_MedicalPractice_2_UniversalProperty { Tenant_RefID = securityTicket.TenantID, HEC_MedicalPractice_UniversalProperty_RefID = passwordGracePeriodGPM.HEC_MedicalPractice_UniversalPropertyID, HEC_MedicalPractice_RefID = practice.HEC_MedicalPractiseID }; } passwordGracePeriodValue.Value_String = Parameter.ResetGracePeriod ? DateTime.MinValue.ToString("yyyy-MM-ddTHH:mm:ss") : DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"); passwordGracePeriodValue.Save(Connection, Transaction); returnValue.Result = true; } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5IN_SIJPSCaTI_1418 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); returnValue.Result = false; //Put your code here if (Parameter.InvJobProcessShelfID != null && Parameter.ProductTrackingInstanceID != null && Parameter.ShelfContentID != null) { var processShelfContent = new ORM_LOG_WRH_INJ_InventoryJob_Process_ShelfContent(); processShelfContent.LOG_WRH_INJ_InventoryJob_Process_ShelfContentID = Guid.NewGuid(); processShelfContent.LOG_WRH_INJ_InventoryJob_Process_Shelf_RefID = Parameter.InvJobProcessShelfID; processShelfContent.LOG_WRH_Shelf_Content_RefID = Parameter.ShelfContentID; processShelfContent.ExpectedQuantityOnShelfContent = Parameter.ShelfExpectedQuantity; processShelfContent.Tenant_RefID = securityTicket.TenantID; processShelfContent.Creation_Timestamp = DateTime.Now; processShelfContent.Save(Connection, Transaction); var shelfContentsTrackingInstance = new ORM_LOG_WRH_INJ_Process_ShelfContents_TrackingInstance(); shelfContentsTrackingInstance.ExpectedQuantityOnTrackingInstance = Parameter.TrackingInstanceExpectedQuantity; shelfContentsTrackingInstance.LOG_ProductTrackingInstance_RefID = Parameter.ProductTrackingInstanceID; shelfContentsTrackingInstance.LOG_WRH_INJ_Process_ShelfContents_TrackingInstanceID = Guid.NewGuid(); shelfContentsTrackingInstance.LOG_WRH_INJ_InventoryJob_Process_ShelfContent_RefID = processShelfContent.LOG_WRH_INJ_InventoryJob_Process_ShelfContentID; shelfContentsTrackingInstance.Tenant_RefID = securityTicket.TenantID; shelfContentsTrackingInstance.Creation_Timestamp = DateTime.Now; shelfContentsTrackingInstance.Save(Connection, Transaction); returnValue.Result = true; } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5AR_UAIDSF_1056 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); var product = new ORM_CMN_PRO_Product(); var result = product.Load(Connection, Transaction, Parameter.ProductID); if (result.Status != FR_Status.Success) { returnValue.Result = false; returnValue.Status = FR_Status.Error_Internal; return(returnValue); } product.IsProductPartOfDefaultStock = Parameter.IsProductPartOfDefaultStock; result = product.Save(Connection, Transaction); if (result.Status != FR_Status.Success) { returnValue.Result = false; returnValue.Status = FR_Status.Error_Internal; return(returnValue); } returnValue.Status = FR_Status.Success; returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3BA_CTBAfFY_1530 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); #region Retrieve all valid taxes var taxQuery = new CL1_ACC_TAX.ORM_ACC_TAX_Tax.Query { IsDeleted = false, Tenant_RefID = securityTicket.TenantID }; var taxes = CL1_ACC_TAX.ORM_ACC_TAX_Tax.Query.Search(Connection, Transaction, taxQuery).Select(x => x.ACC_TAX_TaxeID).ToArray(); #endregion #region Create tax booking account for retrieved taxes var taxParam = new P_L3BA_CTBAfT_1519 { BusinessParticipantID = Parameter.BusinessParticipantID, FiscalYearID = Parameter.FiscalYearID, TaxIDs = taxes }; cls_Create_Tax_Booking_Accounts_for_Taxes.Invoke(Connection, Transaction, taxParam, securityTicket); #endregion return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5AR_EASfPL_1301 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); //Put your code here returnValue.Result = false; var firstPredefinedLocation = ORM_LOG_WRH_Shelf_PredefinedProductLocation.Query.Search(Connection, Transaction, new ORM_LOG_WRH_Shelf_PredefinedProductLocation.Query { LOG_WRH_Shelf_PredefinedProductLocationID = Parameter.FirstPredefinedLocationID }).SingleOrDefault(); var secondPredefinedLocation = ORM_LOG_WRH_Shelf_PredefinedProductLocation.Query.Search(Connection, Transaction, new ORM_LOG_WRH_Shelf_PredefinedProductLocation.Query { LOG_WRH_Shelf_PredefinedProductLocationID = Parameter.SecondPredefinedLocationID }).SingleOrDefault(); var tempLocationPriority = firstPredefinedLocation.LocationPriority; firstPredefinedLocation.LocationPriority = secondPredefinedLocation.LocationPriority; secondPredefinedLocation.LocationPriority = tempLocationPriority; firstPredefinedLocation.Save(Connection, Transaction); secondPredefinedLocation.Save(Connection, Transaction); returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_CIEIM_1235 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); ORM_CMN_STR_Office_ResponsiblePerson.Query officeQuery = new ORM_CMN_STR_Office_ResponsiblePerson.Query(); officeQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; officeQuery.IsDeleted = false; if (ORM_CMN_STR_Office_ResponsiblePerson.Query.Exists(Connection, Transaction, officeQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query workAreaQuery = new ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query(); workAreaQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; workAreaQuery.IsDeleted = false; if (ORM_CMN_STR_PPS_WorkArea_ResponsiblePerson.Query.Exists(Connection, Transaction, workAreaQuery)) { returnValue.Result = true; } ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query workPlaceQuery = new ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query(); workPlaceQuery.CMN_BPT_EMP_Employee_RefID = Parameter.EmployeeID; workPlaceQuery.IsDeleted = false; if (ORM_CMN_STR_PPS_Workplace_ResponsiblePerson.Query.Exists(Connection, Transaction, workPlaceQuery)) { returnValue.Result = true; } //Put your code here return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5ACAAD_CAOUDA_1038 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here var queryParam = new ORM_CMN_BPT_CTM_OrganizationalUnit_Address.Query(); queryParam.IsDeleted = false; queryParam.IsPrimary = true; queryParam.Tenant_RefID = securityTicket.TenantID; queryParam.OrganizationalUnit_RefID = Parameter.OrganizationalUnitID; List <ORM_CMN_BPT_CTM_OrganizationalUnit_Address> addresses = ORM_CMN_BPT_CTM_OrganizationalUnit_Address.Query.Search(Connection, Transaction, queryParam); if (addresses != null) { foreach (var address in addresses) { address.IsPrimary = false; address.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5BL_CB_1313 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); foreach (var billHeaderID in Parameter.BillHeaderIDs) { #region Delete current status assignment var query = new CL1_BIL.ORM_BIL_BillHeader_2_BillStatus.Query(); query.BIL_BillHeader_RefID = billHeaderID; query.IsCurrentStatus = true; query.IsDeleted = false; query.Tenant_RefID = securityTicket.TenantID; var currentStatus = CL1_BIL.ORM_BIL_BillHeader_2_BillStatus.Query.Search(Connection, Transaction, query).Single(); currentStatus.IsCurrentStatus = false; currentStatus.Save(Connection, Transaction); #endregion #region Create new status - Closed var newStatus = new CL1_BIL.ORM_BIL_BillHeader_2_BillStatus(); newStatus.AssignmentID = Guid.NewGuid(); newStatus.BIL_BillHeader_RefID = billHeaderID; newStatus.IsCurrentStatus = true; #region Get status' ID closed by Global Property Matching ID var query2 = new CL1_BIL.ORM_BIL_BillStatus.Query(); query2.GlobalPropertyMatchingID = DLCore_DBCommons.Utils.EnumUtils.GetEnumDescription(DLCore_DBCommons.APODemand.EBillStatus.Closed); query2.IsDeleted = false; query2.Tenant_RefID = securityTicket.TenantID; var statusClosed = CL1_BIL.ORM_BIL_BillStatus.Query.Search(Connection, Transaction, query2).Single(); #endregion newStatus.BIL_BillStatus_RefID = statusClosed.BIL_BillStatusID; newStatus.Creation_Timestamp = DateTime.Now; newStatus.Tenant_RefID = securityTicket.TenantID; newStatus.Save(Connection, Transaction); #endregion #region Create bookings for bill on closing var param = new P_L3PY_CBfB_0959 { BillHeaderID = billHeaderID }; cls_Create_Bookings_for_Bill_on_Closing.Invoke(Connection, Transaction, param, securityTicket); #endregion } returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L2TI_CTIfT_1708 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); var init = ORM_APP_Initialization.Query.Search(Connection, Transaction, new ORM_APP_Initialization.Query() { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, Application_RefID = Parameter.AppID }).SingleOrDefault(); if (init != null) { returnValue.Result = init.IsInitializationComplete; } else { returnValue.Result = false; } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5AC_AA_1544 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); var bptUserPass = ORM_CMN_BPT_USR_User_Password.Query.Search(Connection, Transaction, new ORM_CMN_BPT_USR_User_Password.Query() { Tenant_RefID = securityTicket.TenantID, CMN_BPT_USR_User_RefID = Parameter.CMN_BPT_USR_UserID, IsDeleted = false, IsActive = false }).SingleOrDefault(); if (bptUserPass != null) { bptUserPass.IsActive = true; bptUserPass.Save(Connection, Transaction); } returnValue.Result = bptUserPass != null; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); var community = ORM_HEC_CMT_Community.Query.Search(Connection, Transaction, new ORM_HEC_CMT_Community.Query() { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, IsCommunityOperatedByThisTenant = true }).Single(); var catalogs = ORM_HEC_DIA_PotentialDiagnosis_Catalog.Query.Search(Connection, Transaction, new ORM_HEC_DIA_PotentialDiagnosis_Catalog.Query() { Tenant_RefID = securityTicket.TenantID, IsDeleted = false }).ToArray(); foreach (var catalog in catalogs) { var diagnosis = cls_Get_DiagnosesCatalog_for_CatalogID.Invoke(Connection, Transaction, new P_L5DI_GDCfCID_1555() { CatalogID = catalog.HEC_DIA_PotentialDiagnosis_CatalogID }, securityTicket).Result; // make file Guid documentId = Guid.Empty; var communityCatalog = ORM_HEC_CMT_OPT_Community_PotentialDiagnosisCatalog.Query.Search(Connection, Transaction, new ORM_HEC_CMT_OPT_Community_PotentialDiagnosisCatalog.Query() { Tenant_RefID = securityTicket.TenantID, IsDeleted = false, HEC_DIA_PotentialDiagnosis_Catalog_RefID = catalog.HEC_DIA_PotentialDiagnosis_CatalogID, Community_RefID = community.HEC_CMT_CommunityID }).SingleOrDefault(); if (communityCatalog == null) { communityCatalog = new ORM_HEC_CMT_OPT_Community_PotentialDiagnosisCatalog() { HEC_CMT_OPT_Community_PotentialDiagnosisCatalogID = Guid.NewGuid(), Community_RefID = community.HEC_CMT_CommunityID, Tenant_RefID = securityTicket.TenantID, HEC_DIA_PotentialDiagnosis_Catalog_RefID = catalog.HEC_DIA_PotentialDiagnosis_CatalogID }; } communityCatalog.PublishDate = DateTime.Now; communityCatalog.Version_Internal += 1; communityCatalog.Version_Display = communityCatalog.Version_Internal.ToString(); communityCatalog.PublicDownloadURL = documentId.ToString(); communityCatalog.Save(Connection, Transaction); } return(returnValue); #endregion UserCode }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5PA_SPED_1313 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw ex; } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3BA_CTBAfT_1519 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Create_Tax_Booking_Accounts_for_Taxes", ex); } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3SO_DARaUSHfPTIL_1159 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Delete_ActiveReservations_and_UpdateShipmentHeaders_for_ProductTrackingInstanceIDList", ex); } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5ACAAD_CAOUDA_1038 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Clear_All_OrganizationalUnit_Default_Addresses", ex); } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6ED_SEoBPQA_0819 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Save_Expired_or_Broken_Products_QuantityAdjustments", ex); } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6CN_SCNwSRaQCI_0739 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Save_CreditNotes_with_StockReceipts_and_QualityControlItems", ex); } return(functionReturn); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5IN_SIJPSCaTI_1418 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Save_InventoryJob_Process_ShelfContent_and_TrackingInstance", ex); } return(functionReturn); }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3BA_CBA_1141 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); #region Bank account var bankAccount = new CL1_ACC_BNK.ORM_ACC_BNK_BankAccount { ACC_BNK_BankAccountID = Guid.NewGuid(), Bank_RefID = Parameter.BankID, BankAccountType_RefID = Parameter.BankAccountTypeID, Currency_RefID = Parameter.CurrencyID, IBAN = Parameter.IBAN, IsValid = true, AccountOpenedAtDate = Parameter.OpenedAtDate, Tenant_RefID = securityTicket.TenantID }; bankAccount.Save(Connection, Transaction); #endregion #region Booking account var bookingAccountParam = new P_L3BA_CBA_1305 { FiscalYearID = Parameter.FiscalYearID, BookingAccountName = Parameter.BookingAccountName, BookingAccountNumber = Parameter.BookingAccountName }; Guid bookingAccountID = cls_Create_Booking_Account.Invoke(Connection, Transaction, bookingAccountParam, securityTicket).Result; #endregion #region Create Account assignment to booking account as "Bank Account" var accountAssignment = CL3_BookingAccounts.Utils.BookingAccountUtils.GetEmptyBankAccount(); accountAssignment.ACC_BOK_BookingAccounts_Purpose_BP_AssignmentID = Guid.NewGuid(); accountAssignment.BookingAccount_RefID = bookingAccountID; accountAssignment.BusinessParticipant_RefID = Parameter.BusinessParticipantID; accountAssignment.If_L3_AssetAccount_BankAccount_RefID = bankAccount.ACC_BNK_BankAccountID; accountAssignment.Tenant_RefID = securityTicket.TenantID; accountAssignment.Save(Connection, Transaction); #endregion returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5PS_SSSAB_1148 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here ORM_CMN_PRO_Product_SupplierAreaBinding.Query supplierAreaBindingQuery = new ORM_CMN_PRO_Product_SupplierAreaBinding.Query(); supplierAreaBindingQuery.CMN_PRO_Product_RefID = Parameter.ProductID; supplierAreaBindingQuery.Tenant_RefID = securityTicket.TenantID; supplierAreaBindingQuery.IsDeleted = false; List <ORM_CMN_PRO_Product_SupplierAreaBinding> supplierAreaBindingList = ORM_CMN_PRO_Product_SupplierAreaBinding.Query.Search(Connection, Transaction, supplierAreaBindingQuery); ORM_CMN_PRO_Product_SupplierAreaBinding supplierBinding; foreach (var binding in Parameter.SupplierSelectionAreasWithSuppliers) { if (supplierAreaBindingList.Any(i => i.LOG_REG_SupplierSelectionArea_RefID == binding.SupplierSelectionAreaID)) { // edit supplierBinding = supplierAreaBindingList.First(i => i.LOG_REG_SupplierSelectionArea_RefID == binding.SupplierSelectionAreaID); if (binding.SupplierID == Guid.Empty) { supplierBinding.Remove(Connection, Transaction); continue; } supplierBinding.CMN_BPT_Supplier_RefID = binding.SupplierID; supplierBinding.Save(Connection, Transaction); } else { if (binding.SupplierID == Guid.Empty) { continue; } // create new supplierBinding = new ORM_CMN_PRO_Product_SupplierAreaBinding(); supplierBinding.CMN_BPT_Supplier_RefID = binding.SupplierID; supplierBinding.CMN_PRO_Product_RefID = Parameter.ProductID; supplierBinding.Tenant_RefID = securityTicket.TenantID; supplierBinding.LOG_REG_SupplierSelectionArea_RefID = binding.SupplierSelectionAreaID; supplierBinding.IsDefault_ProductSupplier = binding.SupplierSelectionAreaID == Guid.Empty; supplierBinding.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L6SA_CCOaCOR_1732 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); Guid customerInteractionsId = Guid.Empty; if (Parameter.CustomerOrder != null && Parameter.CustomerOrder.Positions.Positions.Count() > 0) { #region Save Customer Order with Positions var resultCustomerOrder = cls_Save_CustomerOrder_Header_and_Positions.Invoke(Connection, Transaction, Parameter.CustomerOrder, securityTicket).Result; if (resultCustomerOrder != null) { customerInteractionsId = resultCustomerOrder.CustomerInteractionsId; } #endregion #region Save CustomerOrder Notes var businessParticipant = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, new ORM_CMN_BPT_BusinessParticipant.Query() { IfTenant_Tenant_RefID = securityTicket.TenantID, IsDeleted = false }).Single(); if (Parameter.CustomerOrderNotes != null) { Parameter.CustomerOrderNotes.CustomerOrderHeaderId = resultCustomerOrder.CustomerOrderHeaderId; Parameter.CustomerOrderNotes.CreatedByBusinessParticipantId = businessParticipant.CMN_BPT_BusinessParticipantID; var resultCustomerOrderNotes = cls_Save_CustomerOrderNotes_for_HeaderID.Invoke(Connection, Transaction, Parameter.CustomerOrderNotes, securityTicket); if (resultCustomerOrderNotes.Status != FR_Status.Success) { returnValue.Status = FR_Status.Error_Internal; returnValue.Result = false; } } #endregion } if (Parameter.CustomerOrderReturn != null && Parameter.CustomerOrderReturn.Positions.Count() > 0) { #region Save Customer Order Return with Positions Parameter.CustomerOrderReturn.CustomerInteractionId = customerInteractionsId; cls_Create_CustomerOrderReturn_with_Positions.Invoke(Connection, Transaction, Parameter.CustomerOrderReturn, securityTicket); #endregion } returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5PD_SDC_1531 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); returnValue.Result = true; //Put your code here ORM_CMN_PRO_DistributionCenter.Query distributionCentersQuery = new ORM_CMN_PRO_DistributionCenter.Query(); distributionCentersQuery.Product_RefID = Parameter.ProductID; distributionCentersQuery.Tenant_RefID = securityTicket.TenantID; distributionCentersQuery.IsDeleted = false; List <ORM_CMN_PRO_DistributionCenter> distributionCentersList = ORM_CMN_PRO_DistributionCenter.Query.Search(Connection, Transaction, distributionCentersQuery); ORM_CMN_PRO_DistributionCenter distributionCenter; foreach (var area in Parameter.DistributionAreasWithWarehouses) { if (distributionCentersList.Any(i => i.LOG_REG_DistributionArea_RefID == area.DistributionAreaID)) { // edit distributionCenter = distributionCentersList.First(i => i.LOG_REG_DistributionArea_RefID == area.DistributionAreaID); if (area.WarehouseID == Guid.Empty) { distributionCenter.Remove(Connection, Transaction); continue; } distributionCenter.Warehouse_RefID = area.WarehouseID; distributionCenter.Save(Connection, Transaction); } else { if (area.WarehouseID == Guid.Empty) { continue; } // create new distributionCenter = new ORM_CMN_PRO_DistributionCenter(); distributionCenter.Warehouse_RefID = area.WarehouseID; distributionCenter.Product_RefID = Parameter.ProductID; distributionCenter.Tenant_RefID = securityTicket.TenantID; distributionCenter.LOG_REG_DistributionArea_RefID = area.DistributionAreaID; distributionCenter.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3DT_SPDT_1644 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here foreach (P_L3DT_SPDT_1644a asgn in Parameter.Assignments) { var item = new CL1_TMS_PRO.ORM_TMS_PRO_Peers_Development(); if (asgn.AssignmentID != Guid.Empty) { var result = item.Load(Connection, Transaction, asgn.AssignmentID); if (result.Status != FR_Status.Success || item.AssignmentID == Guid.Empty) { var error = new FR_Bool(false); error.ErrorMessage = "No Such ID"; error.Status = FR_Status.Error_Internal; return(error); } } if (asgn.IsDeleted == true) { item.IsDeleted = true; } //Creation specific parameters (Tenant, Account ... ) if (asgn.AssignmentID == Guid.Empty) { item.Tenant_RefID = securityTicket.TenantID; item.ProjectMember_RefID = Parameter.AssignedBy_ProjectMemberID; } item.DeveloperTask_RefID = Parameter.DeveloperTask_RefID; item.ProjectMember_RefID = asgn.ProjectMember_RefID; item.Save(Connection, Transaction); } returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3BA_CCB_1646 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); #region Booking account var bookingAccount = new CL1_ACC_BOK.ORM_ACC_BOK_BookingAccount { ACC_BOK_BookingAccountID = Guid.NewGuid(), BookingAccountName = Parameter.BookingAccountName, BookingAccountNumber = "000001", FiscalYear_RefID = Parameter.FiscalYearID, Tenant_RefID = securityTicket.TenantID }; bookingAccount.Save(Connection, Transaction); #endregion #region Create Account assignment to booking account as "Bank Account" var accountAssignment = CL3_BookingAccounts.Utils.BookingAccountUtils.GetEmptyBankAccount(); accountAssignment.ACC_BOK_BookingAccounts_Purpose_BP_AssignmentID = Guid.NewGuid(); accountAssignment.BookingAccount_RefID = bookingAccount.ACC_BOK_BookingAccountID; accountAssignment.BusinessParticipant_RefID = Parameter.BusinessParticipantID; accountAssignment.Tenant_RefID = securityTicket.TenantID; accountAssignment.Save(Connection, Transaction); #endregion #region Bank account var bankAccount = new CL1_ACC_CBX.ORM_ACC_CBX_CashBox { ACC_CBX_CashBoxID = Guid.NewGuid(), CashBoxName = Parameter.BookingAccountName, CashBoxNumber = Parameter.CashBoxNumber, Currency_RefID = Parameter.CurrencyID, Tenant_RefID = securityTicket.TenantID }; bankAccount.Save(Connection, Transaction); #endregion returnValue.Result = true; return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5BL_SBPVBT_1153 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); //Put your code here foreach (var position in Parameter.BillPositions) { var billPosition = new CL1_BIL.ORM_BIL_BillPosition(); billPosition.Load(Connection, Transaction, position.BillPositionID); if (billPosition != null) { billPosition.PositionPricePerUnitValue_BeforeTax = position.ChangedPrice; billPosition.PositionValue_BeforeTax = position.ChangedPrice * billPosition.Quantity; var tax = CL1_ACC_TAX.ORM_ACC_TAX_Tax.Query.Search(Connection, Transaction, new CL1_ACC_TAX.ORM_ACC_TAX_Tax.Query { ACC_TAX_TaxeID = billPosition.ApplicableSalesTax_RefID, Tenant_RefID = securityTicket.TenantID, IsDeleted = false }).SingleOrDefault(); if (tax != null) { billPosition.PositionPricePerUnitValue_IncludingTax = MoneyUtils.CalculateGrossPriceForTaxInPercent(position.ChangedPrice, (decimal)tax.TaxRate); billPosition.PositionValue_IncludingTax = billPosition.PositionPricePerUnitValue_IncludingTax * billPosition.Quantity; } billPosition.Save(Connection, Transaction); var billHeader = new CL1_BIL.ORM_BIL_BillHeader(); billHeader.Load(Connection, Transaction, billPosition.BIL_BilHeader_RefID); var allPositionsForHeader = CL5_APOBilling_Bill.Complex.Retrieval.cls_Get_BillPositions_with_Articles_for_BillHeader.Invoke(Connection, Transaction, new P_L5BL_GBPwAfBH_1848 { BillHeaderID = billHeader.BIL_BillHeaderID }, securityTicket).Result; var billSumIncludeTax = allPositionsForHeader.Sum(x => x.BillPosition.PositionValue_IncludingTax); var billSumBeforeTax = allPositionsForHeader.Sum(x => x.BillPosition.PositionValue_BeforeTax); billHeader.TotalValue_BeforeTax = billSumBeforeTax; billHeader.TotalValue_IncludingTax = billSumIncludeTax; billHeader.Save(Connection, Transaction); } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_MD_CiAN_1313 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); //Put your code here var isQuickOrderActive = cls_Get_Practice_PropertyValue_for_PropertyName_and_PracticeID.Invoke(Connection, Transaction, new P_DO_GPPVfPNaPID_0916() { PracticeID = Parameter.PracticeID, PropertyName = "Quick order" }, securityTicket).Result; if (isQuickOrderActive != null && isQuickOrderActive.BooleanValue) { #region Get last saved grace period time var gracePeriodDuration = Convert.ToInt32(ConfigurationManager.AppSettings["gracePeriodDuration"]); var lastSavedGracePeriodTime = DateTime.MinValue; if (!Parameter.isPractice) { var doctororGracePeriod = cls_Get_Doctor_Grace_Period_Start_Time.Invoke(Connection, Transaction, new P_DO_GDGPST_1706 { DoctorID = Parameter.DoctorID }, securityTicket).Result; lastSavedGracePeriodTime = doctororGracePeriod != null?DateTime.Parse(doctororGracePeriod.PeriodStartAt) : DateTime.MinValue; } else { var practiceGracePeriod = cls_Get_Practice_Grace_Period_Start_Time.Invoke(Connection, Transaction, new P_DO_GPGPST_0959 { PracticeID = Parameter.PracticeID }, securityTicket).Result; lastSavedGracePeriodTime = practiceGracePeriod != null?DateTime.Parse(practiceGracePeriod.PeriodStartAt) : DateTime.MinValue; } #endregion if (lastSavedGracePeriodTime == DateTime.MinValue || lastSavedGracePeriodTime.AddMinutes(gracePeriodDuration) < DateTime.Now) { returnValue.Result = true; } else { returnValue.Result = false; } } return(returnValue); #endregion UserCode }
protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3OC_DOC_1705 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_Bool(); returnValue.Status = FR_Status.Error_Internal; var result = false; var orderCollective = ORM_OCL_OrderCollective.Query.Search( Connection, Transaction, new ORM_OCL_OrderCollective.Query() { OCL_OrderCollectiveID = Parameter.OCL_OrderCollectiveID, Tenant_RefID = securityTicket.TenantID, IsDeleted = false }).FirstOrDefault(); if (orderCollective != null) { var orderCollectiveMembers = ORM_OCL_OrderCollective_Member.Query.Search( Connection, Transaction, new ORM_OCL_OrderCollective_Member.Query() { OrderCollective_RefID = orderCollective.OCL_OrderCollectiveID, IsDeleted = false }); if (orderCollectiveMembers != null && orderCollectiveMembers.Count > 0) { foreach (var member in orderCollectiveMembers) { member.IsDeleted = true; member.Save(Connection, Transaction); } } orderCollective.IsDeleted = true; if (orderCollective.Save(Connection, Transaction).RowsUpdated > 0) { result = true; } } returnValue.Status = FR_Status.Success; returnValue.Result = result; return(returnValue); #endregion UserCode }