// if any error db will return 1 internal bool RegisterUser(User user) { try { command = database.GetStoredProcCommand("sp_SetUser"); database.AddInParameter(command, "@ID", SqlDbType.Int, user.Id); database.AddInParameter(command, "@Name", SqlDbType.NVarChar, user.Name); database.AddInParameter(command, "@Surname", SqlDbType.NVarChar, user.SurName); database.AddInParameter(command, "@Username", SqlDbType.NVarChar, user.UserName); database.AddInParameter(command, "@Password", SqlDbType.NVarChar, user.Password); database.AddInParameter(command, "@ProfilePicture", SqlDbType.NVarChar, user.ProfilePicture); database.ExecuteScalar(command); return true; } catch (Exception ex) { return false; } }
public static bool Register(User user) { return mUserLogic.RegisterUser(user); }
public bool Register(User user) { return User.Register(user); }