public void LoadCustomer(ICustomerMaster cm) { CustomerMasterList = cm.FetchAllCustomer(IncludeAdmin: true, OnlyActive: false); }
public void LoadData(int CustomerID, ICustomerMaster cm, IConfiguration config) { this.CustomerId = CustomerID; cm.CustomerId = CustomerID; this.DocumentPermission = cm.DocumentPermission; if (CustomerID > 0) { this.customerMaster = cm.FetchBasicDetail(); this.GSTDetails = cm.FetchGSTDetail(); this.banks = cm.FetchBanks(); this.pan = cm.FetchPan(); this.AllUserList = cm.FetchUserMasters(); this.userMaster = this.AllUserList.Where(p => p.IsPrimary).FirstOrDefault(); this.customerSetting = cm.FetchSetting(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.customerMaster == null) { this.customerMaster = new mdlCustomerMaster(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.GSTDetails == null) { this.GSTDetails = new mdlCustomerGSTDetails(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.banks == null) { this.banks = new mdlBanks(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.pan == null) { this.pan = new mdlPan(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.AllUserList == null) { this.AllUserList = new List <mdlUserMaster>(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.userMaster == null) { this.userMaster = new mdlUserMaster(); } if (cm.DocumentPermission.Any(p => p == enmDocumentMaster.CustomerDetailsPermission_BasicDetail_Read) && this.customerSetting == null) { this.customerSetting = new mdlCustomerSetting(); } this.ConfirmNewMpin = this.NewMpin = this.customerSetting.MPin; if (string.IsNullOrWhiteSpace(this.customerMaster.Logo)) { string DefaultImage = config["Organisation:DefaultIcon"]; var path = Path.Combine( Directory.GetCurrentDirectory(), "wwwroot/" + DefaultImage); LogoData = System.IO.File.ReadAllBytes(path); } else { string DefaultPath = config["Organisation:IconPath"]; var path = Path.Combine( Directory.GetCurrentDirectory(), "wwwroot/" + DefaultPath); LogoData = System.IO.File.ReadAllBytes(string.Concat(path, customerMaster.Logo)); } }
public CustomerMakerController(ICustomerMaster _customerMaster) { CustomerMaster = _customerMaster; }