protected static FR_L3TX_GTOFTO_1006 Execute(DbConnection Connection, DbTransaction Transaction, P_L3TX_GTOFTO_1006 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L3TX_GTOFTO_1006();
            returnValue.Result = new L3TX_GTOFTO_1006();
            var item = new ORM_ACC_TAX_TaxOffice();
            returnValue.Result.TaxOffice = new L3TX_GTOFT_0914();
            var result = item.Load(Connection, Transaction, Parameter.ACC_TAX_TaxOfficeID);

            ORM_CMN_BPT_BusinessParticipant bparticipant = new ORM_CMN_BPT_BusinessParticipant();
            bparticipant.Load(Connection, Transaction, item.CMN_BPT_BusinessParticipant_RefID);
            returnValue.Result.TaxOffice.DisplayName = bparticipant.DisplayName;



            ORM_CMN_COM_CompanyInfo companyInfo = new ORM_CMN_COM_CompanyInfo();
            companyInfo.Load(Connection, Transaction, bparticipant.IfCompany_CMN_COM_CompanyInfo_RefID);

            ORM_CMN_UniversalContactDetail ucd = new ORM_CMN_UniversalContactDetail();
            ucd.Load(Connection, Transaction, companyInfo.Contact_UCD_RefID);

            returnValue.Result.TaxOffice.VATIdentificationNumber = companyInfo.VATIdentificationNumber;
            returnValue.Result.TaxOffice.ACC_TAX_TaxOfficeID     = item.ACC_TAX_TaxOfficeID;
            returnValue.Result.TaxOffice.Country_639_1_ISOCode   = ucd.Country_639_1_ISOCode;

            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
예제 #2
0
        protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L3TX_DTO_1148 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_Base();

            ORM_ACC_TAX_TaxOffice taxOffice = new ORM_ACC_TAX_TaxOffice();

            if (Parameter.ACC_TAX_TaxOfficeID != Guid.Empty)
            {
                var result = taxOffice.Load(Connection, Transaction, Parameter.ACC_TAX_TaxOfficeID);
                if (result.Status != FR_Status.Success || taxOffice.ACC_TAX_TaxOfficeID == Guid.Empty)
                {
                    var error = new FR_Guid();
                    error.ErrorMessage = "No Such ID.";
                    error.Status       = FR_Status.Error_Internal;
                    return(error);
                }
            }

            taxOffice.IsDeleted = true;
            taxOffice.Save(Connection, Transaction);

            ORM_CMN_BPT_BusinessParticipant.Query bptQuery = new ORM_CMN_BPT_BusinessParticipant.Query();
            bptQuery.CMN_BPT_BusinessParticipantID = taxOffice.CMN_BPT_BusinessParticipant_RefID;
            bptQuery.IsDeleted    = false;
            bptQuery.Tenant_RefID = securityTicket.TenantID;

            ORM_CMN_BPT_BusinessParticipant bparticipant = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, bptQuery).FirstOrDefault();
            bparticipant.IsDeleted = true;
            bparticipant.Save(Connection, Transaction);

            ORM_CMN_COM_CompanyInfo.Query cmpInfoQuery = new ORM_CMN_COM_CompanyInfo.Query();
            cmpInfoQuery.CMN_COM_CompanyInfoID = bparticipant.IfCompany_CMN_COM_CompanyInfo_RefID;
            cmpInfoQuery.IsDeleted             = false;
            cmpInfoQuery.Tenant_RefID          = securityTicket.TenantID;

            ORM_CMN_COM_CompanyInfo companyInfo = ORM_CMN_COM_CompanyInfo.Query.Search(Connection, Transaction, cmpInfoQuery).FirstOrDefault();
            companyInfo.IsDeleted = true;
            companyInfo.Save(Connection, Transaction);

            return(returnValue);

            #endregion UserCode
        }
