Esempio n. 1
0
        //public string GenerateAccountNumber()
        //{
        //    try
        //    {
        //        object[] paras = { };
        //        DataBaseHandler dbh = new DataBaseHandler();
        //        DataTable dt = dbh.GetData(CmdCommands.GetCustomerCount, paras);
        //        int ccount = Convert.ToInt32(dt.Rows[0][0]) + 01;
        //        string NewAC = "AC30267" + "0" + ccount;
        //        return NewAC;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }

        //}

        public string RegisterUser(string firstname, string lastname, string email, string telephone, string password)
        {
            try
            {
                //string UserId = GetUserId();
                string          Password = EncryptText(password);
                object[]        paras    = { firstname, lastname, email, telephone, Password };
                DataBaseHandler dbh      = new DataBaseHandler();
                string          r        = dbh.ExecuteDataset(CmdCommands.RegisterUser, paras);
                if (Convert.ToInt32(r) > 0)
                {
                    //string AccountType = "CORPORATE";
                    //Double MiniBalance = 2000000;
                    //string CreatedBy = "Admin";
                    //string UserAgentAccount = "C" + GenerateAccountNumber();
                    //object[] paras2 = { UserId, UserAgentAccount, AccountType, MiniBalance, CreatedBy };
                    //string r2 = dbh.ExecuteDataset(CmdCommands.CreateCustomerAccount, paras2);
                    return(r.ToString());
                }
                else
                {
                    return("0");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }