Added Notification And Cargo request
This commit is contained in:
parent
9a69b818bd
commit
865c48fff2
|
|
@ -21,8 +21,8 @@ public class JwtTokenProviderService : IAuthenticationTokenProvider {
|
||||||
if(result.Succeeded) {
|
if(result.Succeeded) {
|
||||||
var issuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["Authentication:Jwt:IssuerSigningKey"]));
|
var issuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["Authentication:Jwt:IssuerSigningKey"]));
|
||||||
var token = new JwtSecurityToken(
|
var token = new JwtSecurityToken(
|
||||||
//issuer: configuration["Authentication:Jwt:Issuer"],
|
issuer: configuration["Authentication:Jwt:Issuer"],
|
||||||
//audience: configuration["Authentication:Jwt:Audience"],
|
audience: configuration["Authentication:Jwt:Audience"],
|
||||||
claims: result.Principal.Claims,
|
claims: result.Principal.Claims,
|
||||||
expires: DateTime.Now.AddDays(2),
|
expires: DateTime.Now.AddDays(2),
|
||||||
signingCredentials: new SigningCredentials(issuerSigningKey, SecurityAlgorithms.HmacSha256)
|
signingCredentials: new SigningCredentials(issuerSigningKey, SecurityAlgorithms.HmacSha256)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
using DevExpress.ExpressApp.Core;
|
using DevExpress.ExpressApp.Core;
|
||||||
using DevExpress.ExpressApp.Security;
|
|
||||||
using DevExpress.ExpressApp.WebApi.Services;
|
|
||||||
using DurnyklyYol.Blazor.Server.DTO;
|
using DurnyklyYol.Blazor.Server.DTO;
|
||||||
using DurnyklyYol.Module.BusinessObjects;
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace DurnyklyYol.Blazor.Server.Controllers
|
namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
|
|
@ -34,10 +30,10 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
.Where(wh => wh.Oid == cargo.Route.Oid)
|
.Where(wh => wh.Oid == cargo.Route.Oid)
|
||||||
.Select(sl => new
|
.Select(sl => new
|
||||||
{
|
{
|
||||||
StartName = sl.StartPoint.Name,
|
//StartName = sl.StartPoint.Name,
|
||||||
Startpoint = sl.StartPoint.Point,
|
//Startpoint = sl.StartPoint.Point,
|
||||||
DestName = sl.DestinationPoint.Name,
|
//DestName = sl.DestinationPoint.Name,
|
||||||
Destpoint = sl.DestinationPoint.Point,
|
//Destpoint = sl.DestinationPoint.Point,
|
||||||
Points = sl.Points.OrderBy(ob => ob.Order).Select(p => p.Point)
|
Points = sl.Points.OrderBy(ob => ob.Order).Select(p => p.Point)
|
||||||
})
|
})
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
@ -56,24 +52,23 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
points.Insert(0, new PointDto
|
//points.Insert(0, new PointDto
|
||||||
{
|
//{
|
||||||
Name = route.StartName,
|
// //Name = route.StartName,
|
||||||
Lat = route.Startpoint?.Latitude ?? 0,
|
// //Lat = route.Startpoint?.Latitude ?? 0,
|
||||||
Long = route.Startpoint?.Longitude ?? 0,
|
// //Long = route.Startpoint?.Longitude ?? 0,
|
||||||
IsCurrent = cargo.CurrentPoint.Oid == route.Startpoint?.Oid,
|
// //IsCurrent = cargo.CurrentPoint.Oid == route.Startpoint?.Oid,
|
||||||
DateAt = cargo.StartedAt
|
// DateAt = cargo.StartedAt
|
||||||
});
|
//});
|
||||||
|
|
||||||
points.Add(new PointDto
|
|
||||||
{
|
|
||||||
Name = route.DestName,
|
|
||||||
Lat = route.Destpoint?.Latitude ?? 0,
|
|
||||||
Long = route.Destpoint?.Longitude ?? 0,
|
|
||||||
IsCurrent = cargo.CurrentPoint.Oid == route.Destpoint?.Oid,
|
|
||||||
DateAt = cargo.ArrivedAt
|
|
||||||
});
|
|
||||||
|
|
||||||
|
//points.Add(new PointDto
|
||||||
|
//{
|
||||||
|
// //Name = route.DestName,
|
||||||
|
// //Lat = route.Destpoint?.Latitude ?? 0,
|
||||||
|
// //Long = route.Destpoint?.Longitude ?? 0,
|
||||||
|
// //IsCurrent = cargo.CurrentPoint.Oid == route.Destpoint?.Oid,
|
||||||
|
// DateAt = cargo.ArrivedAt
|
||||||
|
//});
|
||||||
|
|
||||||
return Ok(points);
|
return Ok(points);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,149 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using DevExpress.ExpressApp.Security;
|
using DevExpress.ExpressApp.Security;
|
||||||
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
|
|
||||||
using DevExpress.ExpressApp;
|
|
||||||
using DevExpress.ExpressApp.SystemModule;
|
|
||||||
using DevExpress.Persistent.Base;
|
|
||||||
using DevExpress.ExpressApp.WebApi;
|
|
||||||
using System.Linq;
|
|
||||||
using DevExpress.ExpressApp.Core;
|
using DevExpress.ExpressApp.Core;
|
||||||
using DurnyklyYol.Module.BusinessObjects;
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using DevExpress.ExpressApp.WebApi.Services;
|
using DevExpress.ExpressApp.WebApi.Services;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using DevExpress.Data.Filtering;
|
||||||
|
using DurnyklyYol.Blazor.Server.DTO;
|
||||||
|
|
||||||
namespace DurnyklyYol.Blazor.Server.Controllers
|
namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[Authorize]
|
|
||||||
public class ClientController : Microsoft.AspNetCore.Mvc.ControllerBase
|
public class ClientController : Microsoft.AspNetCore.Mvc.ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IDataService dataService;
|
private readonly IDataService dataService;
|
||||||
private readonly ISecurityProvider securityProvider;
|
private readonly ISecurityProvider securityProvider;
|
||||||
|
private readonly INonSecuredObjectSpaceFactory _nonSecuredObjectSpaceFactory;
|
||||||
public ClientController(IDataService dataService, ISecurityProvider securityProvider)
|
public ClientController(
|
||||||
|
IDataService dataService,
|
||||||
|
ISecurityProvider securityProvider,
|
||||||
|
INonSecuredObjectSpaceFactory nonSecuredObjectSpaceFactory
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.dataService = dataService;
|
this.dataService = dataService;
|
||||||
this.securityProvider = securityProvider;
|
this.securityProvider = securityProvider;
|
||||||
|
this._nonSecuredObjectSpaceFactory = nonSecuredObjectSpaceFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost(nameof(Register))]
|
||||||
|
[SwaggerOperation("Register account")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string) )] // Success response
|
||||||
|
[ProducesResponseType(StatusCodes.Status409Conflict, Type = typeof(string))] // Conflict response
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(string))]
|
||||||
|
public async Task<IActionResult> Register([FromForm] RegisterDto registerDto)
|
||||||
|
{
|
||||||
|
// Validate input
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
return BadRequest(ModelState);
|
||||||
|
}
|
||||||
|
// Check if dataService is null
|
||||||
|
if (dataService == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Data service is not available");
|
||||||
|
}
|
||||||
|
using var objectSpace = _nonSecuredObjectSpaceFactory.CreateNonSecuredObjectSpace(typeof(ApplicationUser));
|
||||||
|
//var objectSpace = dataService.GetObjectSpace(typeof(ApplicationUser));
|
||||||
|
// Check if username already exists
|
||||||
|
|
||||||
|
var existingUser = objectSpace.FindObject<ApplicationUser>(CriteriaOperator.Parse("UserName == ?", registerDto.Username));
|
||||||
|
if (existingUser != null)
|
||||||
|
{
|
||||||
|
return Conflict("Username already exists.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new user
|
||||||
|
var result = objectSpace.CreateObject<Client>();
|
||||||
|
result.UserName = registerDto.Username;
|
||||||
|
result.FullName = registerDto.Name;
|
||||||
|
result.Telefon = registerDto.Phone;
|
||||||
|
result.SetPassword(registerDto.Password);
|
||||||
|
|
||||||
|
objectSpace.CommitChanges();
|
||||||
|
|
||||||
|
// Create a new UserLoginInfo
|
||||||
|
ApplicationUserLoginInfo loginInfo = objectSpace.CreateObject<ApplicationUserLoginInfo>();
|
||||||
|
loginInfo.User = result;
|
||||||
|
loginInfo.LoginProviderName = "Password"; // Use "Standard" for standard authentication
|
||||||
|
loginInfo.ProviderUserKey = result.Oid.ToString(); // Use the username as the provider key
|
||||||
|
objectSpace.CommitChanges();
|
||||||
|
return Ok("User registered successfully.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpDelete(nameof(DeleteAccount))]
|
||||||
|
[SwaggerOperation("Delete account")]
|
||||||
|
[Authorize]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent, Type = typeof(string))] // Success response
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound, Type = typeof(string))] // Not found response
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(string))]
|
||||||
|
public IActionResult DeleteAccount()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Check if securityProvider is null
|
||||||
|
if (securityProvider == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Security provider is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if dataService is null
|
||||||
|
if (dataService == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Data service is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
var objectSpace = dataService.GetObjectSpace<Client>();
|
||||||
|
var userID = (Guid)securityProvider.GetSecurity().UserId;
|
||||||
|
var strategy = (SecurityStrategy)securityProvider.GetSecurity();
|
||||||
|
if (!strategy.CanWrite(typeof(Client)))
|
||||||
|
return Forbid("You do not have permissions to update a client!");
|
||||||
|
|
||||||
|
var user = (Client)strategy.User;
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
return NotFound("User not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var client = objectSpace.GetObject(user);
|
||||||
|
if (client == null)
|
||||||
|
{
|
||||||
|
return NotFound("Client not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
client.Delete();
|
||||||
|
objectSpace.CommitChanges();
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Log exception details for debugging
|
||||||
|
return StatusCode(500, $"An error occurred while deleting the account: {ex.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet(nameof(GetClient))]
|
[HttpGet(nameof(GetClient))]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[SwaggerOperation("Get client information")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
|
||||||
public IActionResult GetClient()
|
public IActionResult GetClient()
|
||||||
{
|
{
|
||||||
|
// Check if securityProvider is null
|
||||||
|
if (securityProvider == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Security provider is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if dataService is null
|
||||||
|
if (dataService == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Data service is not available");
|
||||||
|
}
|
||||||
|
|
||||||
var objectSpace = dataService.GetObjectSpace<Client>();
|
var objectSpace = dataService.GetObjectSpace<Client>();
|
||||||
var userID = (Guid)securityProvider.GetSecurity().UserId;
|
var userID = (Guid)securityProvider.GetSecurity().UserId;
|
||||||
var clients = objectSpace.GetObjectsQuery<Client>()
|
var clients = objectSpace.GetObjectsQuery<Client>()
|
||||||
|
|
@ -40,5 +153,46 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
|
|
||||||
return Ok(clients);
|
return Ok(clients);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost(nameof(FirebaseToken))]
|
||||||
|
[Authorize]
|
||||||
|
[SwaggerOperation("Updates clients firebase token")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status403Forbidden, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(string))]
|
||||||
|
public IActionResult FirebaseToken([FromQuery] string token)
|
||||||
|
{
|
||||||
|
// Check if securityProvider is null
|
||||||
|
if (securityProvider == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Security provider is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if dataService is null
|
||||||
|
if (dataService == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Data service is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
var strategy = (SecurityStrategy)securityProvider.GetSecurity();
|
||||||
|
if(!strategy.CanWrite(typeof(Client)))
|
||||||
|
return Forbid("You do not have permissions to update a client!");
|
||||||
|
|
||||||
|
var user = (Client)strategy.User;
|
||||||
|
if (user == null || string.IsNullOrEmpty(token)) {
|
||||||
|
return BadRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
var objectSpace = dataService.GetObjectSpace(typeof(Client));
|
||||||
|
var client = objectSpace.GetObject(user);
|
||||||
|
|
||||||
|
// Update the token and commit changes
|
||||||
|
client.FirebaseToken = token;
|
||||||
|
objectSpace.CommitChanges();
|
||||||
|
|
||||||
|
return Ok("Firebase token updated successfully.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using DurnyklyYol.Blazor.Server.DTO;
|
||||||
using DurnyklyYol.Module.BusinessObjects;
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
|
||||||
namespace DurnyklyYol.Blazor.Server.Controllers
|
namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -23,6 +24,7 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[SwaggerOperation("Get client goods")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Get([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10, [FromQuery] GoodsState? state = null)
|
public IActionResult Get([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10, [FromQuery] GoodsState? state = null)
|
||||||
{
|
{
|
||||||
|
|
@ -38,20 +40,19 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
Volume = sl.Volume,
|
Volume = sl.Volume,
|
||||||
ShopNo = sl.ShopNo,
|
ShopNo = sl.ShopNo,
|
||||||
Carrier = sl.Cargo.Carrier.Number,
|
Carrier = sl.Cargo.Carrier.Number,
|
||||||
From = sl.Cargo.StartsFrom,
|
From = sl.ReceivedPoint.Name,
|
||||||
To = sl.Cargo.DestinationTo,
|
To = sl.DestinationPoint.Name,
|
||||||
ClientId = sl.Client.Oid,
|
ClientId = sl.Client.Oid,
|
||||||
DepartedAt = sl.Cargo.StartedAt,
|
DepartedAt = sl.Cargo.StartedAt,
|
||||||
Depth = sl.Depth,
|
//Depth = sl.Depth,
|
||||||
Width = sl.Width,
|
//Width = sl.Width,
|
||||||
Height = sl.Height,
|
//Height = sl.Height,
|
||||||
CargoId = sl.Cargo.Oid,
|
CargoId = sl.Cargo.Oid,
|
||||||
CargoState = sl.Cargo.State,
|
CargoState = sl.Cargo.State,
|
||||||
State = sl.State,
|
State = sl.State,
|
||||||
Price = sl.Price,
|
Price = sl.Price,
|
||||||
Image1 = sl.Image1 != null ? string.Format("/FileData/{0}-{1}", sl.Image1.Oid, sl.Image1.FileName) : "",
|
Invoice = sl.Image1 != null ? string.Format("/FileData/{0}-{1}", sl.Image1.Oid, sl.Image1.FileName) : "",
|
||||||
Image2 = sl.Image2 != null ? string.Format("/FileData/{0}-{1}", sl.Image2.Oid, sl.Image2.FileName) : "",
|
Image = sl.Image2 != null ? string.Format("/FileData/{0}-{1}", sl.Image2.Oid, sl.Image2.FileName) : "",
|
||||||
Image3 = sl.Image3 != null ? string.Format("/FileData/{0}-{1}", sl.Image3.Oid, sl.Image3.FileName) : "",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
|
|
@ -75,7 +76,5 @@ namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
|
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
using DevExpress.ExpressApp.Security;
|
||||||
|
using DevExpress.ExpressApp.WebApi.Services;
|
||||||
|
using DurnyklyYol.Blazor.Server.DTO;
|
||||||
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
|
||||||
|
namespace DurnyklyYol.Blazor.Server.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
[Authorize]
|
||||||
|
public class RequestController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IDataService dataService;
|
||||||
|
private readonly ISecurityProvider securityProvider;
|
||||||
|
|
||||||
|
public RequestController(IDataService dataService, ISecurityProvider securityProvider)
|
||||||
|
{
|
||||||
|
this.dataService = dataService;
|
||||||
|
this.securityProvider = securityProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Get([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10)
|
||||||
|
{
|
||||||
|
var objectSpace = dataService.GetObjectSpace<CargoRequest>();
|
||||||
|
var userID = (Guid)securityProvider.GetSecurity().UserId;
|
||||||
|
|
||||||
|
var requestQuery = objectSpace.GetObjectsQuery<CargoRequest>()
|
||||||
|
.Where(cl => cl.Client.Oid == userID);
|
||||||
|
|
||||||
|
var totalRecords = requestQuery.Count();
|
||||||
|
|
||||||
|
var requests = requestQuery
|
||||||
|
.Skip((pageNumber - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var response = new
|
||||||
|
{
|
||||||
|
TotalRecords = totalRecords,
|
||||||
|
PageNumber = pageNumber,
|
||||||
|
PageSize = pageSize,
|
||||||
|
Data = requests
|
||||||
|
};
|
||||||
|
|
||||||
|
return Ok(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[SwaggerOperation("Register client cargo request")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status201Created)] // Success response
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(string))]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(string))]
|
||||||
|
public async Task<IActionResult> Create([FromForm] RequestDto requstDto)
|
||||||
|
{
|
||||||
|
// Validate input
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
return BadRequest(ModelState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if securityProvider is null
|
||||||
|
if (securityProvider == null || dataService == null)
|
||||||
|
{
|
||||||
|
return StatusCode(500, "Data service or Security provider is not available");
|
||||||
|
}
|
||||||
|
|
||||||
|
var strategy = (SecurityStrategy)securityProvider.GetSecurity();
|
||||||
|
var user = (Client)strategy.User;
|
||||||
|
|
||||||
|
if (user == null || !strategy.CanWrite(typeof(Client)))
|
||||||
|
return BadRequest("You do not have permissions to update a client!");
|
||||||
|
|
||||||
|
var objectSpace = dataService.GetObjectSpace(typeof(Client));
|
||||||
|
var client = objectSpace.GetObject(user);
|
||||||
|
|
||||||
|
var cargoRequest = objectSpace.CreateObject<CargoRequest>();
|
||||||
|
cargoRequest.Client = client;
|
||||||
|
cargoRequest.CreatedAt = DateTime.Now;
|
||||||
|
cargoRequest.Description = requstDto.Description;
|
||||||
|
cargoRequest.From = requstDto.From;
|
||||||
|
cargoRequest.To = requstDto.To;
|
||||||
|
cargoRequest.GoodsType = requstDto.GoodsType;
|
||||||
|
//cargoRequest.Save();
|
||||||
|
objectSpace.CommitChanges();
|
||||||
|
|
||||||
|
return Created();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,20 +12,20 @@ namespace DurnyklyYol.Blazor.Server.DTO
|
||||||
public string No { get; set; }
|
public string No { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string ShopNo { get; set; }
|
public string ShopNo { get; set; }
|
||||||
public double Volume { get; set; }
|
public decimal Volume { get; set; }
|
||||||
public uint PlacesCount { get; set; }
|
public uint PlacesCount { get; set; }
|
||||||
public string Carrier { get; set; }
|
public string Carrier { get; set; }
|
||||||
public string From { get; set; }
|
public string From { get; set; }
|
||||||
public string To { get; set; }
|
public string To { get; set; }
|
||||||
public DateTime? DepartedAt { get; set; }
|
public DateTime? DepartedAt { get; set; }
|
||||||
public uint Depth { get; set; }
|
//public uint Depth { get; set; }
|
||||||
public uint Width { get; set; }
|
//public uint Width { get; set; }
|
||||||
public uint Height { get; set; }
|
//public uint Height { get; set; }
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
public string Image1 { get; set; }
|
public string Invoice { get; set; }
|
||||||
public string Image2 { get; set; }
|
public string Image { get; set; }
|
||||||
public string Image3 { get; set; }
|
//public string Image3 { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
namespace DurnyklyYol.Blazor.Server.DTO
|
||||||
|
{
|
||||||
|
public class RegisterDto
|
||||||
|
{
|
||||||
|
[Required(ErrorMessage = "Username is required")]
|
||||||
|
public string Username { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "Password is required")]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "Name is required")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "Phone is required")]
|
||||||
|
public string Phone { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace DurnyklyYol.Blazor.Server.DTO
|
||||||
|
{
|
||||||
|
public class RequestDto
|
||||||
|
{
|
||||||
|
[Required(ErrorMessage = "GoodsType is required")]
|
||||||
|
public string GoodsType { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "Description is required")]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "From is required")]
|
||||||
|
public string From { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "To is required")]
|
||||||
|
public string To { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,17 +25,20 @@
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.1.4" />
|
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Api.Xpo.All" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Api.Xpo.All" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Blazor" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Blazor" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.5">
|
||||||
<PackageReference Include="DevExpress.ExpressApp.FileAttachment.Blazor" Version="24.1.4" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ReportsV2" Version="24.1.4" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ReportsV2.Blazor" Version="24.1.4" />
|
</PackageReference>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.AspNetCore.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.FileAttachment.Blazor" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ReportsV2" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Validation" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ReportsV2.Blazor" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Validation.Blazor" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.AspNetCore.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.ExpressApp.Validation" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.ExpressApp.Validation.Blazor" Version="24.1.5" />
|
||||||
<PackageReference Include="Npgsql" Version="8.0.3" />
|
<PackageReference Include="Npgsql" Version="8.0.3" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
@inject IObjectSpace ObjectSpace
|
@inject IObjectSpace ObjectSpace
|
||||||
@inject IWebHostEnvironment Environment
|
@inject IWebHostEnvironment Environment
|
||||||
|
|
||||||
<InputFile OnChange="HandleFileSelected" multiple />
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter]
|
[Parameter]
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ using DurnyklyYol.WebApi.JWT;
|
||||||
using DevExpress.ExpressApp.Security.Authentication.ClientServer;
|
using DevExpress.ExpressApp.Security.Authentication.ClientServer;
|
||||||
using DurnyklyYol.Blazor.Server.OData;
|
using DurnyklyYol.Blazor.Server.OData;
|
||||||
using Microsoft.AspNetCore.OData.Query.Validator;
|
using Microsoft.AspNetCore.OData.Query.Validator;
|
||||||
|
using DurnyklyYol.Module.Services;
|
||||||
|
|
||||||
namespace DurnyklyYol.Blazor.Server;
|
namespace DurnyklyYol.Blazor.Server;
|
||||||
|
|
||||||
|
|
@ -33,6 +34,7 @@ public class Startup {
|
||||||
services.AddSingleton(typeof(Microsoft.AspNetCore.SignalR.HubConnectionHandler<>), typeof(ProxyHubConnectionHandler<>));
|
services.AddSingleton(typeof(Microsoft.AspNetCore.SignalR.HubConnectionHandler<>), typeof(ProxyHubConnectionHandler<>));
|
||||||
|
|
||||||
services.AddRazorPages();
|
services.AddRazorPages();
|
||||||
|
services.AddSingleton<INotificationService, NotificationService>();
|
||||||
services.AddServerSideBlazor();
|
services.AddServerSideBlazor();
|
||||||
services.AddHttpContextAccessor();
|
services.AddHttpContextAccessor();
|
||||||
services.AddScoped<IAuthenticationTokenProvider, JwtTokenProviderService>();
|
services.AddScoped<IAuthenticationTokenProvider, JwtTokenProviderService>();
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
"Authentication": {
|
"Authentication": {
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
// For more information, refer to the following topic: Configure the JWT Authentication for the Web API https://docs.devexpress.com/eXpressAppFramework/403504
|
// For more information, refer to the following topic: Configure the JWT Authentication for the Web API https://docs.devexpress.com/eXpressAppFramework/403504
|
||||||
"Issuer": "My",
|
"Issuer": "66Kargo",
|
||||||
"Audience": "http://localhost:4200",
|
"Audience": "cargo.tpsadvertising.com",
|
||||||
// The debug secret key. You should store sensitive settings in dedicated secret storage. For more information, refer to the following topic: https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-7.0&tabs=windows.
|
// The debug secret key. You should store sensitive settings in dedicated secret storage. For more information, refer to the following topic: https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-7.0&tabs=windows.
|
||||||
"IssuerSigningKey": "3e3d5a02-f807-493c-a590-4250c04f2c94"
|
"IssuerSigningKey": "3e3d5a02-f807-493c-a590-4250c04f2c94"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,19 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.1.4" />
|
<PackageReference Include="DevExpress.Drawing.Skia" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Api.Xpo.All" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Api.Xpo.All" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.5">
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.AspNetCore.Xpo" Version="24.1.4" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.4" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.4" />
|
</PackageReference>
|
||||||
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.AspNetCore.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.RichEdit.Export" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.RichEdit.Export" Version="24.1.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -10,36 +10,46 @@ namespace DurnyklyYol.Module.BusinessObjects;
|
||||||
[MapInheritance(MapInheritanceType.ParentTable)]
|
[MapInheritance(MapInheritanceType.ParentTable)]
|
||||||
[DefaultProperty(nameof(UserName))]
|
[DefaultProperty(nameof(UserName))]
|
||||||
public class ApplicationUser : PermissionPolicyUser, ISecurityUserWithLoginInfo, ISecurityUserLockout {
|
public class ApplicationUser : PermissionPolicyUser, ISecurityUserWithLoginInfo, ISecurityUserLockout {
|
||||||
|
bool suspended;
|
||||||
private int accessFailedCount;
|
private int accessFailedCount;
|
||||||
private DateTime lockoutEnd;
|
private DateTime lockoutEnd;
|
||||||
|
|
||||||
public ApplicationUser(Session session) : base(session) { }
|
public ApplicationUser(Session session) : base(session) { }
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public int AccessFailedCount {
|
public int AccessFailedCount
|
||||||
|
{
|
||||||
get { return accessFailedCount; }
|
get { return accessFailedCount; }
|
||||||
set { SetPropertyValue(nameof(AccessFailedCount), ref accessFailedCount, value); }
|
set { SetPropertyValue(nameof(AccessFailedCount), ref accessFailedCount, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public DateTime LockoutEnd {
|
public DateTime LockoutEnd
|
||||||
|
{
|
||||||
get { return lockoutEnd; }
|
get { return lockoutEnd; }
|
||||||
set { SetPropertyValue(nameof(LockoutEnd), ref lockoutEnd, value); }
|
set { SetPropertyValue(nameof(LockoutEnd), ref lockoutEnd, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
[Aggregated, Association("User-LoginInfo")]
|
[Aggregated, Association("User-LoginInfo")]
|
||||||
public XPCollection<ApplicationUserLoginInfo> LoginInfo {
|
public XPCollection<ApplicationUserLoginInfo> LoginInfo
|
||||||
|
{
|
||||||
get { return GetCollection<ApplicationUserLoginInfo>(nameof(LoginInfo)); }
|
get { return GetCollection<ApplicationUserLoginInfo>(nameof(LoginInfo)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<ISecurityUserLoginInfo> IOAuthSecurityUser.UserLogins => LoginInfo.OfType<ISecurityUserLoginInfo>();
|
IEnumerable<ISecurityUserLoginInfo> IOAuthSecurityUser.UserLogins => LoginInfo.OfType<ISecurityUserLoginInfo>();
|
||||||
|
|
||||||
ISecurityUserLoginInfo ISecurityUserWithLoginInfo.CreateUserLoginInfo(string loginProviderName, string providerUserKey) {
|
ISecurityUserLoginInfo ISecurityUserWithLoginInfo.CreateUserLoginInfo(string loginProviderName, string providerUserKey)
|
||||||
|
{
|
||||||
ApplicationUserLoginInfo result = new ApplicationUserLoginInfo(Session);
|
ApplicationUserLoginInfo result = new ApplicationUserLoginInfo(Session);
|
||||||
result.LoginProviderName = loginProviderName;
|
result.LoginProviderName = loginProviderName;
|
||||||
result.ProviderUserKey = providerUserKey;
|
result.ProviderUserKey = providerUserKey;
|
||||||
result.User = this;
|
result.User = this;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public bool Suspended
|
||||||
|
{
|
||||||
|
get => suspended;
|
||||||
|
set => SetPropertyValue(nameof(Suspended), ref suspended, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ using DevExpress.Persistent.Base;
|
||||||
using DevExpress.Persistent.BaseImpl;
|
using DevExpress.Persistent.BaseImpl;
|
||||||
using DevExpress.Persistent.Validation;
|
using DevExpress.Persistent.Validation;
|
||||||
using DevExpress.Xpo;
|
using DevExpress.Xpo;
|
||||||
|
using DurnyklyYol.Module.Services;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace DurnyklyYol.Module.BusinessObjects
|
namespace DurnyklyYol.Module.BusinessObjects
|
||||||
|
|
@ -21,7 +23,12 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
: base(session)
|
: base(session)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
private Point originalCurrentPoint;
|
||||||
|
protected override void OnLoaded()
|
||||||
|
{
|
||||||
|
base.OnLoaded();
|
||||||
|
originalCurrentPoint = CurrentPoint;
|
||||||
|
}
|
||||||
protected override void OnSaving()
|
protected override void OnSaving()
|
||||||
{
|
{
|
||||||
base.OnSaving();
|
base.OnSaving();
|
||||||
|
|
@ -31,12 +38,31 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
&& (Session.ObjectLayer is SimpleObjectLayer)
|
&& (Session.ObjectLayer is SimpleObjectLayer)
|
||||||
//OR
|
//OR
|
||||||
//&& !(Session.ObjectLayer is DevExpress.ExpressApp.Security.ClientServer.SecuredSessionObjectLayer)
|
//&& !(Session.ObjectLayer is DevExpress.ExpressApp.Security.ClientServer.SecuredSessionObjectLayer)
|
||||||
&& string.IsNullOrEmpty(No))
|
)
|
||||||
{
|
{
|
||||||
int nextSequence = DistributedIdGeneratorHelper.Generate(Session.DataLayer, this.GetType().FullName, "ERPrefix");
|
if (string.IsNullOrEmpty(No))
|
||||||
No = string.Format("KA-{0:D6}", nextSequence);
|
{
|
||||||
|
int nextSequence = DistributedIdGeneratorHelper.Generate(
|
||||||
|
Session.DataLayer,
|
||||||
|
this.GetType().FullName,
|
||||||
|
"ERPrefix"
|
||||||
|
);
|
||||||
|
No = string.Format("KA-{0:D6}", nextSequence);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
protected override void OnSaved()
|
||||||
|
{
|
||||||
|
base.OnSaved();
|
||||||
|
if (CurrentPoint != null && CurrentPoint != originalCurrentPoint)
|
||||||
|
{
|
||||||
|
var notification = Session.ServiceProvider.GetRequiredService<INotificationService>();
|
||||||
|
System.Threading.Tasks.Task.Run(async () => await notification.NotifyClients(this));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
double totalWeight;
|
double totalWeight;
|
||||||
string no;
|
string no;
|
||||||
//CargoState state;
|
//CargoState state;
|
||||||
|
|
@ -58,18 +84,19 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (CurrentPoint == null || CurrentPoint.Oid == Route.StartPoint.Point.Oid)
|
if (CurrentPoint == null || Route == null || Route.Points.Count == 0)
|
||||||
{
|
{
|
||||||
return CargoState.Warehouse;
|
return CargoState.Warehouse;
|
||||||
}
|
}
|
||||||
else if (CurrentPoint != null && CurrentPoint.Oid == Route.DestinationPoint.Point.Oid)
|
|
||||||
|
var lastPoint = Route.Points.OrderBy(o => o.Order).Last();
|
||||||
|
if (lastPoint != null && CurrentPoint != null && lastPoint.Oid == CurrentPoint.Oid)
|
||||||
{
|
{
|
||||||
return CargoState.Arrived;
|
return CargoState.Arrived;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return CargoState.InTransit;
|
||||||
return CargoState.InTransit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//set => SetPropertyValue(nameof(State), ref state, value);
|
//set => SetPropertyValue(nameof(State), ref state, value);
|
||||||
}
|
}
|
||||||
|
|
@ -111,10 +138,6 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
[ModelDefault("DisplayFormat", "${0:#,##0.00}")]
|
[ModelDefault("DisplayFormat", "${0:#,##0.00}")]
|
||||||
public decimal CurrentProfit => PayedTotal - TotalExpenseAmount;
|
public decimal CurrentProfit => PayedTotal - TotalExpenseAmount;
|
||||||
|
|
||||||
[Browsable(false)]
|
|
||||||
public string StartsFrom => Route?.StartPoint?.Name;
|
|
||||||
[Browsable(false)]
|
|
||||||
public string DestinationTo => Route?.DestinationPoint?.Name;
|
|
||||||
|
|
||||||
[RuleRequiredField(DefaultContexts.Save), ImmediatePostData]
|
[RuleRequiredField(DefaultContexts.Save), ImmediatePostData]
|
||||||
public Route Route
|
public Route Route
|
||||||
|
|
@ -142,22 +165,16 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
{
|
{
|
||||||
if (Route is null) return new XPCollection<Point>(Session);
|
if (Route is null) return new XPCollection<Point>(Session);
|
||||||
|
|
||||||
var startPoint = Route.StartPoint.Point;
|
|
||||||
var endPoint = Route.DestinationPoint.Point;
|
|
||||||
|
|
||||||
var points = Route.Points
|
var points = Route.Points
|
||||||
.OrderBy(or => or.Order)
|
.OrderBy(or => or.Order)
|
||||||
.Select(sl => sl.Point)
|
.Select(sl => sl.Point)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
points.Insert(0, startPoint);
|
|
||||||
points.Add(endPoint);
|
|
||||||
|
|
||||||
return new XPCollection<Point>(Session, points);
|
return new XPCollection<Point>(Session, points);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[RuleRequiredField(DefaultContexts.Save), ImmediatePostData, DataSourceProperty(nameof(AvailablePoints))]
|
[ImmediatePostData, DataSourceProperty(nameof(AvailablePoints))]
|
||||||
public Point CurrentPoint
|
public Point CurrentPoint
|
||||||
{
|
{
|
||||||
get => currentPoint;
|
get => currentPoint;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
using DevExpress.Persistent.Base;
|
||||||
|
using DevExpress.Persistent.BaseImpl;
|
||||||
|
using DevExpress.Xpo;
|
||||||
|
|
||||||
|
namespace DurnyklyYol.Module.BusinessObjects
|
||||||
|
{
|
||||||
|
[DefaultClassOptions, NavigationItem("Clients & Goods")]
|
||||||
|
//[ImageName("BO_Contact")]
|
||||||
|
//[DefaultProperty("DisplayMemberNameForLookupEditorsOfThisType")]
|
||||||
|
//[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
|
||||||
|
//[Persistent("DatabaseTableName")]
|
||||||
|
// Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
|
||||||
|
public class CargoRequest : BaseObject
|
||||||
|
{ // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx).
|
||||||
|
// Use CodeRush to create XPO classes and properties with a few keystrokes.
|
||||||
|
// https://docs.devexpress.com/CodeRushForRoslyn/118557
|
||||||
|
public CargoRequest(Session session)
|
||||||
|
: base(session)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void AfterConstruction()
|
||||||
|
{
|
||||||
|
base.AfterConstruction();
|
||||||
|
CreatedAt = DateTime.Now;
|
||||||
|
Status = RequestStatus.New;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RequestStatus status;
|
||||||
|
string to;
|
||||||
|
string from;
|
||||||
|
string description;
|
||||||
|
string goodsType;
|
||||||
|
DateTime createdAt;
|
||||||
|
Client client;
|
||||||
|
|
||||||
|
[Association("Client-CargoRequests")]
|
||||||
|
public Client Client
|
||||||
|
{
|
||||||
|
get => client;
|
||||||
|
set => SetPropertyValue(nameof(Client), ref client, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime CreatedAt
|
||||||
|
{
|
||||||
|
get => createdAt;
|
||||||
|
set => SetPropertyValue(nameof(CreatedAt), ref createdAt, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
||||||
|
public string GoodsType
|
||||||
|
{
|
||||||
|
get => goodsType;
|
||||||
|
set => SetPropertyValue(nameof(GoodsType), ref goodsType, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
||||||
|
public string Description
|
||||||
|
{
|
||||||
|
get => description;
|
||||||
|
set => SetPropertyValue(nameof(Description), ref description, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
||||||
|
public string From
|
||||||
|
{
|
||||||
|
get => from;
|
||||||
|
set => SetPropertyValue(nameof(From), ref from, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
||||||
|
public string To
|
||||||
|
{
|
||||||
|
get => to;
|
||||||
|
set => SetPropertyValue(nameof(To), ref to, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public RequestStatus Status
|
||||||
|
{
|
||||||
|
get => status;
|
||||||
|
set => SetPropertyValue(nameof(Status), ref status, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum RequestStatus
|
||||||
|
{
|
||||||
|
New,
|
||||||
|
Accepted,
|
||||||
|
Rejected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
{
|
{
|
||||||
[DefaultClassOptions, NavigationItem("Transportation")]
|
[DefaultClassOptions, NavigationItem("Transportation")]
|
||||||
[ImageName("Gauges")]
|
[ImageName("Gauges")]
|
||||||
[DefaultProperty(nameof(Name)), FriendlyKeyProperty(nameof(Number))]
|
[DefaultProperty(nameof(Number)), FriendlyKeyProperty(nameof(Number))]
|
||||||
//[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
|
//[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
|
||||||
//[Persistent("DatabaseTableName")]
|
//[Persistent("DatabaseTableName")]
|
||||||
// Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
|
// Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
this.Roles.Add(clientRole);
|
this.Roles.Add(clientRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
string firebaseToken;
|
||||||
string bellik;
|
string bellik;
|
||||||
string telefon;
|
string telefon;
|
||||||
Region region;
|
Region region;
|
||||||
|
|
@ -85,6 +86,14 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
set => SetPropertyValue(nameof(FullName), ref fullName, value);
|
set => SetPropertyValue(nameof(FullName), ref fullName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Size(SizeAttribute.Unlimited)]
|
||||||
|
public string FirebaseToken
|
||||||
|
{
|
||||||
|
get => firebaseToken;
|
||||||
|
set => SetPropertyValue(nameof(FirebaseToken), ref firebaseToken, value);
|
||||||
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Region Region
|
public Region Region
|
||||||
{
|
{
|
||||||
|
|
@ -100,5 +109,14 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
return GetCollection<Goods>(nameof(Goods));
|
return GetCollection<Goods>(nameof(Goods));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Association("Client-CargoRequests")]
|
||||||
|
public XPCollection<CargoRequest> CargoRequests
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GetCollection<CargoRequest>(nameof(CargoRequests));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -60,113 +60,110 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
set => SetPropertyValue(nameof(No), ref no, value);
|
set => SetPropertyValue(nameof(No), ref no, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save), Index(2), VisibleInLookupListView(true)]
|
[Index(1), VisibleInLookupListView(true)]
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save)]
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get => name;
|
get => name;
|
||||||
set => SetPropertyValue(nameof(Name), ref name, value);
|
set => SetPropertyValue(nameof(Name), ref name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ModelDefault("DisplayFormat", "{0:g}"), ModelDefault("EditMask", "g"), ReadOnly(true)]
|
[VisibleInDetailView(false)]
|
||||||
|
[ModelDefault("DisplayFormat", "{0:g}"), ModelDefault("EditMask", "g")]
|
||||||
public DateTime CreatedAt
|
public DateTime CreatedAt
|
||||||
{
|
{
|
||||||
get => createdAt;
|
get => createdAt;
|
||||||
set => SetPropertyValue(nameof(CreatedAt), ref createdAt, value);
|
set => SetPropertyValue(nameof(CreatedAt), ref createdAt, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RuleValueComparison(ValueComparisonType.GreaterThan, 0)]
|
[RuleValueComparison(ValueComparisonType.GreaterThan, 0), Index(2)]
|
||||||
public double Volume
|
|
||||||
{
|
|
||||||
get => volume;
|
|
||||||
set => SetPropertyValue(nameof(Volume), ref volume, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[RuleValueComparison(ValueComparisonType.GreaterThan, 0)]
|
|
||||||
public uint PlaceCount
|
public uint PlaceCount
|
||||||
{
|
{
|
||||||
get => placeCount;
|
get => placeCount;
|
||||||
set => SetPropertyValue(nameof(PlaceCount), ref placeCount, value);
|
set => SetPropertyValue(nameof(PlaceCount), ref placeCount, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RuleValueComparison(ValueComparisonType.GreaterThan, 0)]
|
[RuleValueComparison(ValueComparisonType.GreaterThan, 0), Index(3)]
|
||||||
public uint PackageCount
|
public uint PackageCount
|
||||||
{
|
{
|
||||||
get => packageCount;
|
get => packageCount;
|
||||||
set => SetPropertyValue(nameof(PackageCount), ref packageCount, value);
|
set => SetPropertyValue(nameof(PackageCount), ref packageCount, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Size(SizeAttribute.DefaultStringMappingFieldSize), IgnoreDataMember]
|
[ModelDefault("DisplayFormat", "{0:#,##0.00 }"), ModelDefault("EditMask", "############,##0.00")]
|
||||||
public string PackingType
|
[ImmediatePostData, Index(4), RuleValueComparison(ValueComparisonType.GreaterThan, 0)]
|
||||||
|
public decimal Volume
|
||||||
{
|
{
|
||||||
get => packingType;
|
get => volume;
|
||||||
set => SetPropertyValue(nameof(PackingType), ref packingType, value);
|
set => SetPropertyValue(nameof(Volume), ref volume, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime ReceivedAt
|
[ModelDefault("DisplayFormat", "${0:#,##0.00}"), ModelDefault("EditMask", "$############,##0.00"), Index(5)]
|
||||||
{
|
|
||||||
get => receivedAt;
|
|
||||||
set => SetPropertyValue(nameof(ReceivedAt), ref receivedAt, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ModelDefault("DisplayFormat", "${0:#,##0.00}")]
|
|
||||||
public decimal Price
|
public decimal Price
|
||||||
{
|
{
|
||||||
get => price;
|
get => price;
|
||||||
set => SetPropertyValue(nameof(Price), ref price, value);
|
set => SetPropertyValue(nameof(Price), ref price, value);
|
||||||
}
|
}
|
||||||
|
[PersistentAlias("Price * Volume"), ModelDefault("DisplayFormat", "${0:#,##0.00 }"), Index(6)]
|
||||||
public uint Height
|
public decimal TotalPrice => Convert.ToDecimal(EvaluateAlias(nameof(TotalPrice)));
|
||||||
{
|
|
||||||
get => height;
|
|
||||||
set => SetPropertyValue(nameof(Height), ref height, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Width
|
|
||||||
{
|
|
||||||
get => width;
|
|
||||||
set => SetPropertyValue(nameof(Width), ref width, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint Depth
|
|
||||||
{
|
|
||||||
get => depth;
|
|
||||||
set => SetPropertyValue(nameof(Depth), ref depth, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
//[RuleRequiredField(DefaultContexts.Save), Index(1)]
|
|
||||||
//public Shop Shop
|
|
||||||
//{
|
|
||||||
// get => shop;
|
|
||||||
// set => SetPropertyValue(nameof(Shop), ref shop, value);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
[Index(7)]
|
||||||
public string ShopNo
|
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData, VisibleInListView(false)]
|
||||||
{
|
|
||||||
get => shopNo;
|
|
||||||
set => SetPropertyValue(nameof(ShopNo), ref shopNo, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData]
|
|
||||||
public FileSystemStoreObject Image1
|
public FileSystemStoreObject Image1
|
||||||
{
|
{
|
||||||
get { return GetPropertyValue<FileSystemStoreObject>("Image1"); }
|
get { return GetPropertyValue<FileSystemStoreObject>("Image1"); }
|
||||||
set { SetPropertyValue<FileSystemStoreObject>("Image1", value); }
|
set { SetPropertyValue<FileSystemStoreObject>("Image1", value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData]
|
[Index(9)]
|
||||||
|
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData, VisibleInListView(false)]
|
||||||
public FileSystemStoreObject Image2
|
public FileSystemStoreObject Image2
|
||||||
{
|
{
|
||||||
get { return GetPropertyValue<FileSystemStoreObject>("Image2"); }
|
get { return GetPropertyValue<FileSystemStoreObject>("Image2"); }
|
||||||
set { SetPropertyValue<FileSystemStoreObject>("Image2", value); }
|
set { SetPropertyValue<FileSystemStoreObject>("Image2", value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData]
|
[Size(SizeAttribute.DefaultStringMappingFieldSize), Index(10)]
|
||||||
public FileSystemStoreObject Image3
|
public string ShopNo
|
||||||
{
|
{
|
||||||
get { return GetPropertyValue<FileSystemStoreObject>("Image3"); }
|
get => shopNo;
|
||||||
set { SetPropertyValue<FileSystemStoreObject>("Image3", value); }
|
set => SetPropertyValue(nameof(ShopNo), ref shopNo, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Index(11)]
|
||||||
|
public Warehouse ReceivedPoint
|
||||||
|
{
|
||||||
|
get => receivedPoint;
|
||||||
|
set => SetPropertyValue(nameof(ReceivedPoint), ref receivedPoint, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Index(12)]
|
||||||
|
public DateTime? ReceivedAt
|
||||||
|
{
|
||||||
|
get => receivedAt;
|
||||||
|
set => SetPropertyValue(nameof(ReceivedAt), ref receivedAt, value);
|
||||||
|
}
|
||||||
|
[Index(13)]
|
||||||
|
public Warehouse DestinationPoint
|
||||||
|
{
|
||||||
|
get => destinationPoint;
|
||||||
|
set => SetPropertyValue(nameof(DestinationPoint), ref destinationPoint, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Index(14), VisibleInListView(false)]
|
||||||
|
public DateTime? DeliveredAt
|
||||||
|
{
|
||||||
|
get => deliveredAt;
|
||||||
|
set => SetPropertyValue(nameof(DeliveredAt), ref deliveredAt, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Index(15), VisibleInListView(false)]
|
||||||
|
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
|
||||||
|
public string Note
|
||||||
|
{
|
||||||
|
get => note;
|
||||||
|
set => SetPropertyValue(nameof(Note), ref note, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Association("Goods-Payments"), Aggregated]
|
[Association("Goods-Payments"), Aggregated]
|
||||||
|
|
@ -178,12 +175,6 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Association("Goods-GoodsImages"), Aggregated]
|
|
||||||
public XPCollection<GoodsImage> Images
|
|
||||||
{
|
|
||||||
get { return GetCollection<GoodsImage>(nameof(Images)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
[Index(0), VisibleInLookupListView(true), VisibleInDetailView(true), IgnoreDataMember]
|
[Index(0), VisibleInLookupListView(true), VisibleInDetailView(true), IgnoreDataMember]
|
||||||
[Association("Client-Goods"), RuleRequiredField(DefaultContexts.Save)]
|
[Association("Client-Goods"), RuleRequiredField(DefaultContexts.Save)]
|
||||||
public Client Client
|
public Client Client
|
||||||
|
|
@ -197,7 +188,7 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
public decimal TotalPayment => Payments.Sum(ps => ps.Amount);
|
public decimal TotalPayment => Payments.Sum(ps => ps.Amount);
|
||||||
[VisibleInDetailView(false)]
|
[VisibleInDetailView(false)]
|
||||||
[ModelDefault("DisplayFormat", "${0:#,##0.00}")]
|
[ModelDefault("DisplayFormat", "${0:#,##0.00}")]
|
||||||
public decimal Credit => Price - TotalPayment;
|
public decimal Credit => TotalPrice - TotalPayment;
|
||||||
|
|
||||||
|
|
||||||
public GoodsState State
|
public GoodsState State
|
||||||
|
|
@ -206,19 +197,18 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
set => SetPropertyValue(nameof(State), ref state, value);
|
set => SetPropertyValue(nameof(State), ref state, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string note;
|
||||||
|
DateTime? deliveredAt;
|
||||||
|
Warehouse destinationPoint;
|
||||||
|
Warehouse receivedPoint;
|
||||||
string shopNo;
|
string shopNo;
|
||||||
DateTime createdAt;
|
DateTime createdAt;
|
||||||
GoodsState state;
|
GoodsState state;
|
||||||
//Shop shop;
|
|
||||||
uint depth;
|
|
||||||
uint width;
|
|
||||||
uint height;
|
|
||||||
uint packageCount;
|
uint packageCount;
|
||||||
string packingType;
|
DateTime? receivedAt;
|
||||||
DateTime receivedAt;
|
|
||||||
decimal price;
|
decimal price;
|
||||||
uint placeCount;
|
uint placeCount;
|
||||||
double volume;
|
decimal volume;
|
||||||
string name;
|
string name;
|
||||||
string no;
|
string no;
|
||||||
Client client;
|
Client client;
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,13 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
: base(session)
|
: base(session)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
private Goods goods;
|
//private Goods goods;
|
||||||
[Association("Goods-GoodsImages")]
|
//[Association("Goods-GoodsImages")]
|
||||||
public Goods Goods
|
//public Goods Goods
|
||||||
{
|
//{
|
||||||
get { return goods; }
|
// get { return goods; }
|
||||||
set { SetPropertyValue(nameof(Goods), ref goods, value); }
|
// set { SetPropertyValue(nameof(Goods), ref goods, value); }
|
||||||
}
|
//}
|
||||||
private FileData file;
|
private FileData file;
|
||||||
[FileTypeFilter("ImageFiles", 1, "*.png", "*.jpg")]
|
[FileTypeFilter("ImageFiles", 1, "*.png", "*.jpg")]
|
||||||
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData]
|
[Aggregated, ExpandObjectMembers(ExpandObjectMembers.Never), ImmediatePostData]
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,6 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Warehouse destinationPoint;
|
|
||||||
Warehouse startPoint;
|
|
||||||
string title;
|
string title;
|
||||||
|
|
||||||
[Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save)]
|
[Size(SizeAttribute.DefaultStringMappingFieldSize), RuleRequiredField(DefaultContexts.Save)]
|
||||||
|
|
@ -36,18 +33,6 @@ namespace DurnyklyYol.Module.BusinessObjects
|
||||||
get => title;
|
get => title;
|
||||||
set => SetPropertyValue(nameof(Title), ref title, value);
|
set => SetPropertyValue(nameof(Title), ref title, value);
|
||||||
}
|
}
|
||||||
[RuleRequiredField(DefaultContexts.Save)]
|
|
||||||
public Warehouse StartPoint
|
|
||||||
{
|
|
||||||
get => startPoint;
|
|
||||||
set => SetPropertyValue(nameof(StartPoint), ref startPoint, value);
|
|
||||||
}
|
|
||||||
[RuleRequiredField(DefaultContexts.Save)]
|
|
||||||
public Warehouse DestinationPoint
|
|
||||||
{
|
|
||||||
get => destinationPoint;
|
|
||||||
set => SetPropertyValue(nameof(DestinationPoint), ref destinationPoint, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Association("Route-RoutePoints"), Aggregated]
|
[Association("Route-RoutePoints"), Aggregated]
|
||||||
public XPCollection<RoutePoint> Points
|
public XPCollection<RoutePoint> Points
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,8 @@ public class Updater : ModuleUpdater {
|
||||||
clRole.Name = GlobalConstants.ClientRoleName;
|
clRole.Name = GlobalConstants.ClientRoleName;
|
||||||
|
|
||||||
clRole.AddObjectPermissionFromLambda<ApplicationUser>(SecurityOperations.Read, cm => cm.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
clRole.AddObjectPermissionFromLambda<ApplicationUser>(SecurityOperations.Read, cm => cm.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
||||||
clRole.AddObjectPermissionFromLambda<Client>(SecurityOperations.Read, cm => cm.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
clRole.AddObjectPermissionFromLambda<Client>(SecurityOperations.ReadWriteAccess, cm => cm.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
||||||
|
clRole.AddObjectPermissionFromLambda<CargoRequest>(SecurityOperations.Read, cm => cm.Client.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
||||||
|
|
||||||
clRole.AddObjectPermissionFromLambda<Goods>(SecurityOperations.Read, cm => cm.Client.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
clRole.AddObjectPermissionFromLambda<Goods>(SecurityOperations.Read, cm => cm.Client.Oid == (Guid)CurrentUserIdOperator.CurrentUserId(), SecurityPermissionState.Allow);
|
||||||
|
|
||||||
|
|
@ -104,6 +105,7 @@ public class Updater : ModuleUpdater {
|
||||||
clRole.AddTypePermission<RoutePoint>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
clRole.AddTypePermission<RoutePoint>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
||||||
clRole.AddTypePermission<Carrier>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
clRole.AddTypePermission<Carrier>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
||||||
clRole.AddTypePermission<Warehouse>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
clRole.AddTypePermission<Warehouse>(SecurityOperations.Read, SecurityPermissionState.Allow);
|
||||||
|
clRole.AddTypePermission<CargoRequest>(SecurityOperations.Create, SecurityPermissionState.Allow);
|
||||||
|
|
||||||
|
|
||||||
//clRole.AddObjectPermission<ModelDifference>(SecurityOperations.ReadWriteAccess, "UserId = ToStr(CurrentUserId())", SecurityPermissionState.Deny);
|
//clRole.AddObjectPermission<ModelDifference>(SecurityOperations.ReadWriteAccess, "UserId = ToStr(CurrentUserId())", SecurityPermissionState.Deny);
|
||||||
|
|
|
||||||
|
|
@ -21,20 +21,24 @@
|
||||||
<EmbeddedResource Include="Model.DesignedDiffs.xafml" />
|
<EmbeddedResource Include="Model.DesignedDiffs.xafml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.5">
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ConditionalAppearance" Version="24.1.4" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Objects" Version="24.1.4" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.PivotGrid" Version="24.1.4" />
|
</PackageReference>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ReportsV2" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ConditionalAppearance" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Objects" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.PivotGrid" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Validation" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ReportsV2" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ViewVariantsModule" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Validation" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ViewVariantsModule" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="Azure.Identity" Version="1.11.4" />
|
<PackageReference Include="Azure.Identity" Version="1.11.4" />
|
||||||
|
<PackageReference Include="FirebaseAdmin" Version="3.0.0" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.34.0" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.34.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -44,6 +48,12 @@
|
||||||
<None Update="UnusableNodes.xml">
|
<None Update="UnusableNodes.xml">
|
||||||
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="UnusableNodes1.xml">
|
||||||
|
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
||||||
|
</None>
|
||||||
|
<None Update="UnusableNodes1_tk-TM.xml">
|
||||||
|
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
||||||
|
</None>
|
||||||
<None Update="UnusableNodes_tk-TM.xml">
|
<None Update="UnusableNodes_tk-TM.xml">
|
||||||
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
<DependentUpon>Model.DesignedDiffs.xafml</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.5.002.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurnyklyYol.Module", "DurnyklyYol.Module.csproj", "{8B75B9DA-F2D1-4BF2-9120-2DF225E1D955}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{8B75B9DA-F2D1-4BF2-9120-2DF225E1D955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8B75B9DA-F2D1-4BF2-9120-2DF225E1D955}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8B75B9DA-F2D1-4BF2-9120-2DF225E1D955}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8B75B9DA-F2D1-4BF2-9120-2DF225E1D955}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {CC01F604-37EB-4EB6-B1ED-D22E5CDE1F22}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -50,35 +50,28 @@
|
||||||
<Class Name="DurnyklyYol.Module.BusinessObjects.Goods" Caption="Ýük">
|
<Class Name="DurnyklyYol.Module.BusinessObjects.Goods" Caption="Ýük">
|
||||||
<OwnMembers>
|
<OwnMembers>
|
||||||
<Member Name="Client" Caption="Müşderi" />
|
<Member Name="Client" Caption="Müşderi" />
|
||||||
<Member Name="Name" Caption="Ýüküň Ady" />
|
|
||||||
<Member Name="Cargo" Caption="Kargo" />
|
|
||||||
<Member Name="CreatedAt" Caption="Döredilen senesi" />
|
<Member Name="CreatedAt" Caption="Döredilen senesi" />
|
||||||
|
<Member Name="Name" Caption="Ýüküň Ady" />
|
||||||
|
<Member Name="ShopNo" Caption="Magazin No" />
|
||||||
|
<Member Name="Cargo" Caption="Kargo" />
|
||||||
<Member Name="Credit" Caption="Galan tölegi (algy)" />
|
<Member Name="Credit" Caption="Galan tölegi (algy)" />
|
||||||
<Member Name="Depth" Caption="Uzynlygy" />
|
<Member Name="Image1" Caption="Invoice" />
|
||||||
<Member Name="Height" Caption="Boýy" />
|
|
||||||
<Member Name="Image1" Caption="Surat 1" />
|
|
||||||
<Member Name="Image2" Caption="Surat 2" />
|
<Member Name="Image2" Caption="Surat 2" />
|
||||||
<Member Name="Image3" Caption="Surat 3" />
|
|
||||||
<Member Name="Images" Caption="Suratlary" />
|
|
||||||
<Member Name="No" Caption="№" />
|
|
||||||
<Member Name="PackageCount" Caption="Gap sany" />
|
<Member Name="PackageCount" Caption="Gap sany" />
|
||||||
<Member Name="PackingType" Caption="Gaplama görnüşi" />
|
<Member Name="No" Caption="№" />
|
||||||
|
<Member Name="Volume" Caption="Göwrümi" />
|
||||||
<Member Name="Payments" Caption="Tölegleri" />
|
<Member Name="Payments" Caption="Tölegleri" />
|
||||||
<Member Name="PlaceCount" Caption="Ýer sany" />
|
<Member Name="PlaceCount" Caption="Ýer sany" />
|
||||||
<Member Name="Price" Caption="Bahasy" />
|
<Member Name="Price" Caption="Bahasy" />
|
||||||
|
<Member Name="TotalPrice" Caption="Jemi Baha" />
|
||||||
<Member Name="ReceivedAt" Caption="Kabul edilen senesi" />
|
<Member Name="ReceivedAt" Caption="Kabul edilen senesi" />
|
||||||
<Member Name="ShopNo" Caption="Magazin No" />
|
<Member Name="ReceivedPoint" Caption="Kabul ediş ýeri" />
|
||||||
|
<Member Name="DestinationPoint" Caption="Gowşurulýan ýeri" />
|
||||||
<Member Name="State" Caption="Statusy" />
|
<Member Name="State" Caption="Statusy" />
|
||||||
<Member Name="TotalPayment" Caption="Jemi tölenen" />
|
<Member Name="TotalPayment" Caption="Jemi tölenen" />
|
||||||
<Member Name="Volume" Caption="Göwrümi" />
|
|
||||||
<Member Name="Width" Caption="Ini" />
|
|
||||||
</OwnMembers>
|
|
||||||
</Class>
|
|
||||||
<Class Name="DurnyklyYol.Module.BusinessObjects.GoodsImage" Caption="Surat">
|
|
||||||
<OwnMembers>
|
|
||||||
<Member Name="Goods" Caption="Ýük" />
|
|
||||||
</OwnMembers>
|
</OwnMembers>
|
||||||
</Class>
|
</Class>
|
||||||
|
<Class Name="DurnyklyYol.Module.BusinessObjects.GoodsImage" Caption="Surat" />
|
||||||
<Class Name="DurnyklyYol.Module.BusinessObjects.Payment" Caption="Töleg">
|
<Class Name="DurnyklyYol.Module.BusinessObjects.Payment" Caption="Töleg">
|
||||||
<OwnMembers>
|
<OwnMembers>
|
||||||
<Member Name="Amount" Caption="Möçberi" />
|
<Member Name="Amount" Caption="Möçberi" />
|
||||||
|
|
|
||||||
|
|
@ -63,16 +63,11 @@
|
||||||
<ListView Id="Cargo_Goods_ListView" AllowDelete="False" AllowLink="True" AllowNew="False" DataAccessMode="Server">
|
<ListView Id="Cargo_Goods_ListView" AllowDelete="False" AllowLink="True" AllowNew="False" DataAccessMode="Server">
|
||||||
<Columns>
|
<Columns>
|
||||||
<ColumnInfo Id="CreatedAt" Index="-1" />
|
<ColumnInfo Id="CreatedAt" Index="-1" />
|
||||||
<ColumnInfo Id="PackingType" Index="-1" />
|
|
||||||
<ColumnInfo Id="State" Index="-1" />
|
<ColumnInfo Id="State" Index="-1" />
|
||||||
<ColumnInfo Id="Volume" Index="4" />
|
|
||||||
<ColumnInfo Id="PlaceCount" Index="5" />
|
<ColumnInfo Id="PlaceCount" Index="5" />
|
||||||
<ColumnInfo Id="PackageCount" Index="6" />
|
<ColumnInfo Id="PackageCount" Index="6" />
|
||||||
<ColumnInfo Id="ReceivedAt" Index="7" />
|
<ColumnInfo Id="ReceivedAt" Index="7" />
|
||||||
<ColumnInfo Id="Price" Index="8" />
|
<ColumnInfo Id="Price" Index="8" />
|
||||||
<ColumnInfo Id="Height" Index="9" />
|
|
||||||
<ColumnInfo Id="Width" Index="10" />
|
|
||||||
<ColumnInfo Id="Depth" Index="11" />
|
|
||||||
<ColumnInfo Id="TotalPayment" Index="12" />
|
<ColumnInfo Id="TotalPayment" Index="12" />
|
||||||
<ColumnInfo Id="Credit" Index="13" />
|
<ColumnInfo Id="Credit" Index="13" />
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|
@ -112,12 +107,8 @@
|
||||||
</DetailView>
|
</DetailView>
|
||||||
<ListView Id="Client_Goods_ListView" DataAccessMode="Server" AllowUnlink="False" AllowDelete="False" AllowNew="False" AllowLink="True">
|
<ListView Id="Client_Goods_ListView" DataAccessMode="Server" AllowUnlink="False" AllowDelete="False" AllowNew="False" AllowLink="True">
|
||||||
<Columns>
|
<Columns>
|
||||||
<ColumnInfo Id="Depth" Index="-1" />
|
|
||||||
<ColumnInfo Id="Height" Index="-1" />
|
|
||||||
<ColumnInfo Id="PackageCount" Index="-1" />
|
<ColumnInfo Id="PackageCount" Index="-1" />
|
||||||
<ColumnInfo Id="PackingType" Index="-1" />
|
|
||||||
<ColumnInfo Id="PlaceCount" Index="-1" />
|
<ColumnInfo Id="PlaceCount" Index="-1" />
|
||||||
<ColumnInfo Id="Width" Index="-1" />
|
|
||||||
<ColumnInfo Id="ReceivedAt" Index="5" />
|
<ColumnInfo Id="ReceivedAt" Index="5" />
|
||||||
<ColumnInfo Id="Price" Index="6" />
|
<ColumnInfo Id="Price" Index="6" />
|
||||||
<ColumnInfo Id="TotalPayment" Index="7" />
|
<ColumnInfo Id="TotalPayment" Index="7" />
|
||||||
|
|
@ -128,6 +119,8 @@
|
||||||
</ListView>
|
</ListView>
|
||||||
<ListView Id="Client_ListView" DataAccessMode="Server" />
|
<ListView Id="Client_ListView" DataAccessMode="Server" />
|
||||||
<ListView Id="Client_LookupListView" AllowDelete="False" AllowNew="False" AllowLink="True" DataAccessMode="Server" />
|
<ListView Id="Client_LookupListView" AllowDelete="False" AllowNew="False" AllowLink="True" DataAccessMode="Server" />
|
||||||
|
<ListView Id="Dimensions_ListView" AllowLink="False" />
|
||||||
|
<ListView Id="Dimensions_LookupListView" AllowLink="False" />
|
||||||
<DetailView Id="Expense_DetailView">
|
<DetailView Id="Expense_DetailView">
|
||||||
<Items>
|
<Items>
|
||||||
<PropertyEditor Id="Cargo" PropertyName="Cargo" IsNewNode="True" />
|
<PropertyEditor Id="Cargo" PropertyName="Cargo" IsNewNode="True" />
|
||||||
|
|
@ -154,15 +147,10 @@
|
||||||
<ColumnInfo Id="No" OwnerBand="Info" />
|
<ColumnInfo Id="No" OwnerBand="Info" />
|
||||||
<ColumnInfo Id="Client" OwnerBand="Info" />
|
<ColumnInfo Id="Client" OwnerBand="Info" />
|
||||||
<ColumnInfo Id="Name" OwnerBand="Info" />
|
<ColumnInfo Id="Name" OwnerBand="Info" />
|
||||||
<ColumnInfo Id="Volume" OwnerBand="Dimensions" />
|
|
||||||
<ColumnInfo Id="PlaceCount" OwnerBand="Dimensions" />
|
<ColumnInfo Id="PlaceCount" OwnerBand="Dimensions" />
|
||||||
<ColumnInfo Id="PackageCount" OwnerBand="Dimensions" />
|
<ColumnInfo Id="PackageCount" OwnerBand="Dimensions" />
|
||||||
<ColumnInfo Id="PackingType" OwnerBand="Dimensions" />
|
|
||||||
<ColumnInfo Id="ReceivedAt" OwnerBand="Info" />
|
<ColumnInfo Id="ReceivedAt" OwnerBand="Info" />
|
||||||
<ColumnInfo Id="Price" OwnerBand="Finance" />
|
<ColumnInfo Id="Price" OwnerBand="Finance" />
|
||||||
<ColumnInfo Id="Height" OwnerBand="Dimensions" />
|
|
||||||
<ColumnInfo Id="Width" OwnerBand="Dimensions" />
|
|
||||||
<ColumnInfo Id="Depth" OwnerBand="Dimensions" />
|
|
||||||
<ColumnInfo Id="TotalPayment" OwnerBand="Finance" />
|
<ColumnInfo Id="TotalPayment" OwnerBand="Finance" />
|
||||||
<ColumnInfo Id="Credit" OwnerBand="Finance" />
|
<ColumnInfo Id="Credit" OwnerBand="Finance" />
|
||||||
<ColumnInfo Id="State" OwnerBand="Info" />
|
<ColumnInfo Id="State" OwnerBand="Info" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
|
|
||||||
|
namespace DurnyklyYol.Module.Services
|
||||||
|
{
|
||||||
|
public interface INotificationService
|
||||||
|
{
|
||||||
|
Task NotifyClients(Cargo cargo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using FirebaseAdmin;
|
||||||
|
using FirebaseAdmin.Messaging;
|
||||||
|
using Google.Apis.Auth.OAuth2;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using FileSystemData;
|
||||||
|
using DurnyklyYol.Module.BusinessObjects;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using System.ServiceModel.Channels;
|
||||||
|
using DevExpress.Persistent.Base;
|
||||||
|
|
||||||
|
namespace DurnyklyYol.Module.Services
|
||||||
|
{
|
||||||
|
public class NotificationService : INotificationService
|
||||||
|
{
|
||||||
|
[ActivatorUtilitiesConstructor]
|
||||||
|
public NotificationService() {
|
||||||
|
var address = String.Format("{0}cargo-66-firebase-adminsdk.json", PathHelper.GetApplicationFolder());
|
||||||
|
Console.WriteLine(address);
|
||||||
|
if (FirebaseApp.DefaultInstance == null)
|
||||||
|
FirebaseApp.Create(new AppOptions()
|
||||||
|
{
|
||||||
|
Credential = GoogleCredential.FromFile(address)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
//private async Task<string> SendNotificationAsync(string title, string body, string token)
|
||||||
|
//{
|
||||||
|
// var message = new Message()
|
||||||
|
// {
|
||||||
|
// Notification = new Notification
|
||||||
|
// {
|
||||||
|
// Title = title,
|
||||||
|
// Body = body
|
||||||
|
// },
|
||||||
|
// Token = token
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return await FirebaseMessaging.DefaultInstance.SendAsync(message);
|
||||||
|
//}
|
||||||
|
|
||||||
|
public async Task NotifyClients(Cargo cargo)
|
||||||
|
{
|
||||||
|
if (cargo is not null) {
|
||||||
|
var goodsWithClientTokens = cargo.Goods
|
||||||
|
.Where(good => !string.IsNullOrEmpty(good.Client.FirebaseToken)) // Filter out clients with empty tokens
|
||||||
|
.Select(good => new
|
||||||
|
{
|
||||||
|
GoodsCode = good.No, // Assuming 'Code' is the property of Goods
|
||||||
|
ClientToken = good.Client.FirebaseToken
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
if (goodsWithClientTokens.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var messages = goodsWithClientTokens
|
||||||
|
.Select(item => new FirebaseAdmin.Messaging.Message
|
||||||
|
{
|
||||||
|
Notification = new Notification
|
||||||
|
{
|
||||||
|
Title = item.GoodsCode, // Customize title for each notification if necessary
|
||||||
|
Body = item.GoodsCode + " belgili ýüküňiz "+cargo.CurrentPoint.Name + " geldi." // Customize body for each notification if necessary
|
||||||
|
},
|
||||||
|
Token = item.ClientToken
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
await FirebaseMessaging.DefaultInstance.SendEachAsync(messages);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Application>
|
||||||
|
<Views Id="Views">
|
||||||
|
<ListView Id="Cargo_Goods_ListView">
|
||||||
|
<Columns Id="Columns">
|
||||||
|
<ColumnInfo Id="PackingType" Index="-1" />
|
||||||
|
<ColumnInfo Id="Volume" Index="4" />
|
||||||
|
<ColumnInfo Id="Height" Index="9" />
|
||||||
|
<ColumnInfo Id="Width" Index="10" />
|
||||||
|
<ColumnInfo Id="Depth" Index="11" />
|
||||||
|
</Columns>
|
||||||
|
</ListView>
|
||||||
|
<ListView Id="Client_Goods_ListView">
|
||||||
|
<Columns Id="Columns">
|
||||||
|
<ColumnInfo Id="Depth" Index="-1" />
|
||||||
|
<ColumnInfo Id="Height" Index="-1" />
|
||||||
|
<ColumnInfo Id="PackingType" Index="-1" />
|
||||||
|
<ColumnInfo Id="Width" Index="-1" />
|
||||||
|
</Columns>
|
||||||
|
</ListView>
|
||||||
|
<ListView Id="Goods_ListView">
|
||||||
|
<Columns Id="Columns">
|
||||||
|
<ColumnInfo Id="Volume" OwnerBand="Dimensions" />
|
||||||
|
<ColumnInfo Id="PackingType" OwnerBand="Dimensions" />
|
||||||
|
<ColumnInfo Id="Height" OwnerBand="Dimensions" />
|
||||||
|
<ColumnInfo Id="Width" OwnerBand="Dimensions" />
|
||||||
|
<ColumnInfo Id="Depth" OwnerBand="Dimensions" />
|
||||||
|
</Columns>
|
||||||
|
</ListView>
|
||||||
|
</Views>
|
||||||
|
</Application>
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Application>
|
||||||
|
<BOModel Id="BOModel">
|
||||||
|
<Class Name="DurnyklyYol.Module.BusinessObjects.Goods">
|
||||||
|
<OwnMembers Id="OwnMembers">
|
||||||
|
<Member Name="Depth" Caption="Uzynlygy" />
|
||||||
|
<Member Name="Height" Caption="Boýy" />
|
||||||
|
<Member Name="Images" Caption="Suratlary" />
|
||||||
|
<Member Name="PackingType" Caption="Gaplama görnüşi" />
|
||||||
|
<Member Name="Volume" Caption="Göwrümi" />
|
||||||
|
<Member Name="Width" Caption="Ini" />
|
||||||
|
</OwnMembers>
|
||||||
|
</Class>
|
||||||
|
<Class Name="DurnyklyYol.Module.BusinessObjects.GoodsImage">
|
||||||
|
<OwnMembers Id="OwnMembers">
|
||||||
|
<Member Name="Goods" Caption="Ýük" />
|
||||||
|
</OwnMembers>
|
||||||
|
</Class>
|
||||||
|
</BOModel>
|
||||||
|
</Application>
|
||||||
|
|
@ -28,21 +28,24 @@
|
||||||
<EmbeddedResource Include="Images\ExpressAppLogo.png" />
|
<EmbeddedResource Include="Images\ExpressAppLogo.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.5">
|
||||||
<PackageReference Include="DevExpress.ExpressApp.FileAttachment.Win" Version="24.1.4" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.PivotGrid.Win" Version="24.1.4" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.ReportsV2.Win" Version="24.1.4" />
|
</PackageReference>
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.FileAttachment.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo.Extensions.Win" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.PivotGrid.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Validation.Win" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.ReportsV2.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Win" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Win.Design" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Security.Xpo.Extensions.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Validation.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Win" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Win.Design" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.RichEdit.Export" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Win.Design" Version="24.1.4" />
|
<PackageReference Include="DevExpress.Persistent.Base" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.RichEdit.Export" Version="24.1.5" />
|
||||||
|
<PackageReference Include="DevExpress.Win.Design" Version="24.1.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DurnyklyYol.Module\DurnyklyYol.Module.csproj" />
|
<ProjectReference Include="..\DurnyklyYol.Module\DurnyklyYol.Module.csproj" />
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ public class ApplicationBuilder : IDesignTimeApplicationFactory {
|
||||||
// builder.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
// builder.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||||
|
|
||||||
builder.UseApplication<DurnyklyYolWindowsFormsApplication>();
|
builder.UseApplication<DurnyklyYolWindowsFormsApplication>();
|
||||||
|
|
||||||
builder.Modules
|
builder.Modules
|
||||||
.AddConditionalAppearance()
|
.AddConditionalAppearance()
|
||||||
.AddFileAttachments()
|
.AddFileAttachments()
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,14 @@
|
||||||
<EmbeddedResource Remove="Properties\**" />
|
<EmbeddedResource Remove="Properties\**" />
|
||||||
<None Remove="Properties\**" />
|
<None Remove="Properties\**" />
|
||||||
|
|
||||||
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.4">
|
<PackageReference Include="DevExpress.ExpressApp.CodeAnalysis" Version="24.1.5">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.4" />
|
<PackageReference Include="DevExpress.ExpressApp" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.Persistent.BaseImpl.Xpo" Version="24.1.5" />
|
||||||
<PackageReference Include="DevExpress.Xpo" Version="24.1.4" />
|
<PackageReference Include="DevExpress.Xpo" Version="24.1.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in New Issue