public async Task <IActionResult> BankDetailAdd(VendorBankDetailsViewModel model) { if (this.ModelState.IsValid) { var record = this.Mapper.Map <VendorBankDetailModel>(model); record.AccountNumber = string.IsNullOrEmpty(record.AccountNumber) ? string.Empty : record.AccountNumber.ToUpper(); record.PAN = string.IsNullOrEmpty(record.PAN) ? string.Empty : record.PAN.ToUpper(); record.GST = string.IsNullOrEmpty(record.GST) ? string.Empty : record.GST.ToUpper(); if (model.Id > 0) { ////Update record.UpdateAuditInfo(new Guid(this.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Sid).Value)); await this.vendorService.UpdateVendorBankDetailtAsync(record); this.ShowMessage("Updated Successfully"); } else { record.SetAuditInfo(new Guid(this.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Sid).Value)); await this.vendorService.AddVendorBankDetailAsync(record); this.ShowMessage("Added Successfully"); } this.TempData["nextview"] = "#vendor-bank"; return(this.Json("success")); } return(this.Json("failure")); }
public async Task <IActionResult> BankDetailAdd(int id, int vendorId) { this.ViewBag.VendorId = id; VendorBankDetailsViewModel model = new VendorBankDetailsViewModel { Id = 0, VendorId = vendorId }; if (id > 0) { model = this.Mapper.Map <VendorBankDetailsViewModel>(await this.vendorService.GetVendorBankDetailByIdentifierAsync(id)); } return(this.PartialView("_BankDetailAdd", model)); }