Exemplo n.º 1
0
        public static void Update(Guid companyId, Account account, string operatorAccount)
        {
            var repository = Factory.CreateAccountRepository();

            repository.Save(companyId, account);

            if (account.Type == AccountType.Receiving)
            {
                //将此账号设置为VIP账户
                AccountBaseService.SetVipAccount(account.No);
            }

            var companysrv = SMSCompanySmsParamService.Query(account.Type, companyId);

            if (companysrv == null)
            {
                var company = CompanyService.GetCompanyInfo(companyId);
                var emp     = EmployeeService.QueryCompanyAdmin(companyId);
                //绑定收款账号
                SMSCompanySmsParamService.SaveAccount(new ChinaPay.SMS.Service.Domain.CompanySmsParam()
                {
                    AccountNo = account.No, CompanyId = company.Id, CompanyName = company.AbbreviateName, CompanyType = company.Type, CompanyNo = emp.Login, AccountType = AccountType.Receiving
                });
            }
            else
            {
                companysrv.AccountNo = account.No;
                //修改收付款账号绑定
                SMSCompanySmsParamService.UpdateAccount(companysrv);
            }

            // 记录日志
            saveAddLog("收/付款账号", string.Format("账号:{0},账号类型:{1},是否有效:{2},账号绑定时间:{3}", account.No, account.Type.GetDescription(), account.Valid == true ? "是" : "否", account.Time.ToString()), account.No, operatorAccount);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 重置指定员工的密码。
        /// </summary>
        /// <param name="id">将被重置密码的员工的 Id</param>
        /// <param name="reason"> 重置密码原因 </param>
        /// <param name="operatorAccount">操作员账号</param>
        /// <returns>返回重置操作是否成功。</returns>
        public static bool ResetPassword(Guid id, string reason, string operatorAccount)
        {
            bool isSuccess       = false;
            var  defaultPassword = SystemManagement.SystemParamService.DefaultPassword;
            var  employee        = EmployeeService.QueryEmployee(id);

            //var employee = DataContext.Employees.Where(e => e.Id == id).Select(e => new Employee {
            //    Id = e.Id,
            //    Password = e.Password
            //}).FirstOrDefault();
            if (employee == null)
            {
                throw new InvalidOperationException("指定的账号不存在。");
            }
            if (AccountBaseService.GetMebershipUser(employee.UserName))
            {
                AccountBaseService.B3BResetLoginPassword(employee.UserName, defaultPassword);
            }
            isSuccess = DataContext.Employees.Update(e => new
            {
                Password = ChinaPay.Utility.MD5EncryptorService.MD5FilterZero(defaultPassword, "utf-8")
            }, e => e.Id == id) > 0;
            saveLog(OperationType.Update, string.Format("将账号{0}密码重置为{1}", employee.UserName, defaultPassword), OperatorRole.User, employee.UserName, operatorAccount);
            return(isSuccess);
        }
Exemplo n.º 3
0
 public string CheckPayAccountNOusable(string accountNo)
 {
     if (!AccountBaseService.GetMebershipUser(accountNo))
     {
         return("该账号不存在");
     }
     if (AccountService.Query(accountNo).Any())
     {
         return("该账号已经被绑定");
     }
     return(string.Empty);
 }
Exemplo n.º 4
0
        private void bindParameters(decimal businessId, string businessType, ProductType productType, decimal amount)
        {
            hidBusinessId.Value   = businessId.ToString();
            hidBusinessType.Value = businessType;
            hidProductType.Value  = ((int)productType).ToString();
            liShouldPay1.Text     = liShouldPay.Text = lblPayAmount.Text = amount.ToString("F2");
            string         payAccount  = GetCurrentCompanyPayAccount();
            MembershipUser paypoolUser = AccountBaseService.GetMembershipUser(payAccount);
            decimal        restMoney   = (string.IsNullOrEmpty(payAccount) || paypoolUser == null) ? 0m : paypoolUser.Account.AvailableBalance;

            liRestMoney.Text = restMoney.ToString("F2");
            liNeedMore.Text  = (amount - restMoney).ToString("F2");
        }
Exemplo n.º 5
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         IdCard.CheckIdentityCard(this.txtIDCard.Text);
         var user = this.IsAccountType() ?AccountBaseService.EnterpriseAccountOpening(this.GetEnterprisAccount()):
                    AccountBaseService.PersonAccountOpening(this.GetAccount() == null ? this.GetEnterprisAccount() : this.GetAccount());
         this.SucceedInfo();
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "开户");
     }
 }
