Browse Source

AddValidationWhileCreatingComPanyMaster

feature/AddUrlPropertyInLoginAndRegister
Palash Biswas 2 years ago
parent
commit
0529c994a3
4 changed files with 8 additions and 43 deletions
  1. +4
    -5
      BCS.BMC/src/BCS.BMC.Application/CompanyMasters/CompanyMasterAppService.cs
  2. +1
    -1
      BCS.BMC/src/BCS.BMC.Core/BMCCoreModule.cs
  3. +1
    -1
      BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs
  4. +2
    -36
      BCS.BMC/src/BCS.BMC.Web.Mvc/wwwroot/view-resources/Views/CompanyMaster/Index.js

+ 4
- 5
BCS.BMC/src/BCS.BMC.Application/CompanyMasters/CompanyMasterAppService.cs View File

@ -126,8 +126,8 @@ namespace BCS.BMC.CompanyMasters
{ {
int companyId = 0; int companyId = 0;
var company = from m in _companyMaster.GetAllList().Where(m => m.Id == input.Id && m.CompanyName.ToLower().Trim() == input.CompanyName.ToLower().Trim()
&& m.Url == input.Url.Trim())
var company = from m in _companyMaster.GetAllList().Where(m => m.Url.ToLower().Trim() == input.Url.ToLower().Trim())
select m; select m;
var entity = input.MapTo<CompanyMaster>(); var entity = input.MapTo<CompanyMaster>();
@ -152,9 +152,8 @@ namespace BCS.BMC.CompanyMasters
companyId = await _companyMaster.InsertAndGetIdAsync(entity); companyId = await _companyMaster.InsertAndGetIdAsync(entity);
} }
else else
{
//throw new UserFriendlyException(string.Format(L("ClientDuplicateMessage"), L(input.ClientName)));
throw new UserFriendlyException("Url Already Exist");
{
throw new UserFriendlyException("The Input Url Already Exist");
} }
return companyId; return companyId;
} }


+ 1
- 1
BCS.BMC/src/BCS.BMC.Core/BMCCoreModule.cs View File

@ -29,7 +29,7 @@ namespace BCS.BMC
BMCLocalizationConfigurer.Configure(Configuration.Localization); BMCLocalizationConfigurer.Configure(Configuration.Localization);
// Enable this line to create a multi-tenant application. // Enable this line to create a multi-tenant application.
Configuration.MultiTenancy.IsEnabled = BMCConsts.MultiTenancyEnabled;
//Configuration.MultiTenancy.IsEnabled = BMCConsts.MultiTenancyEnabled;
// Configure roles // Configure roles
AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement); AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);


+ 1
- 1
BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs View File

@ -247,7 +247,7 @@ namespace BCS.BMC.Controllers
} }
[HttpGet] [HttpGet]
public async Task<ActionResult> ValidateTenancy(GetUrlDto input)
public async Task<ActionResult> ValidateTenancy([FromBody] GetUrlDto input)
{ {
if (input.InputUrl == null) if (input.InputUrl == null)
{ {


+ 2
- 36
BCS.BMC/src/BCS.BMC.Web.Mvc/wwwroot/view-resources/Views/CompanyMaster/Index.js View File

@ -173,41 +173,8 @@
var $delete = $('#btnDelete'); var $delete = $('#btnDelete');
//$("#btnDelete").on("click", function () {
// debugger;
// _$companyTable.rows($('table tr').has('input:checked')).remove().draw();
//})
//$("#btnDelete").on("click", function () {
// debugger;
// const table = document.getElementById("CompanyMasterTable");
// console.log(table.id);
// //for (const [index, row] of [...table.rows].entries()) {
// // if (row.querySelector('input:checked')) {
// //table.deleteRow(index);
// // console.log(table);
// // deletOpenTagsByCheckBoxes(index);
// // }
// // }
//});
// $(function () {
$delete.click(function () { $delete.click(function () {
debugger;
//var ids = $.map(_$companyTable('getSelections'), function (row) {
// return row.id
// });
//var rows = _$companyTable.rows({ 'search': 'applied' }).nodes();
//var deleteId = $('input[type="checkbox"]', rows).prop('checked', this.checked);
//var ids = deleteId;
//var ids = $('#CompanyMasterTable').column(1, { selected: true }).data();
//var ids = []
//$('input[type="checkbox"]:checked').each(function () {
// ids.push($(this).data('id'))
//})
var ids = _$companyTable var ids = _$companyTable
.row({ selected: true }) .row({ selected: true })
.data(); .data();
@ -221,10 +188,9 @@
} }
deletOpenTagsByCheckBoxes(); deletOpenTagsByCheckBoxes();
}); });
// });
function deletOpenTagsByCheckBoxes(idList) { function deletOpenTagsByCheckBoxes(idList) {
debugger;
abp.utils.formatString( abp.utils.formatString(
l('Deleteselectedrecords'), l('Deleteselectedrecords'),
function (isConfirmed) { function (isConfirmed) {


Loading…
Cancel
Save