public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement> Get_AdminOrdersList_CommercialAgreementDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>().AsQueryable(); return(__items.Where(@this => true)); }
/*<ControllerActionImplementation:IntermediaryRender:1/>*/ public ActionResult ExecuteIntermediaryRender(string id) { if (_parentController == null) { _parentController = new MasterPage.MasterPageController(new DSS5_SupplyChainFinancialsOptimisation.UI.ViewModels.MasterPage.MasterPageViewModel()); } ((MasterPage.MasterPageController)_parentController).ExecuteRender(); ActionResult _result = null; zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "SignUp", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "guid " + id); if (((id == null || id == ""))) { _result = GetRedirectInfo("ErrorPage", "Render", new RouteValueDictionary(new { })); } DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary intermediary = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary>((i) => i.GUID == id)?.FirstOrDefault(); if ((intermediary == null)) { _result = GetRedirectInfo("ErrorPage", "Render", new RouteValueDictionary(new { })); } @model.Intermediary = intermediary; @model.CompanyName = (intermediary?.Company ?? ""); @model.IsIntermediary = true; @model.ChoosenRole = "Intermediary"; return(_result); }
/*<ControllerActionImplementation:Create:1/>*/ public ActionResult ExecuteCreate() { ActionResult _result = null; _result = this.ExecuteAuthorizeAccess(); if (@model.password?.Trim() != @model.repeatPassword?.Trim()) { throw new Exception("Passwords do not match!"); } if (@model.username?.Trim() == "") { throw new Exception("No username provided!"); } zAppDev.DotNet.Framework.Identity.Model.ApplicationRole adminRole = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((r) => r.Name == "Administrator")?.FirstOrDefault(); if ((adminRole == null)) { throw new Exception("No Administrator role found in Database!"); } zAppDev.DotNet.Framework.Identity.Model.ApplicationUser adminUser = new zAppDev.DotNet.Framework.Identity.Model.ApplicationUser(); adminUser.UserName = (@model.username?.Trim() ?? ""); adminUser?.AddRoles(adminRole); string possibleError = zAppDev.DotNet.Framework.Identity.IdentityHelper.CreateUser(adminUser, (@model.password?.Trim() ?? "")); if ((((possibleError == null || possibleError == "")) == false)) { ClientCommand(ClientCommands.SHOW_MESSAGE, possibleError, MessageType.Error); return(null); } _result = GetRedirectInfo("SignInPage", "Load", new RouteValueDictionary(new { })); return(_result); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_LetterOfCreditForm_TransactionDataSource_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); return(__items.Where(@this => true)); }
public IQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole> Get_Dashboard_ApplicationRoleDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>().AsQueryable(); return(__items.Where(@this => true)); }
/*<ControllerActionImplementation:HandlePayment:1/>*/ public ActionResult ExecuteHandlePayment(string username, bool approved) { ActionResult _result = null; DSS5_SupplyChainFinancialsOptimisation.BO.Supplier supplier = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((a) => a.UserName == username)?.FirstOrDefault(); zAppDev.DotNet.Framework.Utilities.EMailMessage email = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); email.To = new List <string> { (supplier?.Email ?? "") }.ToList(); email.IsBodyHtml = true; if ((approved)) { supplier.Roles = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((a) => a.Name == "RegisteredSupplier").ToList(); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "PendingRegisteredSuppliersList", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Supplier Roles " + (supplier?.Roles?.FirstOrDefault()?.Name ?? "")); supplier.SupplierStatus = "RegisteredSupplier"; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(supplier); ClientCommand(ClientCommands.DATALIST_REFRESH, "SupplierListNoDT"); ClientCommand(ClientCommands.SHOW_MESSAGE, "Supplier " + (supplier?.UserName ?? "") + " is now Registered."); email.Subject = "Payment Approval"; email.Body = "Your payment has been approved from TOME FINANCE ® Administrator. " + "Please return to your profile and proceed to request validation."; } else { supplier.Roles = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((a) => a.Name == "RejectedSupplier").ToList(); supplier.SupplierStatus = "RejectedSupplier"; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(supplier); ClientCommand(ClientCommands.DATALIST_REFRESH, "SupplierListNoDT"); ClientCommand(ClientCommands.SHOW_MESSAGE, "Supplier " + (supplier?.UserName ?? "") + "is now Rejected.", MessageType.Warning); email.Subject = "Payment Rejection"; email.Body = "Your payment has been rejected from TOME FINANCE ® Administrator. Please provide us your company details and " + "your account details, in order to proceed with the return of the fee."; } zAppDev.DotNet.Framework.Utilities.Email.SendMail(email, true); return(_result); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_AdminPaymentsList_TransactionDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); return(__items.Where(@this => @this.PaymentStatus != null && @this.TransactionValue > 0)); }
/*<ControllerActionImplementation:Confirm:1/>*/ public ActionResult ExecuteConfirm(string email, string code) { if (_parentController == null) { _parentController = new MasterPage.MasterPageController(new DSS5_SupplyChainFinancialsOptimisation.UI.ViewModels.MasterPage.MasterPageViewModel()); } ((MasterPage.MasterPageController)_parentController).ExecuteRender(); ActionResult _result = null; zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((s) => s.Email == email)?.FirstOrDefault(); if (user == null) { ClientCommand(ClientCommands.SHOW_MESSAGE, "User not found", MessageType.Warning); return(null); } bool succe = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetUserManager().ConfirmEmailAsync(user.UserName, code).Result.Succeeded; zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "EmailConfirmation", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Code: " + code); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "EmailConfirmation", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "user: "******"")); if (((succe) == false)) { _result = GetRedirectInfo("EmailConfirmationFailure", "Render", new RouteValueDictionary(new { })); } else { _result = GetRedirectInfo("SignInPage", "Load", new RouteValueDictionary(new { })); } return(_result); }
/*<ControllerActionImplementation:ResetPassword:1/>*/ public ActionResult ExecuteResetPassword() { ActionResult _result = null; zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((u) => u.Email == @model.txtEmail)?.FirstOrDefault(); if ((user == null)) { ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage <string> .GetResourceValue("ForgotPassword", "RES_CUSTOM_NotFound").ToString(), MessageType.Error); return(null); } if ((((user?.Email ?? "") == null || (user?.Email ?? "").Trim() == "") || ((((user?.Email ?? "") == null ? false : CSharpVerbalExpressions.VerbalExpressions.DefaultExpression.Add(CSharpVerbalExpressions.CommonRegex.Email).Test((user?.Email ?? "")))) == false))) { ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage <string> .GetResourceValue("ForgotPassword", "RES_CUSTOM_NoMail").ToString(), MessageType.Error); return(null); } string code = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetUserManager().GeneratePasswordResetTokenAsync(user.UserName).Result; string link = (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["ServerExternalPath"]) ? System.Configuration.ConfigurationManager.AppSettings["ServerExternalPath"] : zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) + "/ResetPassword/Render" + "?code=" + System.Web.HttpUtility.UrlEncode(code); zAppDev.DotNet.Framework.Utilities.EMailMessage emailMessage = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); emailMessage.To = new List <string> { (user?.Email ?? "") }.ToList(); emailMessage.Subject = "Password Reset"; emailMessage.Body = "Please click <a href='" + link + "'>here</a> to reset your password"; emailMessage.IsBodyHtml = true; zAppDev.DotNet.Framework.Utilities.Email.SendMail(emailMessage, true); _result = CloseForm(); return(_result); }
/*<ControllerActionImplementation:InterestedInInvestor:1/>*/ public ActionResult ExecuteInterestedInInvestor() { ActionResult _result = null; DSS5_SupplyChainFinancialsOptimisation.BO.Agreement newAgreement = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement(); DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus newStatus = new DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus(); newStatus.Status = "Interested"; newStatus.ProvidedBy = "Supplier"; newStatus.DateOccured = DateTime.UtcNow; newAgreement?.AddAgreementStatus(newStatus); if ((zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.IsInRole("ValidatedSupplier") ?? false) || (zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.IsInRole("ActiveSupplier") ?? false)) { DSS5_SupplyChainFinancialsOptimisation.BO.Supplier newSup = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName()); newAgreement.Supplier = newSup; } newAgreement.Investor = new DSS5_SupplyChainFinancialsOptimisation.BO.Investor(); newAgreement.Investor = @model.Investor; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>(newAgreement); System.Collections.Generic.List <string> recipients = new System.Collections.Generic.List <string>(); recipients.Add((@model.Investor?.Email ?? "")); zAppDev.DotNet.Framework.Utilities.EMailMessage em = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); em.Subject = "New Agreement"; em.Body = "A new Agreement is created" + "Please edit the Agreement."; em.To = recipients.Distinct().ToList().ToList(); zAppDev.DotNet.Framework.Utilities.Email.SendMail(em, true); ClientCommand(ClientCommands.SHOW_MESSAGE, "New Agreement created."); return(_result); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Investor> Get_InvestorListNoDT_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>().AsQueryable(); return(__items.Where(@this => true)); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order> Get_AdminOrdersList_OrderDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order>().AsQueryable(); return(__items.Where(@this => @this.Transaction.Supplier.Roles.Any((a) => a.Name == "ActiveSupplier"))); }
public IQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationPermission> Get_ManageUser_Button1DataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationPermission>().AsQueryable(); return(__items); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier> Get_PendingRegisteredSuppliersList_SupplierDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>().AsQueryable(); return(__items.Where(@this => @this.SupplierStatus == "PendingRegistered")); }
/*<ControllerActionImplementation:SignIn:1/>*/ public ActionResult ExecuteSignIn() { ActionResult _result = null; bool success = zAppDev.DotNet.Framework.Identity.IdentityHelper.SignIn(@model.UserNameTextBox, @model.PasswordTextBox, @model.RememberMeCB); if (((success) == false)) { ClientCommand(ClientCommands.SHOW_MESSAGE, BaseViewPage<string>.GetResourceValue("SignInPage", "SignInFailed").ToString(), MessageType.Error); return null; } zAppDev.DotNet.Framework.Identity.Model.ApplicationUser appUser = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable<zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((ap) => ap.UserName == @model.UserNameTextBox)?.FirstOrDefault(); if ((appUser != null)) { if (((((appUser?.EmailConfirmed ?? false)) == false))) { zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "SignInPage", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "email confirm"); zAppDev.DotNet.Framework.Identity.IdentityHelper.SignOut(); ClientCommand(ClientCommands.SHOW_MESSAGE, "Please verify your Email first.", MessageType.Error); @model.ShowConfirmEmail = true; return null; } } string returnUrl = zAppDev.DotNet.Framework.Utilities.Web.GetFormArgument("returnUrl"); if (((((returnUrl == null || returnUrl.Trim() == "")) == false))) { ClientCommand(ClientCommands.REDIRECT, (!string.IsNullOrEmpty(ConfigurationHandler.GetAppSetting("ServerExternalPath")) ? ConfigurationHandler.GetAppSetting("ServerExternalPath"): zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) +returnUrl); } else { _result = GetRedirectInfo("HomePage", "Render", new RouteValueDictionary(new { })); } return _result; }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order> Get_LetterOfCreditForm_SelectOrder_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order>().AsQueryable(); var _var0 = @model.LetterOfCredit?.Transaction?.Id; return(__items.Where(@this => @this.Transaction.Id == _var0)); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_TransactionListNoDT_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); var _var0 = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName(); return(__items.Where(@this => (@this.PaymentStatus == "Funded Paid" || @this.PaymentStatus == "Partially Funded Paid" || @this.PaymentStatus == "Fully Paid") && @this.TransactionValue > 0 && @this.Supplier.UserName == _var0)); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_FinishedTransactionsList_TransactionDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); var _var0 = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName(); return(__items.Where(@this => @this.CommercialAgreement.Agreement.Investor.UserName == _var0 && @this.PaymentStatus == "Fully Paid")); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_IntermediaryTransactionList_TransactionDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); var _var0 = @model.IntermediaryId; return(__items.Where(@this => @this.Intermediaries.Any((i) => i.Id == _var0))); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order> Get_OrdersList_OrderDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Order>().AsQueryable(); var _var0 = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName(); return(__items.Where(@this => @this.Transaction.Supplier.UserName == _var0)); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction> Get_InvestorTransactionsList_TransactionDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>().AsQueryable(); var _var0 = @model.InvestorUsername; return(__items.Where(@this => @this.CommercialAgreement.Agreement.Investor.UserName == _var0)); }
public IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement> Get_AgreementList_AgreementDataSet_DatasourceQueryableImplementation(DatasourceRequest __request = null, bool shouldEvict = true) { __request = __request ?? new DatasourceRequest(0, int.MaxValue); var __items = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>().AsQueryable(); var _var0 = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName(); var _var1 = (zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.IsInRole("Administrator") ?? false); return(__items.Where(@this => (@this.Supplier != null && @this.Supplier.UserName == _var0) || (@this.Investor != null && @this.Investor.UserName == _var0) || (_var1))); }
/*<ControllerActionImplementation:RegistrationPayment:1/>*/ public ActionResult ExecuteRegistrationPayment() { ActionResult _result = null; DSS5_SupplyChainFinancialsOptimisation.BO.Supplier supplier = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((a) => a.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName())?.FirstOrDefault(); supplier.Roles = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((a) => a.Name == "PendingRegistered").ToList(); supplier.SupplierStatus = "PendingRegistered"; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(supplier); return(_result); }
/*<ControllerActionImplementation:SendConfirmationMail:1/>*/ public ActionResult ExecuteSendConfirmationMail() { ActionResult _result = null; zAppDev.DotNet.Framework.Identity.Model.ApplicationUser appUser = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable<zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((ap) => ap.UserName == @model.UserNameTextBox)?.FirstOrDefault(); string code = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetUserManager().GenerateEmailConfirmationTokenAsync(appUser.UserName).Result; string link = (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["ServerExternalPath"]) ? System.Configuration.ConfigurationManager.AppSettings["ServerExternalPath"] : zAppDev.DotNet.Framework.Utilities.Web.GetApplicationPathUri(false)) + "/EmailConfirmation/Confirm"+ "?email=" + System.Web.HttpUtility.UrlEncode((appUser?.Email ?? ""))+ "&code=" + System.Web.HttpUtility.UrlEncode(code); zAppDev.DotNet.Framework.Utilities.EMailMessage emailMessage = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); emailMessage.To = new List<string> { (appUser?.Email ?? "") } .ToList(); emailMessage.Subject = "Acount Activation"; emailMessage.Body = "Please click <a href='" + link + "'>here</a> to activate your account"; emailMessage.IsBodyHtml = true; zAppDev.DotNet.Framework.Utilities.Email.SendMail(emailMessage, true); return _result; }
/*<ControllerActionImplementation:Render:1/>*/ public ActionResult ExecuteRender() { if (_parentController == null) { _parentController = new MasterPageForLists.MasterPageForListsController(new DSS5_SupplyChainFinancialsOptimisation.UI.ViewModels.MasterPageForLists.MasterPageForListsViewModel()); } ((MasterPageForLists.MasterPageForListsController)_parentController).ExecuteRender(); ActionResult _result = null; string username = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName(); DSS5_SupplyChainFinancialsOptimisation.BO.IntermediaryUser user = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.IntermediaryUser>(username); if ((user != null && user?.Intermediary != null)) { @model.IntermediaryId = (user?.Intermediary?.Id ?? 0); } return(_result); }
/*<ControllerActionImplementation:NewLoC:1/>*/ public ActionResult ExecuteNewLoC(int?transactionId) { if (_parentController == null) { _parentController = new MasterPage.MasterPageController(new DSS5_SupplyChainFinancialsOptimisation.UI.ViewModels.MasterPage.MasterPageViewModel()); } ((MasterPage.MasterPageController)_parentController).ExecuteRender(); ActionResult _result = null; @model.LetterOfCredit.Transaction = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>(transactionId); DSS5_SupplyChainFinancialsOptimisation.BO.Supplier sup = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((s) => s.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName())?.FirstOrDefault(); if ((sup?.IsSupplier() ?? false)) { @model.IsSupplier = true; } return(_result); }
/*<ControllerActionImplementation:Reset:1/>*/ public ActionResult ExecuteReset() { ActionResult _result = null; zAppDev.DotNet.Framework.Identity.Model.ApplicationUser user = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((s) => s.Email == @model.Email)?.FirstOrDefault(); if (user == null) { throw new Exception("User not found"); } bool succeeded = zAppDev.DotNet.Framework.Identity.IdentityHelper.GetUserManager().ResetPasswordAsync(user.UserName, @model.Code, @model.Password).Result.Succeeded; if (((succeeded) == false)) { throw new Exception("An error occured"); } _result = GetRedirectInfo("SignInPage", "Load", new RouteValueDictionary(new { })); return(_result); }
/*<ControllerActionImplementation:Save:1/>*/ public ActionResult ExecuteSave() { ActionResult _result = null; zAppDev.DotNet.Framework.Identity.Model.ApplicationRole role = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((r) => r.Name == "Administrator")?.FirstOrDefault(); if ((role == null)) { throw new Exception((BaseViewPage <string> .GetResourceValue("FirstAdminSetup", "RES_CUSTOM_NoAdminRoleFound").ToString())); } if (((@model.ApplicationUser?.IsInRole("Administrator") ?? false))) { throw new Exception((BaseViewPage <string> .GetResourceValue("FirstAdminSetup", "RES_CUSTOM_AlreadyAdmin").ToString())); } @model.ApplicationUser?.AddRoles(role); new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>(@model.ApplicationUser); _result = GetRedirectInfo("HomePage", "Render", new RouteValueDictionary(new { })); return(_result); }
/*<ControllerActionImplementation:RequestValidation:1/>*/ public ActionResult ExecuteRequestValidation() { ActionResult _result = null; @model.Investor = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>((a) => a.UserName == zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName())?.FirstOrDefault(); @model.Investor.Roles = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((b) => b.Name == "PendingInvestor").ToList(); @model.Investor.InvestorStatus = "PendingInvestor"; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>(@model.Investor); ClientCommand(ClientCommands.SHOW_MESSAGE, "Wait for Validation from the Administrator"); zAppDev.DotNet.Framework.Identity.Model.ApplicationUser administrator = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>((a) => a.UserName == "Administrator")?.FirstOrDefault(); zAppDev.DotNet.Framework.Utilities.EMailMessage email = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); email.To = new List <string> { (administrator?.Email ?? "") }.ToList(); email.Subject = "Account Validation"; email.Body = "An Investor has requested Validation"; zAppDev.DotNet.Framework.Utilities.Email.SendMail(email, true); return(_result); }
/*<ControllerActionImplementation:ValidateInvestor:1/>*/ public ActionResult ExecuteValidateInvestor(string username) { ActionResult _result = null; DSS5_SupplyChainFinancialsOptimisation.BO.Investor investor = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>((a) => a.UserName == username)?.FirstOrDefault(); investor.Roles = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Get <zAppDev.DotNet.Framework.Identity.Model.ApplicationRole>((a) => a.Name == "Investor").ToList(); zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "PendingInvestorsList", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Investor Roles " + (investor?.Roles?.FirstOrDefault()?.Name ?? "")); investor.InvestorStatus = "Investor"; new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>(investor); ClientCommand(ClientCommands.DATALIST_REFRESH, "InvestorListNoDT"); ClientCommand(ClientCommands.SHOW_MESSAGE, "Investor " + (investor?.UserName ?? "") + " is now Validated"); zAppDev.DotNet.Framework.Utilities.EMailMessage email = new zAppDev.DotNet.Framework.Utilities.EMailMessage(); email.To = new List <string> { (investor?.Email ?? "") }.ToList(); email.Subject = "Account Validation"; email.Body = "Your account has been validated from TomeFinance administrator"; zAppDev.DotNet.Framework.Utilities.Email.SendMail(email, true); return(_result); }