Compare commits
No commits in common. "feature/ModificationForSentNotificationAPI" and "master" have entirely different histories.
feature/Mo
...
master
@ -19,8 +19,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FirebaseAdmin" Version="2.3.0" />
|
||||
<PackageReference Include="FireSharp" Version="2.0.4" />
|
||||
<PackageReference Include="Google.Cloud.Firestore" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.9" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.9" />
|
||||
</ItemGroup>
|
||||
|
@ -36,8 +36,7 @@ using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using Newtonsoft.Json;
|
||||
using Abp.Json;
|
||||
using System.Diagnostics;
|
||||
using static Grpc.Core.Metadata;
|
||||
|
||||
|
||||
namespace BCS.BMC.CompanyMasters
|
||||
{
|
||||
@ -126,7 +125,7 @@ namespace BCS.BMC.CompanyMasters
|
||||
protected async Task<int> Create(CreateOrUpdateCompanyMasterInput input)
|
||||
{
|
||||
int companyId = 0;
|
||||
// await GetUrlIsValid(input.Url);
|
||||
|
||||
var company = from m in _companyMaster.GetAllList().Where(m => m.Url.ToLower().Trim() == input.Url.ToLower().Trim())
|
||||
|
||||
select m;
|
||||
@ -159,53 +158,6 @@ namespace BCS.BMC.CompanyMasters
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public async Task<ValidUrlResponseDto> UrlIsValid(string url)
|
||||
{
|
||||
bool istrue = false;
|
||||
var entity= new ValidUrlResponseDto();
|
||||
try
|
||||
{
|
||||
|
||||
HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest;
|
||||
request.Timeout = 5000; //set the timeout to 5 seconds to keep the user from waiting too long for the page to load
|
||||
request.Method = "HEAD"; //Get only the header information -- no need to download any content
|
||||
|
||||
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
|
||||
{
|
||||
int statusCode = (int)response.StatusCode;
|
||||
if (statusCode >= 100 && statusCode < 400) //Good requests
|
||||
{
|
||||
entity.IsSuccess = true;
|
||||
Uri uri = new Uri(url, UriKind.Absolute);
|
||||
var host = uri.Host;
|
||||
|
||||
if (host.Split('.').Length > 2)
|
||||
{
|
||||
int lastIndex = host.LastIndexOf(".");
|
||||
int index = host.LastIndexOf(".", lastIndex - 1);
|
||||
var subdomain = host.Substring(0, index);
|
||||
if (subdomain != "www")
|
||||
{
|
||||
entity.TenantName = subdomain;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (statusCode >= 500 && statusCode <= 510) //Server Errors
|
||||
{
|
||||
//log.Warn(String.Format("The remote server has thrown an internal error. Url is not valid: {0}", url));
|
||||
Debug.WriteLine(String.Format("The remote server has thrown an internal error. Url is not valid: {0}", url));
|
||||
istrue = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// log.Error(String.Format("Could not test url {0}.", url), ex);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
protected async Task Update(CreateOrUpdateCompanyMasterInput input)
|
||||
{
|
||||
var entity = await _companyMaster.FirstOrDefaultAsync(x => x.Id == input.Id);
|
||||
|
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.CompanyMasters.Dto
|
||||
{
|
||||
public class ValidUrlResponseDto
|
||||
{
|
||||
public bool IsSuccess { get; set; }
|
||||
public string TenantName { get; set; }
|
||||
}
|
||||
}
|
@ -28,6 +28,5 @@ namespace BCS.BMC.CompanyMasters
|
||||
Task DeleteCompany(EntityDto<int> input);
|
||||
[HttpPost]
|
||||
Task<HttpStatusCodeResult> TokenByCompanyUrl(GetInputUrl input);
|
||||
Task<ValidUrlResponseDto> UrlIsValid(string url);
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.FirebaseCloudMessaging.Dto
|
||||
{
|
||||
public class BmcMessageStatusInput
|
||||
{
|
||||
public List<string> UserId { get; set; }
|
||||
public long? ScheduleGenerationId { get; set; }
|
||||
public List<long> BmcIDs { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string CompanyUrl { get; set; }
|
||||
public bool IsSuccess { get; set; }
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
using Google.Cloud.Firestore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.FirebaseCloudMessaging.Dto
|
||||
{
|
||||
[FirestoreData]
|
||||
public class FireStoreNotificationModel
|
||||
{
|
||||
[FirestoreProperty]
|
||||
public string FcmToken { get; set; }
|
||||
//[FirestoreProperty]
|
||||
//public List<string> Id { get; set; }
|
||||
[FirestoreProperty]
|
||||
public string Message { get; set; }
|
||||
[FirestoreProperty]
|
||||
public DateTime? MessageSentDateTime { get; set; }
|
||||
[FirestoreProperty]
|
||||
|
||||
public string SenderImageurl { get; set; }
|
||||
[FirestoreProperty]
|
||||
public string SenderName { get; set; }
|
||||
[FirestoreProperty]
|
||||
public bool Status { get; set; }
|
||||
[FirestoreProperty]
|
||||
public List<string> UserId { get; set; }
|
||||
[FirestoreProperty]
|
||||
public int CompanyId { get; set; }
|
||||
[FirestoreProperty]
|
||||
public string ScheduleGenerationId { get; set; }
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
using FirebaseAdmin.Messaging;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -10,9 +9,9 @@ namespace BCS.BMC.FirebaseCloudMessaging.Dto
|
||||
{
|
||||
public class FireBaseResponseModel
|
||||
{
|
||||
public Notification notification { get; set; }
|
||||
public List<string> FcmToken { get; set; }
|
||||
|
||||
public BmcMessageStatusInput getResponseData { get; set; }
|
||||
[JsonProperty("isSuccess")]
|
||||
public bool IsSuccess { get; set; }
|
||||
[JsonProperty("message")]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +1,38 @@
|
||||
using Abp.AutoMapper;
|
||||
using BCS.BMC.BMC.FirebaseCloudMessages;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.FirebaseCloudMessaging.Dto
|
||||
{
|
||||
[AutoMapTo(typeof (FirebaseCloudMessageDetails))]
|
||||
public class NotificationModel
|
||||
{
|
||||
public string FcmToken { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
public DateTime? MessageSentDateTime { get; set; }
|
||||
|
||||
public string SenderImageurl { get; set; }
|
||||
public string SenderName { get; set; }
|
||||
|
||||
public bool Status { get; set; }
|
||||
public List<string> UserId { get; set; }
|
||||
public List<long> BmcIDs { get; set; }
|
||||
public string CompanyUrl { get; set; }
|
||||
public long? ScheduleGenerationId { get; set; }
|
||||
[JsonProperty("deviceId")]
|
||||
public string DeviceId { get; set; }
|
||||
[JsonProperty("isAndroidDevice")]
|
||||
public bool IsAndroidDevice { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("body")]
|
||||
public string Body { get; set; }
|
||||
}
|
||||
|
||||
//[AutoMapFrom(typeof(NotificationModel))]
|
||||
//public class FirebaseNotification : NotificationModel
|
||||
//{
|
||||
// public List<string> Id { get; set; }
|
||||
//}
|
||||
public class GoogleNotification
|
||||
{
|
||||
public class DataPayload
|
||||
{
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("body")]
|
||||
public string Body { get; set; }
|
||||
}
|
||||
[JsonProperty("priority")]
|
||||
public string Priority { get; set; } = "high";
|
||||
[JsonProperty("data")]
|
||||
public DataPayload Data { get; set; }
|
||||
[JsonProperty("notification")]
|
||||
public DataPayload Notification { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,7 @@ using System.Threading.Tasks;
|
||||
using FirebaseAdmin;
|
||||
using Google.Apis.Auth.OAuth2;
|
||||
using System;
|
||||
using BCS.BMC.FirebaseCloudMessaging.Dto;
|
||||
using System.Collections.Generic;
|
||||
using Abp.Json;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
namespace BCS.BMC.FirebaseCloudMessaging
|
||||
{
|
||||
@ -25,27 +22,23 @@ namespace BCS.BMC.FirebaseCloudMessaging
|
||||
}
|
||||
|
||||
|
||||
public async Task<BatchResponse> SendNotification(FireBaseResponseModel notification)
|
||||
public static async Task<string> SendNotification(string fcmToken, Notification notification)
|
||||
{
|
||||
try
|
||||
{
|
||||
var message = new MulticastMessage()
|
||||
var message = new Message()
|
||||
{
|
||||
Notification = notification.notification,
|
||||
Tokens = notification.FcmToken,
|
||||
Notification = notification,
|
||||
Token = fcmToken,
|
||||
};
|
||||
|
||||
var response = await FirebaseMessaging.DefaultInstance.SendMulticastAsync(message);
|
||||
return response;
|
||||
return await FirebaseMessaging.DefaultInstance.SendAsync(message) ;
|
||||
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
public async Task GetNotification(NotificationModel notification)
|
||||
{
|
||||
var data = notification;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Abp.Application.Services;
|
||||
using BCS.BMC.FirebaseCloudMessaging.Dto;
|
||||
using FirebaseAdmin.Messaging;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -7,7 +6,6 @@ namespace BCS.BMC.FirebaseCloudMessaging
|
||||
{
|
||||
public interface IFirebaseNotificationAppService : IApplicationService
|
||||
{
|
||||
Task<BatchResponse> SendNotification(FireBaseResponseModel notification);
|
||||
Task GetNotification(NotificationModel notification);
|
||||
// Task<string> SendNotification(string fcmToken, Notification notification);
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
using Abp.Domain.Entities.Auditing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.BMC.FirebaseCloudMessages
|
||||
{
|
||||
[Table("FirebaseCloudMessageDetails")]
|
||||
public class FirebaseCloudMessageDetails : FullAuditedEntity
|
||||
{
|
||||
public const int SenderNameMaxLength = 32;
|
||||
public const int SenderImageurlMaxLength = 256;
|
||||
public const int FcmTokenMaxLength = 512;
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
[MaxLength(FcmTokenMaxLength)]
|
||||
public string FcmToken { get; set; }
|
||||
[MaxLength(SenderImageurlMaxLength)]
|
||||
public string SenderImageurl { get; set; }
|
||||
[MaxLength(SenderNameMaxLength)]
|
||||
public string SenderName { get; set; }
|
||||
public DateTime? MessageSentDateTime { get; set; }
|
||||
public bool Status { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using Abp.Domain.Entities.Auditing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.BMC.FirebaseCloudMessages
|
||||
{
|
||||
[Table("FirebaseToken")]
|
||||
public class FirebaseToken : FullAuditedEntity
|
||||
{
|
||||
public const int HostNameMaxLength = 512;
|
||||
public int? UserId { get; set; }
|
||||
[MaxLength(HostNameMaxLength)]
|
||||
public string HostName { get; set; }
|
||||
public string FcmToken { get; set; }
|
||||
}
|
||||
}
|
@ -126,7 +126,5 @@
|
||||
<text name="CompanyMaster">Company Master</text>
|
||||
<text name="Url">Url</text>
|
||||
<text name="Id">Id</text>
|
||||
<text name="CreateNewCompany">Create New Company</text>
|
||||
<text name="EditCompany">Edit Company</text>
|
||||
</texts>
|
||||
</localizationDictionary>
|
||||
|
@ -4,7 +4,6 @@ using BCS.BMC.Authorization.Roles;
|
||||
using BCS.BMC.Authorization.Users;
|
||||
using BCS.BMC.MultiTenancy;
|
||||
using BCS.BMC.BMC.CompanyMasters;
|
||||
using BCS.BMC.BMC.FirebaseCloudMessages;
|
||||
|
||||
namespace BCS.BMC.EntityFrameworkCore
|
||||
{
|
||||
@ -12,8 +11,7 @@ namespace BCS.BMC.EntityFrameworkCore
|
||||
{
|
||||
/* Define a DbSet for each entity of the application */
|
||||
public virtual DbSet<CompanyMaster> CompanyMasters { get; set; }
|
||||
public virtual DbSet<FirebaseCloudMessageDetails> FirebaseCloudMessageDetail { get; set; }
|
||||
public virtual DbSet<FirebaseToken> FirebaseTokens { get; set; }
|
||||
|
||||
public BMCDbContext(DbContextOptions<BMCDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BCS.BMC.Migrations
|
||||
{
|
||||
public partial class FirebaeCloudMessageDetails : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FirebaseCloudMessageDetails",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
UserId = table.Column<int>(type: "int", nullable: false),
|
||||
FcmToken = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
|
||||
SenderImageurl = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
SenderName = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
|
||||
MessageSentDateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Status = table.Column<bool>(type: "bit", nullable: false),
|
||||
Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeleterUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FirebaseCloudMessageDetails", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FirebaseCloudMessageDetails");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BCS.BMC.Migrations
|
||||
{
|
||||
public partial class FirebaseToken : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FirebaseToken",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
UserId = table.Column<int>(type: "int", nullable: true),
|
||||
HostName = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
|
||||
FcmToken = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeleterUserId = table.Column<long>(type: "bigint", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FirebaseToken", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FirebaseToken");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BCS.BMC.Migrations
|
||||
{
|
||||
public partial class RemoveIdFrom_FirebaseToken : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1613,108 +1613,6 @@ namespace BCS.BMC.Migrations
|
||||
b.ToTable("CompanyMaster");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BCS.BMC.BMC.FirebaseCloudMessages.FirebaseCloudMessageDetails", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("CreatorUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("DeleterUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FcmToken")
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("nvarchar(512)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("LastModifierUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("MessageSentDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("SenderImageurl")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("SenderName")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("nvarchar(32)");
|
||||
|
||||
b.Property<bool>("Status")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("FirebaseCloudMessageDetails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BCS.BMC.BMC.FirebaseCloudMessages.FirebaseToken", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("CreatorUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("DeleterUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FcmToken")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("HostName")
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("nvarchar(512)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("LastModifierUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int?>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("FirebaseToken");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BCS.BMC.MultiTenancy.Tenant", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -29,7 +29,6 @@ using System.Text;
|
||||
using System.IO;
|
||||
using Abp.AutoMapper;
|
||||
using Abp.Domain.Entities;
|
||||
using BCS.BMC.BMC.FirebaseCloudMessages;
|
||||
|
||||
namespace BCS.BMC.Controllers
|
||||
{
|
||||
@ -44,7 +43,6 @@ namespace BCS.BMC.Controllers
|
||||
private readonly IExternalAuthManager _externalAuthManager;
|
||||
private readonly UserRegistrationManager _userRegistrationManager;
|
||||
private readonly IRepository<CompanyMaster, int> _companyMaster;
|
||||
private readonly IRepository<FirebaseToken, int> _firebaseToken;
|
||||
ResponseMessageModel responsemessage = new ResponseMessageModel();
|
||||
public TokenAuthController(
|
||||
LogInManager logInManager,
|
||||
@ -54,8 +52,7 @@ namespace BCS.BMC.Controllers
|
||||
IExternalAuthConfiguration externalAuthConfiguration,
|
||||
IExternalAuthManager externalAuthManager,
|
||||
UserRegistrationManager userRegistrationManager,
|
||||
IRepository<CompanyMaster, int> companyMaster,
|
||||
IRepository<FirebaseToken, int> firebaseToken)
|
||||
IRepository<CompanyMaster, int> companyMaster)
|
||||
{
|
||||
_logInManager = logInManager;
|
||||
_tenantCache = tenantCache;
|
||||
@ -65,7 +62,6 @@ namespace BCS.BMC.Controllers
|
||||
_externalAuthManager = externalAuthManager;
|
||||
_userRegistrationManager = userRegistrationManager;
|
||||
_companyMaster = companyMaster;
|
||||
_firebaseToken = firebaseToken;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@ -267,12 +263,7 @@ namespace BCS.BMC.Controllers
|
||||
{
|
||||
return BadRequest("Url Not Found");
|
||||
}
|
||||
var result = new
|
||||
{
|
||||
CompanyId = company.Id,
|
||||
|
||||
};
|
||||
return Ok(result);
|
||||
return Ok("Success");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@ -282,7 +273,7 @@ namespace BCS.BMC.Controllers
|
||||
var protocol = "";
|
||||
if (string.IsNullOrWhiteSpace(input.CompanyUrl))
|
||||
{
|
||||
return BadRequest("Please enter a valid Url");
|
||||
return BadRequest("Please Enter A Valid Url");
|
||||
}
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
@ -305,11 +296,6 @@ namespace BCS.BMC.Controllers
|
||||
{
|
||||
return BadRequest("Invalid Company Url");
|
||||
}
|
||||
var companyAccountId = await _companyMaster.FirstOrDefaultAsync(x => x.CompanyName == input.CompanyId);
|
||||
if (companyAccountId == null)
|
||||
{
|
||||
return BadRequest("Please enter valid Company Account ID");
|
||||
}
|
||||
|
||||
// var baseUrl = uri + "api/BmcLogin";
|
||||
var baseUrl = protocol + "://" + host + "/api/BmcLogin";
|
||||
@ -328,23 +314,6 @@ namespace BCS.BMC.Controllers
|
||||
{
|
||||
var responseStream = await response.Content.ReadAsStringAsync();
|
||||
LoginOrRegisterResponseMessageModel result = JsonConvert.DeserializeObject<LoginOrRegisterResponseMessageModel>(responseStream);
|
||||
result.result.CompanyId = company.Id;
|
||||
|
||||
var getTokenDetails = _firebaseToken.GetAllList().Where(x => x.HostName == host && x.UserId == int.Parse(result.result.userId)).FirstOrDefault();
|
||||
if (getTokenDetails is null)
|
||||
{
|
||||
FirebaseToken entity = new FirebaseToken();
|
||||
entity.UserId = int.Parse(result.result.userId);
|
||||
entity.HostName = host;
|
||||
entity.FcmToken = input.FcmToken;
|
||||
await _firebaseToken.InsertAndGetIdAsync(entity);
|
||||
}
|
||||
if (getTokenDetails != null)
|
||||
{
|
||||
getTokenDetails.FcmToken = input.FcmToken;
|
||||
|
||||
await _firebaseToken.UpdateAsync(getTokenDetails);
|
||||
}
|
||||
return Ok(result);
|
||||
}
|
||||
else if (response.StatusCode == HttpStatusCode.InternalServerError)
|
||||
@ -352,7 +321,7 @@ namespace BCS.BMC.Controllers
|
||||
var contents = await response.Content.ReadAsStringAsync();
|
||||
ResponseMessageModel result = JsonConvert.DeserializeObject<ResponseMessageModel>(contents);
|
||||
|
||||
return BadRequest(result.error.message == "Login Failed" ? "Please enter valid Username or Password" : result.error.message);
|
||||
return BadRequest(result.error.message == "Login Failed" ? "Invalid Username Or Password" : result.error.message);
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
@ -373,11 +342,6 @@ namespace BCS.BMC.Controllers
|
||||
{
|
||||
return BadRequest("Url Not Found");
|
||||
}
|
||||
var companyAccountId = await _companyMaster.FirstOrDefaultAsync(x => x.CompanyName == input.CompanyAccountId);
|
||||
if (companyAccountId == null)
|
||||
{
|
||||
return BadRequest("Please enter valid Company Account ID");
|
||||
}
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
var baseUrl = input.CompanyUrl + "/api/services/bwac/employeeRegister/RegisterEmployeeAsNewUser";
|
||||
@ -398,7 +362,6 @@ namespace BCS.BMC.Controllers
|
||||
{
|
||||
var responseStream = await response.Content.ReadAsStringAsync();
|
||||
LoginOrRegisterResponseMessageModel result = JsonConvert.DeserializeObject<LoginOrRegisterResponseMessageModel>(responseStream);
|
||||
result.result.CompanyId = company.Id;
|
||||
return Ok(result);
|
||||
}
|
||||
else if (response.StatusCode == HttpStatusCode.InternalServerError)
|
||||
@ -410,25 +373,5 @@ namespace BCS.BMC.Controllers
|
||||
}
|
||||
return BadRequest();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> DeleteRegisteredFcmToken([FromBody] FcmTokenDeleteInput input)
|
||||
{
|
||||
Uri uri = new Uri(input.HostName);
|
||||
var host = uri.Host;
|
||||
var getTokenDetails = _firebaseToken.GetAllList().Where(x => x.HostName == host && x.UserId == input.UserId).FirstOrDefault();
|
||||
|
||||
if (getTokenDetails != null)
|
||||
{
|
||||
FirebaseToken entity = new FirebaseToken();
|
||||
getTokenDetails.FcmToken = null;
|
||||
await _firebaseToken.UpdateAsync(getTokenDetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
return BadRequest("logout failed");
|
||||
}
|
||||
return Ok("Success");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BCS.BMC.BMC.CompanyMasters;
|
||||
using Abp.AutoMapper;
|
||||
using BCS.BMC.BMC.FirebaseCloudMessages;
|
||||
|
||||
namespace BCS.BMC.Models.TokenAuth
|
||||
{
|
||||
|
||||
[AutoMap(typeof(FirebaseToken))]
|
||||
public class CreateOrUpdateFireBaseModel
|
||||
{
|
||||
public int? UserId { get; set; }
|
||||
public string HostName { get; set; }
|
||||
public string FcmToken { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.Models.TokenAuth
|
||||
{
|
||||
public class FcmTokenDeleteInput
|
||||
{
|
||||
public int UserId { get; set; }
|
||||
public string HostName { get; set; }
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using FirebaseAdmin.Messaging;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.Models.TokenAuth
|
||||
{
|
||||
public class FcmTokenResponseModel
|
||||
{
|
||||
public result results { get; set; }
|
||||
}
|
||||
|
||||
public class results
|
||||
{
|
||||
public string message { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ namespace BCS.BMC.Models.TokenAuth
|
||||
public class LoginInputModel
|
||||
{
|
||||
public string CompanyUrl { get; set; }
|
||||
public string CompanyId { get; set; }
|
||||
public string UsernameOrEmailAddress { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string FcmToken { get; set; }
|
||||
|
@ -16,14 +16,9 @@ namespace BCS.BMC.Models.TokenAuth
|
||||
|
||||
public int statusCode { get; set; }
|
||||
public string userName { get; set; }
|
||||
public string firstName { get; set; }
|
||||
public string lastName { get; set; }
|
||||
public string emailAddress { get; set; }
|
||||
public string userId { get; set; }
|
||||
public string employeeId { get; set; }
|
||||
public string phoneNo { get; set; }
|
||||
public string profilePictureId { get; set; }
|
||||
public int? CompanyId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ namespace BCS.BMC.Models.TokenAuth
|
||||
{
|
||||
public class RegistrationInput
|
||||
{
|
||||
public string CompanyAccountId { get; set; }
|
||||
public string Firstname { get; set; }
|
||||
public string Lastname { get; set; }
|
||||
public string UserNameOrEmail { get; set; }
|
||||
public string Phoneno { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
@ -32,8 +32,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
|
||||
<PackageReference Include="FireSharp" Version="2.0.4" />
|
||||
<PackageReference Include="Google.Cloud.Firestore" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
@ -37,10 +37,5 @@ namespace BCS.BMC.Web.Controllers
|
||||
|
||||
return PartialView("_EditModal", output);
|
||||
}
|
||||
//public async Task<bool> GetUrlIsValid(string url)
|
||||
//{
|
||||
// bool isSuccess = await _companyasterService.GetUrlIsValid(url);
|
||||
// return isSuccess;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
using BCS.BMC.Controllers;
|
||||
using BCS.BMC.FirebaseCloudMessaging;
|
||||
using FirebaseAdmin.Messaging;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.Web.Controllers
|
||||
{
|
||||
//[Route("api/notification")]
|
||||
//[ApiController]
|
||||
public class FirebaseNotificationController : BMCControllerBase
|
||||
{
|
||||
private readonly FirebaseNotificationAppService _notificationService;
|
||||
|
||||
public FirebaseNotificationController(FirebaseNotificationAppService notificationService)
|
||||
{
|
||||
_notificationService = notificationService;
|
||||
}
|
||||
|
||||
[Route("send")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> Notification(string fcmToken, [FromBody] Notification notification)
|
||||
{
|
||||
var result = await FirebaseNotificationAppService.SendNotification(fcmToken, notification);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
using Abp.AutoMapper;
|
||||
using Abp.Domain.Repositories;
|
||||
using Abp.Json;
|
||||
using BCS.BMC.BMC.CompanyMasters;
|
||||
using BCS.BMC.BMC.FirebaseCloudMessages;
|
||||
using BCS.BMC.Controllers;
|
||||
using BCS.BMC.FirebaseCloudMessaging;
|
||||
using BCS.BMC.FirebaseCloudMessaging.Dto;
|
||||
using BCS.BMC.Models.TokenAuth;
|
||||
using FirebaseAdmin.Messaging;
|
||||
using FireSharp.Config;
|
||||
using FireSharp.Interfaces;
|
||||
using FireSharp.Response;
|
||||
using Google.Cloud.Firestore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BCS.BMC.Web.Controllers
|
||||
{
|
||||
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class NotificationController : BMCControllerBase
|
||||
{
|
||||
|
||||
private readonly IFirebaseNotificationAppService _notificationService;
|
||||
private readonly IRepository<FirebaseCloudMessageDetails> _firebaseCloudMessageDetails;
|
||||
private readonly IRepository<FirebaseToken, int> _firebaseToken;
|
||||
private readonly IRepository<CompanyMaster, int> _companyMasterService;
|
||||
//IFirebaseConfig config = new FirebaseConfig
|
||||
//{
|
||||
// AuthSecret = "n6DTPQEbpnLahrrk2EYu4bJ2Wd3jCk2N8kocazdI",
|
||||
// BasePath = "https://firechat-57601-default-rtdb.europe-west1.firebasedatabase.app/"
|
||||
//};
|
||||
//IFirebaseClient client;
|
||||
public NotificationController(IFirebaseNotificationAppService notificationService,
|
||||
IRepository<FirebaseCloudMessageDetails> firebaseCloudMessageDetails,
|
||||
IRepository<FirebaseToken, int> firebaseToken,
|
||||
IRepository<CompanyMaster, int> companyMasterService)
|
||||
{
|
||||
_notificationService = notificationService;
|
||||
_firebaseCloudMessageDetails = firebaseCloudMessageDetails;
|
||||
_firebaseToken = firebaseToken;
|
||||
_companyMasterService = companyMasterService;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> SendNotification([FromBody] FireBaseResponseModel notification)
|
||||
{
|
||||
var result = await _notificationService.SendNotification(notification);
|
||||
|
||||
|
||||
if (result.SuccessCount > 0)
|
||||
{
|
||||
if (notification.getResponseData != null)
|
||||
{
|
||||
notification.getResponseData.IsSuccess = true;
|
||||
notification.getResponseData.Status = "Delivered";
|
||||
}
|
||||
await UpdateBmcMessageStatus(notification.getResponseData);
|
||||
return Ok(result);
|
||||
}
|
||||
if (result.FailureCount > 0)
|
||||
{
|
||||
if (notification.getResponseData != null)
|
||||
{
|
||||
notification.getResponseData.IsSuccess = false;
|
||||
notification.getResponseData.Status = result.Responses[0].Exception.Message;
|
||||
}
|
||||
await UpdateBmcMessageStatus(notification.getResponseData);
|
||||
return BadRequest(result.Responses);
|
||||
}
|
||||
|
||||
return Ok(result.Responses);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetNotifications([FromBody] NotificationModel notification)
|
||||
{
|
||||
string path = AppDomain.CurrentDomain.BaseDirectory + @"firechat-57601-firebase-adminsdk-anscp-e04366c4d4.json";
|
||||
Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", path);
|
||||
var companyDetails = _companyMasterService.GetAllList().Where(x => x.Url.Trim() == notification.CompanyUrl.Trim()).FirstOrDefault();
|
||||
try
|
||||
{
|
||||
FirestoreDb db = FirestoreDb.Create("firechat-57601");
|
||||
FireStoreNotificationModel data = new FireStoreNotificationModel();
|
||||
|
||||
data.FcmToken = notification.FcmToken;
|
||||
// data.Id = notification.Id;
|
||||
data.Message = notification.Message;
|
||||
data.MessageSentDateTime = notification.MessageSentDateTime;
|
||||
//data.MessageSentDateTime = DateTime.UtcNow;
|
||||
data.SenderImageurl = notification.SenderImageurl;
|
||||
data.SenderName = notification.SenderName;
|
||||
data.Status = notification.Status;
|
||||
data.UserId = notification.UserId;
|
||||
data.CompanyId = companyDetails.Id;
|
||||
data.ScheduleGenerationId = notification.ScheduleGenerationId.ToString();
|
||||
await db.Collection("BMC_Notification").Document().SetAsync(data);
|
||||
|
||||
var responseData = new BmcMessageStatusInput();
|
||||
{
|
||||
responseData.UserId = notification.UserId;
|
||||
responseData.ScheduleGenerationId = notification.ScheduleGenerationId;
|
||||
responseData.CompanyUrl = notification.CompanyUrl;
|
||||
responseData.BmcIDs = notification.BmcIDs;
|
||||
}
|
||||
|
||||
int userId = 0;
|
||||
List<string> tokenList = new List<string>();
|
||||
foreach (var item in notification.UserId)
|
||||
{
|
||||
userId = Convert.ToInt32(item);
|
||||
var getTokenDetails = _firebaseToken.GetAllList().Where(x => x.UserId == userId).FirstOrDefault();
|
||||
tokenList.Add(getTokenDetails.FcmToken.ToString());
|
||||
|
||||
var entity = new FirebaseCloudMessageDetails();
|
||||
entity.UserId = userId;
|
||||
entity.SenderImageurl = notification.SenderImageurl;
|
||||
entity.SenderName = notification.SenderName;
|
||||
entity.MessageSentDateTime = notification.MessageSentDateTime;
|
||||
entity.Status = notification.Status;
|
||||
entity.Message = notification.Message;
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
await _firebaseCloudMessageDetails.InsertAndGetIdAsync(entity);
|
||||
}
|
||||
}
|
||||
var title = notification.SenderName.ToJsonString();
|
||||
var body = notification.Message.ToJsonString();
|
||||
var sendNotificationInfo = new FireBaseResponseModel();
|
||||
{
|
||||
sendNotificationInfo.FcmToken = tokenList;
|
||||
}
|
||||
|
||||
Notification notifications = new Notification
|
||||
{
|
||||
Title = title,
|
||||
Body = body,
|
||||
//ImageUrl = null
|
||||
};
|
||||
sendNotificationInfo.notification = notifications;
|
||||
sendNotificationInfo.getResponseData = responseData;
|
||||
await SendNotification(sendNotificationInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> UpdateBmcMessageStatus([FromBody] BmcMessageStatusInput bmcMessageStatusInput)
|
||||
{
|
||||
var companyDetails = _companyMasterService.GetAllList().Where(x => x.Url.Trim() == bmcMessageStatusInput.CompanyUrl.Trim()).FirstOrDefault();
|
||||
var baseUrl = companyDetails.Url + "api/services/bwac/updateBmcMessageStatus/UpdateMessageStatus";
|
||||
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
var requestJson = JsonConvert.SerializeObject(bmcMessageStatusInput);
|
||||
var requestContent = new StringContent(requestJson.ToString());
|
||||
requestContent.Headers.ContentType = new MediaTypeWithQualityHeaderValue("application/json");
|
||||
HttpResponseMessage response = await client.PostAsync(baseUrl, requestContent);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
<div class="modal fade" id="ClientMasterCreateModal" tabindex="-1" role="dialog" aria-labelledby="UserCreateModalLabel" data-backdrop="static">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("CreateNewCompany")))
|
||||
@* @await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("CreateNewUser")))*@
|
||||
<form name="clientMasterCreateForm" role="form" class="form-horizontal">
|
||||
<div class="modal-body">
|
||||
@*<ul class="nav nav-tabs" role="tablist">
|
||||
@ -26,17 +26,15 @@
|
||||
<div class="tab-content mt-4">
|
||||
<div role="tabpanel" class="tab-pane container active" id="create-client-details">
|
||||
<div class="form-group row required">
|
||||
<label class="col-md-2 col-form-label">@L("Url")</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" id="Url" name="Url" required>
|
||||
<label class="col-md-3 col-form-label">@L("Company")</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="CompanyName" required maxlength="@AbpUserBase.MaxUserNameLength" minlength="2">
|
||||
</div>
|
||||
<input type="submit" value="Check Url" class="btn btn-secondary btn-sm download-button" name="submit">
|
||||
</div>
|
||||
|
||||
<div class="form-group row" id="div_CompanyName" style="visibility : hidden">
|
||||
<label class="col-md-2 col-form-label">@L("Company")</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="CompanyName" id="CompanyName" readonly>
|
||||
<div class="form-group row required">
|
||||
<label class="col-md-3 col-form-label">@L("Url")</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="Url" required maxlength="@AbpUserBase.MaxNameLength">
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="form-group row required">
|
||||
|
@ -6,7 +6,7 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditCompany")))
|
||||
|
||||
<form name="EditCompanyForm" role="form" class="form-horizontal">
|
||||
<input type="hidden" name="Id" value="@Model.Id" />
|
||||
<input type="hidden" name="DomainName" value="@Model.DomainName" />
|
||||
@ -23,20 +23,18 @@
|
||||
</ul>*@
|
||||
<div class="tab-content mt-4">
|
||||
<div role="tabpanel" class="tab-pane container active" id="edit-company-details">
|
||||
<div class="form-group row required">
|
||||
<label class="col-md-3 col-form-label">@L("Url")</label>
|
||||
<div class="col-md-9">
|
||||
<input id="url" type="text" class="form-control" name="Url" value="@Model.Url" required maxlength="@AbpUserBase.MaxUserNameLength" minlength="2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row required">
|
||||
<label class="col-md-3 col-form-label">@L("Company")</label>
|
||||
<div class="col-md-9">
|
||||
<input id="CompanyName" type="text" class="form-control" name="CompanyName" value="@Model.CompanyName" required maxlength="@AbpUserBase.MaxUserNameLength" minlength="2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row required">
|
||||
<label class="col-md-3 col-form-label">@L("Domain")</label>
|
||||
<div class="col-md-9">
|
||||
<input id="url" type="text" class="form-control" name="Url" value="@Model.Url" required maxlength="@AbpUserBase.MaxUserNameLength" minlength="2">
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="form-group row required">
|
||||
<label class="col-md-3 col-form-label">@L("ClientSubDomainName")</label>
|
||||
<div class="col-md-9">
|
||||
|
@ -84,21 +84,6 @@
|
||||
$('input[type="checkbox"]', rows).prop('checked', this.checked);
|
||||
});
|
||||
|
||||
_$form.find('.download-button').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
var companydetails = _$form.serializeFormToObject();
|
||||
//abp.ui.setBusy();
|
||||
var companyUrl = companydetails.Url;
|
||||
|
||||
abp.notify.info(l('ValidatingUrl'));
|
||||
var data = _companyService.urlIsValid(companyUrl);
|
||||
data.done(function (result) {
|
||||
$('#div_CompanyName').attr("style", "visibility : visible");
|
||||
$('#CompanyName').val(result.tenantName);
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
_$form.find('.save-button').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user