Пример #1
0
        public bool RegisterMobileUser(MobileUsers user)
        {
            bool insertResult = false;

            try
            {
                string insertMobileUser = "******" +
                                          " VALUES('" + user.CustomerName.Format_Sql_String() + "','" +
                                          user.MobileNo.Format_Sql_String() + "','" +
                                          user.Pin + "','" +
                                          user.tbl_CustomerId + "','" +
                                          user.CustomerNo.Format_Sql_String() + "','" +
                                          user.Email.Format_Sql_String() + "','" +
                                          user.IdNo.Format_Sql_String() + "','" +
                                          ValueConverters.FormatSqlDate(DateTime.Now) + "','" +
                                          ValueConverters.ConvertNullToBool(user.Enabled) + "'); ";

                int result = mainDb.Database.ExecuteSqlCommand(insertMobileUser);

                if (result >= 1)
                {
                    insertResult = true;
                }
            }
            catch (Exception ex)
            {
                //log ex
            }

            return(insertResult);
        }
Пример #2
0
        private void GetAccountDetails(string customerNo, List <tbl_CustomerAccounts> accounts, bool telleringOperations)
        {
            if (accounts.Count != 0 && accounts != null)
            {
                if (customerAccounts == null)
                {
                    customerAccounts = new List <CustomerAccountsView>();
                }

                var customerDetails = customerManager.GetCustomerDetails(customerNo).FirstOrDefault();
                if (customerDetails == null)
                {
                    customerDetails = new CustomerDetailsView();
                }

                foreach (var account in accounts)
                {
                    var accountTypeDetails = accounttypes.FirstOrDefault(x => x.code == account.AccountType);//.ToList();
                    if (accountTypeDetails == null)
                    {
                        accountTypeDetails = new tbl_accounttypes();
                    }

                    if (telleringOperations && ValueConverters.ConvertNullToBool(accountTypeDetails.Disallow_Teller_Transactions))
                    {
                        continue;
                    }
                    customerAccounts.Add(new CustomerAccountsView
                    {
                        tbl_CustomerAccountsID = account.tbl_CustomerAccountsID,
                        CustomerNo             = customerNo,
                        AccountNo       = account.AccountNo,
                        AccountComments = account.AccountComments,
                        AccountRemarks  = account.AccountRemarks,
                        AccountType     = account.AccountType,
                        AccountTypeName = accountTypeDetails.category,
                        GlMemSav        = accountTypeDetails.glmemsav,
                        MinimumBalance  = accountTypeDetails.minimum_bal,
                        OpenedBy        = account.OpenedBy,
                        OpenedDate      = account.OpenedDate,
                        AuthorisedBy    = account.AuthorisedBy,
                        AuthorisedDate  = account.AuthorisedDate,
                        DateClosed      = account.DateClosed,
                        Locked          = account.Locked,
                        CustomerBranch  = customerDetails.Branch,
                        customerDetails =
                        { new CustomerDetailsView {
                              CustomerName    = customerDetails.CustomerName,
                              AccountComments = customerDetails.AccountComments,
                              AccountRemarks  = customerDetails.AccountRemarks,
                              Branch          = customerDetails.Branch,
                              Locked          = customerDetails.Locked,
                              CustomerIdNo    = customerDetails.CustomerIdNo,
                              DateClosed      = customerDetails.DateClosed,
                              MemberType      = customerDetails.MemberType,
                              MobileNo        = customerDetails.MobileNo,
                              CustomerNo      = customerNo
                          } },
                        AccountTypeSettings = accountTypeDetails
                    });
                }
            }
        }