Exemplo n.º 6
0
        public static void Disable(Guid companyId, AccountType type, string operatorAccount)
        {
            Account orginAccount = Query(companyId, type);

            UpdateStatus(companyId, type, false);

            if (type == AccountType.Receiving)
            {
                //取消此VIP收款账号
                AccountBaseService.CancelVipAccount(orginAccount.No);
            }
            // 记录日志
            saveUpdateLog("收/付款账号", string.Format("公司Id:{0},账号:{1},账号类型:{2},账号状态:{3}", companyId, orginAccount.No, orginAccount.Type.GetDescription(), orginAccount.Valid == true ? "是" : "否"),
                          string.Format("公司Id:{0},账号:{1},账号类型:{2},账号状态:{3}", companyId, orginAccount.No, orginAccount.Type.GetDescription(), "否"), orginAccount.No, operatorAccount);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据登录账号重置员工密码
        /// </summary>
        /// <param name="login">登录账号</param>
        /// <param name="reason"> 重置密码原因 </param>
        /// <param name="operatorAccount">操作员账号</param>
        /// <returns>返回重置密码操作是否成功</returns>
        public static bool ResetPassword(string login, string reason, string operatorAccount)
        {
            bool isSuccess       = false;
            var  defaultPassword = SystemManagement.SystemParamService.DefaultPassword;

            if (AccountBaseService.GetMebershipUser(login))
            {
                AccountBaseService.B3BResetLoginPassword(login, defaultPassword);
            }
            isSuccess = DataContext.Employees.Update(e => new
            {
                Password = ChinaPay.Utility.MD5EncryptorService.MD5FilterZero(defaultPassword, "utf-8")
            }, e => e.Login == login) > 0;
            saveLog(OperationType.Update, string.Format("将账号{0}密码重置为{1}", login, defaultPassword), OperatorRole.User, login, operatorAccount);
            return(isSuccess);
        }
Exemplo n.º 8
0
        public IActionResult Logon([FromBody] User user)
        {
            if (user == null)
            {
                return(NotFound());
            }

            if (!ModelState.IsValid)
            {
                return(Redirect(nameof(Login)));
            }

            var accountService = new AccountBaseService <User>();



            return(Redirect(nameof(Index)));
        }
Exemplo n.º 9
0
        /// <summary>
        /// 员工修改自身密码
        /// </summary>
        /// <param name="info">密码修改信息。</param>
        /// <param name="operatorAccount">操作员账号</param>
        /// <returns>返回修改操作是否成功。</returns>
        public static bool ChangePassword(ChangePasswordInfo info, string operatorAccount)
        {
            bool isSuccess = false;

            if (info == null)
            {
                throw new ArgumentNullException("info");
            }
            if (info.NewPassword != info.ConfirmPassword)
            {
                throw new InvalidOperationException("\"密码\" 与 \"确认密码\" 不相同。");
            }
            var employee = EmployeeService.QueryEmployee(info.EmployeeId);

            //var employee = DataContext.Employees.Where(e => e.Id == info.EmployeeId).Select(e => new Employee
            //{
            //    Id = e.Id,
            //    Password = e.Password
            //}).FirstOrDefault();
            if (employee == null)
            {
                throw new InvalidOperationException("指定的账号不存在。");
            }
            if (employee.UserPassword != Utility.MD5EncryptorService.MD5FilterZero(info.OldPassword, "utf-8"))
            {
                throw new InvalidOperationException("密码不正确。");
            }
            if (AccountBaseService.GetMebershipUser(info.UserNo))
            {
                AccountBaseService.B3BResetLoginPassword(info.UserNo, info.NewPassword);
            }
            isSuccess = DataContext.Employees.Update(e => new
            {
                Password = Utility.MD5EncryptorService.MD5FilterZero(info.NewPassword, "utf-8")
            }, e => e.Id == info.EmployeeId) > 0;
            saveLog(OperationType.Update, "修改密码。", OperatorRole.User, info.EmployeeId.ToString(), operatorAccount);
            return(isSuccess);
        }
Exemplo n.º 10
0
 /// <summary>
 /// 检查国付通账号存在不
 /// </summary>
 public bool CheckPayAcccountNo(string accountNo)
 {
     return(AccountBaseService.GetMebershipUser(accountNo));
 }