예제 #3
0
        protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L3TX_STXO_0929 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            var item        = new ORM_ACC_TAX_TaxOffice();
            if (Parameter.ACC_TAX_TaxOfficeID != Guid.Empty)
            {
                var result = item.Load(Connection, Transaction, Parameter.ACC_TAX_TaxOfficeID);
                if (result.Status != FR_Status.Success || item.ACC_TAX_TaxOfficeID == Guid.Empty)
                {
                    var error = new FR_Guid();
                    error.ErrorMessage = "No Such ID";
                    error.Status       = FR_Status.Error_Internal;
                    return(error);
                }

                ORM_CMN_BPT_BusinessParticipant.Query bptQuery = new ORM_CMN_BPT_BusinessParticipant.Query();
                bptQuery.CMN_BPT_BusinessParticipantID = item.CMN_BPT_BusinessParticipant_RefID;
                bptQuery.Tenant_RefID = securityTicket.TenantID;
                bptQuery.IsDeleted    = false;

                ORM_CMN_BPT_BusinessParticipant bparticipant = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, bptQuery).FirstOrDefault();

                bparticipant.DisplayName = Parameter.DisplayName;
                bparticipant.Save(Connection, Transaction);

                ORM_CMN_COM_CompanyInfo.Query cmpInfoQuery = new ORM_CMN_COM_CompanyInfo.Query();
                cmpInfoQuery.CMN_COM_CompanyInfoID = bparticipant.IfCompany_CMN_COM_CompanyInfo_RefID;
                cmpInfoQuery.IsDeleted             = false;
                cmpInfoQuery.Tenant_RefID          = securityTicket.TenantID;

                ORM_CMN_COM_CompanyInfo companyInfo = ORM_CMN_COM_CompanyInfo.Query.Search(Connection, Transaction, cmpInfoQuery).FirstOrDefault();
                companyInfo.VATIdentificationNumber = Parameter.VATIdentificationNumber;
                companyInfo.Save(Connection, Transaction);
                returnValue.Result = item.ACC_TAX_TaxOfficeID;

                if (companyInfo.Contact_UCD_RefID != Guid.Empty)
                {
                    var countries = cls_Get_AllCountries.Invoke(Connection, Transaction, securityTicket).Result;

                    ORM_CMN_UniversalContactDetail.Query ucdQuery = new ORM_CMN_UniversalContactDetail.Query();
                    ucdQuery.CMN_UniversalContactDetailID = companyInfo.Contact_UCD_RefID;
                    ucdQuery.Tenant_RefID = securityTicket.TenantID;
                    ucdQuery.IsDeleted    = false;

                    ORM_CMN_UniversalContactDetail ucd = ORM_CMN_UniversalContactDetail.Query.Search(Connection, Transaction, ucdQuery).FirstOrDefault();
                    ucd.Country_639_1_ISOCode = Parameter.Country_ISO;
                    ucd.Save(Connection, Transaction);
                }
            }
            else
            {
                ORM_CMN_COM_CompanyInfo companyInfo = new ORM_CMN_COM_CompanyInfo();
                companyInfo.VATIdentificationNumber = Parameter.VATIdentificationNumber;
                companyInfo.Tenant_RefID            = securityTicket.TenantID;


                ORM_CMN_BPT_BusinessParticipant bparticipant = new ORM_CMN_BPT_BusinessParticipant();
                bparticipant.DisplayName = Parameter.DisplayName;
                bparticipant.IsCompany   = true;
                bparticipant.IfCompany_CMN_COM_CompanyInfo_RefID = companyInfo.CMN_COM_CompanyInfoID;
                bparticipant.Tenant_RefID = securityTicket.TenantID;
                bparticipant.Save(Connection, Transaction);

                ORM_ACC_TAX_TaxOffice taxOffice = new ORM_ACC_TAX_TaxOffice();
                taxOffice.CMN_BPT_BusinessParticipant_RefID = bparticipant.CMN_BPT_BusinessParticipantID;
                taxOffice.Tenant_RefID = securityTicket.TenantID;
                taxOffice.Save(Connection, Transaction);
                returnValue.Result = taxOffice.ACC_TAX_TaxOfficeID;

                if (Parameter.Country_ISO != "")
                {
                    var countries = cls_Get_AllCountries.Invoke(Connection, Transaction, securityTicket).Result;
                    ORM_CMN_UniversalContactDetail ucd = new ORM_CMN_UniversalContactDetail();
                    ucd.Country_639_1_ISOCode = Parameter.Country_ISO;
                    ucd.Tenant_RefID          = securityTicket.TenantID;
                    ucd.Save(Connection, Transaction);
                    companyInfo.Contact_UCD_RefID = ucd.CMN_UniversalContactDetailID;
                }

                companyInfo.Save(Connection, Transaction);
            }



            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
예제 #4
0
        protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L5EM_SETI_1657 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();

            ORM_CMN_BPT_EMP_Employee_TaxInformation taxInfo = new ORM_CMN_BPT_EMP_Employee_TaxInformation();
            if (Parameter.CMN_BPT_EMP_Employee_TaxInformationID != Guid.Empty)
            {
                var result = taxInfo.Load(Connection, Transaction, Parameter.CMN_BPT_EMP_Employee_TaxInformationID);
                if (result.Status != FR_Status.Success || taxInfo.CMN_BPT_EMP_Employee_TaxInformationID == Guid.Empty)
                {
                    var error = new FR_Guid();
                    error.ErrorMessage = "No Such ID";
                    error.Status       = FR_Status.Error_Internal;
                    return(error);
                }
            }

            taxInfo.Employee_RefID     = Parameter.EmployeeID;
            taxInfo.TaxNumber          = Parameter.TaxNumber;
            taxInfo.TaxClass           = Parameter.TaxClass;
            taxInfo.TaxExemptionAmount = Parameter.TaxExemptionAmount;
            taxInfo.Tenant_RefID       = securityTicket.TenantID;
            taxInfo.Save(Connection, Transaction);

            returnValue = new FR_Guid(taxInfo.CMN_BPT_EMP_Employee_TaxInformationID);

            ORM_CMN_PER_Person_2_Religion.Query person2ReligionQuery = new ORM_CMN_PER_Person_2_Religion.Query();
            person2ReligionQuery.CMN_PER_PersonInfo_RefID = Parameter.CMN_PER_PersonInfoID;
            person2ReligionQuery.CMN_PER_Religion_RefID   = Parameter.EmployeeID;
            person2ReligionQuery.IsDeleted    = false;
            person2ReligionQuery.Tenant_RefID = securityTicket.TenantID;

            List <ORM_CMN_PER_Person_2_Religion> person2ReligionList = ORM_CMN_PER_Person_2_Religion.Query.Search(Connection, Transaction, person2ReligionQuery);

            if (person2ReligionList.Count == 0)
            {
                ORM_CMN_PER_Person_2_Religion newPersonToReligion = new ORM_CMN_PER_Person_2_Religion();
                newPersonToReligion.CMN_PER_PersonInfo_RefID = Parameter.CMN_PER_PersonInfoID;
                newPersonToReligion.CMN_PER_Religion_RefID   = Parameter.ReligionID;
                newPersonToReligion.Tenant_RefID             = securityTicket.TenantID;

                newPersonToReligion.Save(Connection, Transaction);
            }
            else
            {
                ORM_CMN_PER_Person_2_Religion personToReligion = person2ReligionList.FirstOrDefault();
                personToReligion.CMN_PER_PersonInfo_RefID = Parameter.CMN_PER_PersonInfoID;
                personToReligion.CMN_PER_Religion_RefID   = Parameter.ReligionID;
                personToReligion.Save(Connection, Transaction);
            }

            ORM_ACC_TAX_TaxOffice taxOffice = new ORM_ACC_TAX_TaxOffice();
            taxOffice.Load(Connection, Transaction, Parameter.ACC_TAX_TaxOfficeID);
            if (taxOffice.ACC_TAX_TaxOfficeID == Guid.Empty)
            {
                return(returnValue);
            }

            ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant bpartAssociated = ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant.Query.Search(Connection, Transaction, new ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant.Query
            {
                BusinessParticipant_RefID = Parameter.CMN_BPT_BusinessParticipantID,
                Tenant_RefID = securityTicket.TenantID,
                IsDeleted    = false
            }).FirstOrDefault();
            if (bpartAssociated == null || bpartAssociated.CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID == Guid.Empty)
            {
                bpartAssociated = new ORM_CMN_BPT_BusinessParticipant_AssociatedBusinessParticipant();
            }
            bpartAssociated.AssociatedBusinessParticipant_RefID = taxOffice.CMN_BPT_BusinessParticipant_RefID;
            bpartAssociated.BusinessParticipant_RefID           = Parameter.CMN_BPT_BusinessParticipantID;
            bpartAssociated.Tenant_RefID = securityTicket.TenantID;
            bpartAssociated.Save(Connection, Transaction);


            return(returnValue);

            #endregion UserCode
        }