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;
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;
var entity = input.MapTo<CompanyMaster>();
@ -152,9 +152,8 @@ namespace BCS.BMC.CompanyMasters
companyId = await _companyMaster.InsertAndGetIdAsync(entity);
}
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;
}

View File

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

View File

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

View File

@ -173,41 +173,8 @@
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 () {
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
.row({ selected: true })
.data();
@ -221,10 +188,9 @@
}
deletOpenTagsByCheckBoxes();
});
// });
function deletOpenTagsByCheckBoxes(idList) {
debugger;
abp.utils.formatString(
l('Deleteselectedrecords'),
function (isConfirmed) {