Merge branch 'develop' into feature/privacy-rooms-page

This commit is contained in:
Nikita Gopienko 2021-06-28 09:10:44 +03:00
commit 0fec9b3587
10 changed files with 78 additions and 14 deletions

View File

@ -160,11 +160,14 @@ namespace ASC.CRM.Api
[Create(@"contact/{contactid:int}/data")]
public ContactInfoDto CreateContactInfo(
[FromRoute] int contactid,
[FromForm] ContactInfoType infoType,
[FromForm] string data,
[FromForm] bool isPrimary,
[FromForm] string category)
[FromBody] CreateContactInfoRequestDto inDto)
{
var data = inDto.Data;
var infoType = inDto.InfoType;
var category = inDto.Category;
var isPrimary = inDto.IsPrimary;
if (string.IsNullOrEmpty(data) || contactid <= 0) throw new ArgumentException();
var contact = _daoFactory.GetContactDao().GetByID(contactid);
if (contact == null) throw new ItemNotFoundException();

View File

@ -1910,8 +1910,11 @@ namespace ASC.CRM.Api
/// <visible>false</visible>
[Create(@"contact/mailsmtp/preview")]
public string GetMailSMTPToContactsPreview([FromForm] string template, [FromForm] int contactId)
public string GetMailSMTPToContactsPreview([FromBody] GetMailSMTPToContactsPreviewRequestDto inDto)
{
var contactId = inDto.ContactId;
var template = inDto.Template;
if (contactId == 0 || String.IsNullOrEmpty(template)) throw new ArgumentException();
var manager = new MailTemplateManager(_daoFactory);

View File

@ -131,10 +131,13 @@ namespace ASC.CRM.Api
/// <returns></returns>
[Create(@"currency/rates")]
public CurrencyRateDto CreateCurrencyRate(
[FromForm] string fromCurrency,
[FromForm] string toCurrency,
[FromForm] decimal rate)
[FromBody] CreateCurrencyRateRequestDto inDto)
{
var rate = inDto.Rate;
var fromCurrency = inDto.FromCurrency;
var toCurrency = inDto.ToCurrency;
ValidateRate(rate);
ValidateCurrencies(new[] { fromCurrency, toCurrency });

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ASC.CRM.Core.Enums;
using Microsoft.AspNetCore.Mvc;
namespace ASC.CRM.ApiModels
{
public class CreateContactInfoRequestDto
{
public ContactInfoType InfoType { get; set; }
public string Data { get; set; }
public bool IsPrimary { get; set; }
public string Category { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace ASC.CRM.ApiModels
{
public class CreateCurrencyRateRequestDto
{
public string FromCurrency { get; set; }
public string ToCurrency { get; set; }
public decimal Rate { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace ASC.CRM.ApiModels
{
public class GetMailSMTPToContactsPreviewRequestDto
{
public String Template { get; set; }
public int ContactId { get; set; }
}
}

View File

@ -256,7 +256,8 @@ namespace ASC.CRM.Core.Dao
{
Content = Convert.ToBase64String(bytes),
CreateOn = DateTime.UtcNow,
CreateBy = _securityContext.CurrentAccount.ID.ToString()
CreateBy = _securityContext.CurrentAccount.ID.ToString(),
TenantId = TenantID
};
CrmDbContext.OrganisationLogo.Add(dbEntity);

View File

@ -295,7 +295,8 @@ namespace ASC.CRM.Core.Dao
CrmDbContext.Cases.RemoveRange(caseses.ConvertAll(x => new DbCase
{
Id = x.ID
Id = x.ID,
TenantId = TenantID
}));
CrmDbContext.SaveChanges();

View File

@ -1405,7 +1405,8 @@ namespace ASC.CRM.Core.Dao
DisplayName = displayName,
IsShared = contact.ShareType,
ContactTypeId = contact.ContactTypeID,
Currency = contact.Currency
Currency = contact.Currency,
TenantId = TenantID
};
CrmDbContext.Contacts.Add(itemToInsert);
@ -1859,7 +1860,8 @@ namespace ASC.CRM.Core.Dao
CrmDbContext.Contacts.Remove(new DbContact
{
Id = fromContactID
Id = fromContactID,
TenantId = TenantID
});
CrmDbContext.SaveChanges();

View File

@ -254,7 +254,8 @@ namespace ASC.CRM.Core.Dao
var dbTag = new DbTag
{
Title = tagName,
EntityType = entityType
EntityType = entityType,
TenantId = TenantID
};
CrmDbContext.Tags.Add(dbTag);