...
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Back.Common;
|
||||
using Back.Data.Models;
|
||||
using Back.Services;
|
||||
using Back.Validations;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -36,6 +37,32 @@ namespace Back.Controllers
|
||||
return Ok(await _servCus.GetCustomers(user.RolUsers.First().CompanyID, itemSerch));
|
||||
|
||||
|
||||
}
|
||||
[HttpGet("GetCustomer/{ID}")]
|
||||
public async Task<ActionResult<RCustomer>> GetCustomer(int ID)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
var cus = await _servCus.GetCustomerByCustomerID(ID, user.RolUsers.First().CompanyID);
|
||||
return Ok(new RCustomer
|
||||
{
|
||||
Address = cus.Address,
|
||||
BranchID = cus.BranchID,
|
||||
CustomerType = cus.CustomerType,
|
||||
CustomerTypeTitle = cus.CustomerType.GetEnumDisplayName(),
|
||||
EconomicCode = cus.EconomicCode,
|
||||
Email = cus.Email,
|
||||
FullName = cus.FullName,
|
||||
ID = ID,
|
||||
Info = cus.Info,
|
||||
MeliCode = cus.MeliCode,
|
||||
PassportNumber = cus.PassportNumber,
|
||||
Phone = cus.Phone,
|
||||
ZipCode = cus.ZipCode
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
[HttpGet("GetAllForidName")]
|
||||
public async Task<ActionResult<List<ForCustomerSearch>>> GetAllForSearch()
|
||||
|
Reference in New Issue
Block a user