AddValidationWhileCreatingComPanyMaster

This commit is contained in:
Palash Biswas 2022-10-19 23:33:58 +05:30
parent a3c1042ed2
commit 0529c994a3
4 changed files with 7 additions and 42 deletions

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() var company = from m in _companyMaster.GetAllList().Where(m => m.Url.ToLower().Trim() == input.Url.ToLower().Trim())
&& m.Url == input.Url.Trim())
select m; select m;
var entity = input.MapTo<CompanyMaster>(); var entity = input.MapTo<CompanyMaster>();
@ -153,8 +153,7 @@ namespace BCS.BMC.CompanyMasters
} }
else else
{ {
//throw new UserFriendlyException(string.Format(L("ClientDuplicateMessage"), L(input.ClientName))); throw new UserFriendlyException("The Input Url Already Exist");
throw new UserFriendlyException("Url Already Exist");
} }
return companyId; return companyId;
} }

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);

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)
{ {

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) {