public bool CreateAccount(int userId, out Account account) { Random rnd = new Random(); string message = ""; account = new Account(); if (userId == 0 || userId < 0) { throw new Exception("Пользователь не существует!"); } else if (servicesUser.IsExistUser(userId)) { account.UserId = userId; account.IBAN = "KZ" + rnd.Next(1, 100); account.AccountTypeId = rnd.Next(1, 2); if (db.Create <Account>(account, out message)) { return(true); } else { throw new Exception(message); } } return(false); }
//регистрация public bool Registration(User user) { if (user == null) { return(false); } else { string message = ""; if (!db.Create <User>(user, out message)) { throw new Exception(message); } else { return(true); } //return db.Create<User>(user, out message); } }
//регистрация public bool Registration(User user) { if (user == null) { return(false); } else { string message = ""; Tengri.GBD.ServiceGBDinfo ser = new GBD.ServiceGBDinfo(); user.personalData = ser.GetInfo(user.Iin); if (!db.Create <User>(user, out message)) { throw new Exception(message); } else { return(true); } //return db.Create<User>(user, out message); } }