Пример #1
0
        /// <summary>
        /// Deletes the companyProfile.
        /// </summary>
        /// <param name="companyProfile">The companyProfile.</param>
        /// <returns></returns>
        public string DeleteCompanyProfile(CompanyProfileEntity companyProfile)
        {
            const string sql = @"uspDelete_CompanyProfile";

            object[] parms = { "@LineID", companyProfile.LineId };
            return(Db.Delete(sql, true, parms));
        }
Пример #2
0
 public async Task UpdateCompanyFullProfile(IOperation operation, CompanyProfileEntity entity)
 {
     if (await userAuthenticationStore.IsUserExist(operation, entity.Email, entity.Id))
     {
         throw new Exception(ExceptionMessage.EmailHasAlreadyExist);
     }
     await companyProfileStore.UpdateCompanyProfile(operation, entity);
 }
Пример #3
0
 /// <summary>
 /// Takes the specified companyProfile.
 /// </summary>
 /// <param name="companyProfile">The companyProfile.</param>
 /// <returns></returns>
 private static object[] Take(CompanyProfileEntity companyProfile)
 {
     return(new object[]
     {
         "@LineID", companyProfile.LineId,
         "@AssetOwnArea", companyProfile.AssetOwnArea,
         "@AssetOwnRoom", companyProfile.AssetOwnRoom,
         "@AssetBuyDate", companyProfile.AssetBuyDate,
         "@AssetOwnDescription", companyProfile.AssetOwnDescription,
         "@AssetMutualArea", companyProfile.AssetMutualArea,
         "@AssetMutualRoom", companyProfile.AssetMutualRoom,
         "@AssetMutualMethod", companyProfile.AssetMutualMethod,
         "@AssetMutualDescription", companyProfile.AssetMutualDescription,
         "@AssetRentContractLen", companyProfile.AssetRentContractLen,
         "@AssetRentPrice", companyProfile.AssetRentPrice,
         "@AssetRentRoom", companyProfile.AssetRentRoom,
         "@AssetRentArea", companyProfile.AssetRentArea,
         "@AssetRentDescription", companyProfile.AssetRentDescription,
         "@AssetNumberOfCars", companyProfile.AssetNumberOfCars,
         "@AssetCarDetail", companyProfile.AssetCarDetail,
         "@EmployeePayrollsTotal", companyProfile.EmployeePayrollsTotal,
         "@EmployeeNumberOfWifeOrHusband", companyProfile.EmployeeNumberOfWifeOrHusband,
         "@EmployeeNumberOfOfficers", companyProfile.EmployeeNumberOfOfficers,
         "@EmployeeNumberOfStaff", companyProfile.EmployeeNumberOfStaff,
         "@EmployeeOtherCompany", companyProfile.EmployeeOtherCompany,
         "@EmployeeNumberOfSecondingOfficers", companyProfile.EmployeeNumberOfSecondingOfficers,
         "@EmployeeDetail", companyProfile.EmployeeDetail,
         "@EmployeeNumberOfRentLocal", companyProfile.EmployeeNumberOfRentLocal,
         "@ProfileAddress", companyProfile.ProfileAddress,
         "@ProfileFoundDate", companyProfile.ProfileFoundDate,
         "@ProfileHeadPhone", companyProfile.ProfileHeadPhone,
         "@ProfileAmbassadorName", companyProfile.ProfileAmbassadorName,
         "@ProfileAmbassadorPhone", companyProfile.ProfileAmbassadorPhone,
         "@ProfileAmbassadorStartDate", companyProfile.ProfileAmbassadorStartDate,
         "@ProfileAmbassadorFinishDate", companyProfile.ProfileAmbassadorFinishDate,
         "@ProfileAccountingManagerName", companyProfile.ProfileAccountingManagerName,
         "@ProfileAccountingManagerPhone", companyProfile.ProfileAccountingManagerPhone,
         "@ProfileAccountingManagerStartDate", companyProfile.ProfileAccountingManagerStartDate,
         "@ProfileAccountingManagerFinishDate", companyProfile.ProfileAccountingManagerFinishDate,
         "@ProfileAccountantName", companyProfile.ProfileAccountantName,
         "@ProfileAccountantPhone", companyProfile.ProfileAccountantPhone,
         "@ProfileAccountantStartDate", companyProfile.ProfileAccountantStartDate,
         "@ProfileAccountantFinishDate", companyProfile.ProfileAccountantFinishDate,
         "@ProfileMinimumSalary", companyProfile.ProfileMinimumSalary,
         "@ProfileSalaryGroup", companyProfile.ProfileSalaryGroup,
         "@ProfileWorkingArea", companyProfile.ProfileWorkingArea,
         "@ProfileCurrencyCodeFinalization", companyProfile.ProfileCurrencyCodeFinalization,
         "@ProfileServices", companyProfile.ProfileServices,
         "@ProfileReportHeader", companyProfile.ProfileReportHeader,
         "@ProfileBankName", companyProfile.ProfileBankName,
         "@ProfileBankAddress", companyProfile.ProfileBankAddress,
         "@ProfileBankAccount", companyProfile.ProfileBankAccount,
         "@ProfileBankCIF", companyProfile.ProfileBankCIF,
         "@OtherNote", companyProfile.OtherNote,
         "@NativeCategory", companyProfile.NativeCategory,
         "@ManagementArea", companyProfile.ManagementArea,
     });
 }
Пример #4
0
        public async Task UpdateCompanyProfile(IOperation operation, CompanyProfileEntity entity)
        {
            await operation.ExecuteAsync(entity, @"
                UPDATE cc
                SET
                    [Name] = @Name,
                    [Phone] = @Phone
                FROM [company].[Company] cc
                WHERE cc.[UserId] = @Id;

                UPDATE aiu
                SET [Email] = @Email
                FROM [company].[Company] cc
                INNER JOIN [authentication].[User] au ON cc.[UserId] = au.[Id]
                INNER JOIN [authentication].[InternalUser] aiu ON au.[InternalUserId] = aiu.[Id]
                WHERE cc.[UserId] = @Id;
            ");
        }
Пример #5
0
        /// <summary>
        /// Updates the companyProfile.
        /// </summary>
        /// <param name="companyProfile">The companyProfile.</param>
        /// <returns></returns>
        public string UpdateCompanyProfile(CompanyProfileEntity companyProfile)
        {
            const string sql = @"uspUpdate_CompanyProfile";

            return(Db.Update(sql, true, Take(companyProfile)));
        }
Пример #6
0
        /// <summary>
        /// Inserts the companyProfile.
        /// </summary>
        /// <param name="companyProfile">The companyProfile.</param>
        /// <returns></returns>
        public int InsertCompanyProfile(CompanyProfileEntity companyProfile)
        {
            const string sql = @"uspInsert_CompanyProfile";

            return(Db.Insert(sql, true, Take(companyProfile)));
        }